-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
deb8764
commit 9c416c4
Showing
10 changed files
with
225 additions
and
14 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
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,37 @@ | ||
import useDictionary from "@/dictionaries/useDictionary"; | ||
import { Alert, Button, IconButton } from "@mui/joy" | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import { Info, X } from "react-feather" | ||
import { useLocalStorage } from "usehooks-ts" | ||
|
||
const ThemeChangableAlert = () => { | ||
const [open, setOpen] = useLocalStorage('theme_changable_alert', true); | ||
const dict = useDictionary(); | ||
|
||
if(!open) return <></>; | ||
|
||
return <Alert | ||
variant="outlined" | ||
color="success" | ||
startDecorator={ | ||
<Info/> | ||
} | ||
endDecorator={ | ||
<React.Fragment> | ||
<Link href="/settings"> | ||
<Button variant="plain" color="success" sx={{ mr: 1 }} onClick={() => setOpen(false)}> | ||
{dict.alerts.TimetableCourseList.action} | ||
</Button> | ||
</Link> | ||
<IconButton variant="soft" color="success" onClick={() => setOpen(false)}> | ||
<X /> | ||
</IconButton> | ||
</React.Fragment> | ||
} | ||
> | ||
{dict.alerts.TimetableCourseList.text} | ||
</Alert> | ||
} | ||
|
||
export default ThemeChangableAlert |
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
Oops, something went wrong.