Optimized sidebar styling

This commit is contained in:
keannu125 2023-02-21 14:17:40 +08:00
parent afe0aeb202
commit 116fb70b48
2 changed files with 28 additions and 17 deletions

View file

@ -20,18 +20,29 @@ export default function Sidebar() {
const logged_in = useSelector((state: state) => state.logged_in.value); const logged_in = useSelector((state: state) => state.logged_in.value);
if (!logged_in) { if (!logged_in) {
return ( return (
<div style={styles.sidebar_wrapper}> <div style={styles.sidebar_container}>
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "flex-end",
}}
>
<div <div
style={{ style={{
position: "relative", position: "relative",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
justifyContent: "flex-start",
}} }}
> >
<SidebarButton onClick={() => navigate("/")} name="Dashboard"> <SidebarButton onClick={() => navigate("/")} name="Dashboard">
<HomeIcon size={4} color="white" /> <HomeIcon size={4} color="white" />
</SidebarButton> </SidebarButton>
<SidebarButton onClick={() => navigate("/Products")} name="Products"> <SidebarButton
onClick={() => navigate("/Products")}
name="Products"
>
<ProductsIcon size={4} color="white" /> <ProductsIcon size={4} color="white" />
</SidebarButton> </SidebarButton>
<SidebarButton <SidebarButton
@ -42,6 +53,7 @@ export default function Sidebar() {
</SidebarButton> </SidebarButton>
</div> </div>
</div> </div>
</div>
); );
} else { } else {
return ( return (

View file

@ -139,14 +139,13 @@ const styles: { [key: string]: React.CSSProperties } = {
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
}, },
sidebar_wrapper: { sidebar_container: {
display: "flex",
flexDirection: "column",
height: "100vh", height: "100vh",
width: "100%", width: "100%",
paddingLeft: "2vh", paddingLeft: "2vh",
backgroundColor: "#3d4848", backgroundColor: "#3d4848",
}, },
sidebar_wrapper: {},
}; };
export default styles; export default styles;