-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathOwnerFilter.js
More file actions
37 lines (32 loc) · 978 Bytes
/
OwnerFilter.js
File metadata and controls
37 lines (32 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import * as React from "react";
import { ToolBarButton } from "@/components/Buttons";
export default function OwnerFilter({ onChange, selected }) {
const [selectedButton, setSelectedButton] = React.useState("all");
React.useEffect(() => {
setSelectedButton(selected || "all");
}, [selected]);
const onButtonClicked = (type) => {
setSelectedButton(type);
if (onChange) {
onChange(type);
}
};
return (
<div className="flex">
<ToolBarButton
handleOnClick={() => onButtonClicked("all")}
// disabled={selected === "all" || selected === undefined}
cclas={selectedButton === "all" ? `text-brand-hightlight` : ""}
>
All Ideas
</ToolBarButton>
<ToolBarButton
handleOnClick={() => onButtonClicked("me")}
// disabled={selected === "me"}
cclas={selectedButton === "me" ? `text-brand-hightlight` : ""}
>
My Ideas
</ToolBarButton>
</div>
);
}