Skip to content
Snippets Groups Projects
Commit dab25230 authored by Aggarwal Himanshu's avatar Aggarwal Himanshu
Browse files

Separate toggle button into its own component

parent 17a4b574
No related branches found
No related tags found
2 merge requests!17Merge develop into main,!10Add ability to select two cryptocurrencies for comparison
import React from "react";
import classNames from "classnames";
export function ToggleButton({ children, setActive, active, id }) {
return (
<button
className={classNames(" px-3 py-2 rounded-md font-light", {
"dark:bg-white dark:text-gray-800": active === id,
"dark:bg-black dark:text-gray-400": active !== id,
})}
onClick={() => setActive(id)}
>
{children}
</button>
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment