-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
7 changed files
with
88 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ActionIcon, Group } from '@mantine/core'; | ||
import { IconSun, IconMoonStars } from '@tabler/icons-react'; | ||
import { useMantineColorScheme } from '@mantine/core'; | ||
|
||
export const ThemeSwitcher = () => { | ||
const { colorScheme, toggleColorScheme } = useMantineColorScheme(); | ||
const dark = colorScheme === 'dark'; | ||
|
||
return ( | ||
<Group | ||
align="center" | ||
justify="center" | ||
style={{ marginRight: '1rem' }} | ||
> | ||
<ActionIcon | ||
onClick={() => toggleColorScheme()} | ||
size="lg" | ||
variant="filled" | ||
style={{ | ||
backgroundColor: dark ? 'white' : 'black', | ||
color: dark ? 'black' : 'white', | ||
}} | ||
aria-label="Toggle theme" | ||
> | ||
{dark ? <IconSun size="1.25rem" /> : <IconMoonStars size="1.25rem" />} | ||
</ActionIcon> | ||
</Group> | ||
); | ||
}; | ||
|
||
export default ThemeSwitcher; |
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 |
---|---|---|
@@ -1,37 +1,38 @@ | ||
import { primaryIconProps } from "@/constants"; | ||
import { NewGalleryForm } from "@/pages/Dashboard/components/NewGalleryForm"; | ||
import { useMetagalleryStore } from "@/providers/MetagalleryProvider"; | ||
import { Button } from "@mantine/core"; | ||
import { Button, Group } from "@mantine/core"; | ||
import { IconSparkles } from "@tabler/icons-react"; | ||
import ThemeSwitcher from "../DarkerMode/themeSwitcher"; | ||
|
||
export const NewGalleryButton = () => { | ||
return ( | ||
<Button | ||
variant="primary" | ||
onClick={() => { | ||
useMetagalleryStore.getState().openModal({ | ||
id: 'new-gallery-modal', | ||
centered: true, | ||
withCloseButton: false, | ||
size: 'auto', | ||
overlayProps: { | ||
backgroundOpacity: 0.55, | ||
blur: 3, | ||
}, | ||
style: { | ||
overflow: 'hidden', | ||
}, | ||
pos: 'relative', | ||
child: ( | ||
<NewGalleryForm modalKey={'new-gallery-modal'} /> | ||
), | ||
}); | ||
}} | ||
leftSection={( | ||
<IconSparkles {...primaryIconProps} /> | ||
)} | ||
> | ||
Nueva galería | ||
</Button> | ||
<Group align="center"> | ||
<ThemeSwitcher /> | ||
<Button | ||
variant="filled" | ||
color="dark" | ||
onClick={() => { | ||
useMetagalleryStore.getState().openModal({ | ||
id: 'new-gallery-modal', | ||
centered: true, | ||
withCloseButton: false, | ||
size: 'auto', | ||
overlayProps: { | ||
backgroundOpacity: 0.55, | ||
blur: 3, | ||
}, | ||
style: { | ||
overflow: 'hidden', | ||
}, | ||
pos: 'relative', | ||
child: <NewGalleryForm modalKey={'new-gallery-modal'} />, | ||
}); | ||
}} | ||
leftSection={<IconSparkles {...primaryIconProps} />} | ||
> | ||
Nueva galería | ||
</Button> | ||
</Group> | ||
); | ||
}; |
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