-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(client): dialog for when user logs out * added auth cleanup and user addition to db * lint * changed ci * Update auth.service.ts * Feature: Changed dark mode settings toggle to icon button in sidebar (Sidebar Dark Mode Icon #850) (#850) * adding redirect link to devsoc * made dark mode button component * removed dark mode toggle * removed darkmode toggle from settings * made sidebar footer icons padding consistent * added prop type for dark mode button * sync dark mode button updates * fully implemented dark mode button --------- Co-authored-by: ray <[email protected]> Co-authored-by: Dylan Zhang <[email protected]> * docs: added our latest 2024 subcom member * renamed migrations --------- Co-authored-by: hhuolu <[email protected]> Co-authored-by: dlyn <[email protected]> Co-authored-by: Dylan Zhang <[email protected]> Co-authored-by: Shaam <[email protected]> Co-authored-by: Jasmine Tran <[email protected]>
- Loading branch information
1 parent
543dbec
commit c1b9c77
Showing
15 changed files
with
120 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { | ||
NightsStay as DarkModeIcon, | ||
LightMode as LightModeIcon, | ||
} from '@mui/icons-material'; | ||
import { IconButton, Tooltip, Typography } from '@mui/material'; | ||
import { styled } from '@mui/system'; | ||
import React, { useContext } from 'react'; | ||
|
||
import { DarkModeButtonProps } from '../../interfaces/PropTypes'; | ||
import { AppContext } from '../../context/AppContext'; | ||
|
||
const ToggleDarkModeButton = styled(IconButton)` | ||
display: flex; | ||
border-radius: 8px; | ||
justify-content: flex-between; | ||
padding: 12px 12px 12px 12px; | ||
`; | ||
|
||
const IndividualComponentTypography = styled(Typography)<{ collapsed: boolean }>` | ||
padding-left: ${(props) => (props.collapsed ? '0px' : '12px')}; | ||
font-size: 16px; | ||
`; | ||
|
||
const DarkModeButton: React.FC<DarkModeButtonProps> = ({ | ||
collapsed, | ||
}) => { | ||
const { | ||
isDarkMode, | ||
setIsDarkMode, | ||
} = useContext(AppContext); | ||
|
||
const toggleDarkMode = () => { | ||
setIsDarkMode(!isDarkMode); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Tooltip title={collapsed ? (isDarkMode ? "Dark Mode" : "Light Mode") : ''} placement="right"> | ||
<ToggleDarkModeButton color="inherit" onClick={toggleDarkMode}> | ||
{isDarkMode ? (<LightModeIcon />) : (<DarkModeIcon />)} | ||
<IndividualComponentTypography collapsed={collapsed}> | ||
{collapsed ? '' : (isDarkMode ? "Change to Light Mode" : "Change to Dark Mode")} | ||
</IndividualComponentTypography> | ||
</ToggleDarkModeButton> | ||
</Tooltip> | ||
</> | ||
); | ||
}; | ||
|
||
export default DarkModeButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"Jordan Benjamin", | ||
"Nikki Qin", | ||
"Lucy Chhuo", | ||
"Sohum Shah" | ||
"Sohum Shah", | ||
"Dylan Zhang" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters