Skip to content

Commit f5d7c19

Browse files
josh-ramos-22Josh Ramos
andauthored
[WEB-3] add icons to new page, new folder, and edit button (#332)
* Initial adding of buttons, with new ButtonIcon styled component * Added styled component 'ButtonText' for text alignment within buttons --------- Co-authored-by: Josh Ramos <josh.ramos@student.unsw.edu.au>
1 parent ebbc735 commit f5d7c19

File tree

1 file changed

+34
-3
lines changed
  • frontend/src/packages/dashboard/components/SideBar

1 file changed

+34
-3
lines changed

frontend/src/packages/dashboard/components/SideBar/SideBar.tsx

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import Button from "@mui/material/Button";
44
import { useNavigate } from "react-router-dom";
55
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
66
import MenuIcon from "@mui/icons-material/Menu";
7+
import DescriptionOutlinedIcon from '@mui/icons-material/DescriptionOutlined';
8+
import FolderOutlinedIcon from '@mui/icons-material/FolderOutlined';
9+
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
710

811
const Container = styled.div`
912
position: relative;
@@ -59,6 +62,18 @@ const ButtonGroup = styled.div`
5962
grid-gap: 30px;
6063
`;
6164

65+
const ButtonIcon = styled.div`
66+
margin: 0 1rem 0;
67+
display: flex;
68+
align-items: center
69+
`;
70+
71+
const ButtonText = styled.p`
72+
flex-grow: 2;
73+
text-align: left;
74+
margin: 0.2rem 0;
75+
`;
76+
6277
interface SideBarButtonProps {
6378
bgcolor: string;
6479
}
@@ -72,6 +87,7 @@ const SidebarButton = styled(Button)<SideBarButtonProps>`
7287
border-radius: 20px;
7388
text-transform: none;
7489
color: black;
90+
display: flex;
7591
&:hover {
7692
transform: scale(1.04);
7793
background-color: darkgrey;
@@ -145,19 +161,34 @@ export default function SideBar({
145161
onClick={handleNewFile}
146162
data-anchor="NewPageButton"
147163
>
148-
New page
164+
<ButtonIcon>
165+
<DescriptionOutlinedIcon/>
166+
</ButtonIcon>
167+
<ButtonText>
168+
New page
169+
</ButtonText>
149170
</SidebarButton>
150171
<SidebarButton
151172
bgcolor="#b4c6ff"
152173
onClick={handleNewFolder}
153174
data-anchor="NewFolderButton"
154175
>
155-
New folder
176+
<ButtonIcon>
177+
<FolderOutlinedIcon/>
178+
</ButtonIcon>
179+
<ButtonText>
180+
New folder
181+
</ButtonText>
156182
</SidebarButton>
157183
</ButtonGroup>
158184
<ButtonGroup>
159185
<SidebarButton bgcolor="white" onClick={handleEdit}>
160-
Edit
186+
<ButtonIcon>
187+
<EditOutlinedIcon/>
188+
</ButtonIcon>
189+
<ButtonText>
190+
Edit
191+
</ButtonText>
161192
</SidebarButton>
162193
{/* <SidebarButton bgcolor="#B8E8E8">
163194
Feature

0 commit comments

Comments
 (0)