Skip to content

Commit 971269a

Browse files
committed
added toggle button layout
1 parent f88fe76 commit 971269a

File tree

2 files changed

+46
-33
lines changed

2 files changed

+46
-33
lines changed

apps/frontend/ui/src/layout/partials/Sidebar/func.tsx

+45-33
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import {
44
LightbulbFilled,
55
SearchFilled,
66
HandshakeFilled,
7+
ChevronLeftFilled,
78
} from "@fluentui/react-icons";
89

9-
import { Flex, Divider, TabList, Tab, Tooltip } from "@lib-components";
10+
import { Flex, Divider, TabList, Tab, Tooltip, Button } from "@lib-components";
1011
import { Logo } from "@lib-theme";
1112

1213
import useSidebarClasses from "@app-ui/layout/partials/Sidebar/styles";
@@ -31,43 +32,54 @@ export default function Sidebar({
3132
<Flex
3233
className={classes.root}
3334
direction="column"
34-
justifyContent="start"
35-
alignItems="center"
36-
padding={["SNudge"]}
37-
gap="S"
35+
justifyContent="spaceBetween"
36+
alignItems="end"
3837
>
39-
<Logo size={isExpanded ? "extraLarge" : "medium"} />
40-
<Divider appearance="subtle" />
4138
<Flex
42-
shHeight="100%"
43-
shWidth="100%"
44-
justifyContent={isExpanded ? "start" : "center"}
45-
margin={isExpanded ? ["None", "XS", "None", "M"] : ["None"]}
39+
direction="column"
40+
justifyContent="start"
41+
alignItems="center"
42+
padding={["SNudge"]}
43+
gap="S"
4644
>
47-
<TabList vertical defaultSelectedValue={defaultTab}>
48-
<Tab
49-
icon={<LightbulbFilled />}
50-
value="overview"
51-
onClick={overviewTabAction}
52-
>
53-
{isExpanded && "Overview"}
54-
</Tab>
55-
<Tab icon={<SearchFilled />} value="browse" onClick={browseTabAction}>
56-
{isExpanded && "Browse"}
57-
</Tab>
58-
<Tooltip
59-
content="Will be available in 2.0"
60-
relationship="label"
61-
appearance="inverted"
62-
withArrow
63-
positioning="below-end"
64-
>
65-
<Tab icon={<HandshakeFilled />} value="contribute" disabled>
66-
{isExpanded && "Contribute"}
45+
<Logo size={isExpanded ? "extraLarge" : "medium"} />
46+
<Divider appearance="subtle" />
47+
<Flex
48+
shHeight="100%"
49+
shWidth="100%"
50+
justifyContent={isExpanded ? "start" : "center"}
51+
margin={isExpanded ? ["None", "XS", "None", "M"] : ["None"]}
52+
>
53+
<TabList vertical defaultSelectedValue={defaultTab}>
54+
<Tab
55+
icon={<LightbulbFilled />}
56+
value="overview"
57+
onClick={overviewTabAction}
58+
>
59+
{isExpanded && "Overview"}
6760
</Tab>
68-
</Tooltip>
69-
</TabList>
61+
<Tab
62+
icon={<SearchFilled />}
63+
value="browse"
64+
onClick={browseTabAction}
65+
>
66+
{isExpanded && "Browse"}
67+
</Tab>
68+
<Tooltip
69+
content="Will be available in 2.0"
70+
relationship="label"
71+
appearance="inverted"
72+
withArrow
73+
positioning="below-end"
74+
>
75+
<Tab icon={<HandshakeFilled />} value="contribute" disabled>
76+
{isExpanded && "Contribute"}
77+
</Tab>
78+
</Tooltip>
79+
</TabList>
80+
</Flex>
7081
</Flex>
82+
<Button icon={<ChevronLeftFilled />} appearance="subtle" size="small" />
7183
</Flex>
7284
);
7385
}

libs/components/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export { Divider } from "@fluentui/react-components";
22
export { Tab } from "@fluentui/react-components";
33
export { TabList } from "@fluentui/react-components";
4+
export { Button } from "@fluentui/react-components";
45

56
export { Tooltip } from "@lib-components/atoms";
67
export { Flex } from "@lib-components/layout";

0 commit comments

Comments
 (0)