diff --git a/src/pages/settings/components/ThemeCard.tsx b/src/pages/settings/components/ThemeCard.tsx index c0aabc2..7fe8516 100644 --- a/src/pages/settings/components/ThemeCard.tsx +++ b/src/pages/settings/components/ThemeCard.tsx @@ -1,8 +1,16 @@ import { ActionIcon, Box, Button, Group, Stack, Text } from '@mantine/core'; -import { FiCheck, FiEdit, FiTrash } from 'react-icons/fi'; +import { FiCheck, FiEdit, FiShuffle, FiTrash, FiX } from 'react-icons/fi'; import { actionIconClasses } from 'styles'; -function ThemeCard({ handleOpen, handleDeleteTheme, theme, setValue, createTheme }: any) { +function ThemeCard({ + handleOpen, + handleDeleteTheme, + theme, + cardTheme, + currentTheme, + setValue, + createTheme, +}: any) { return ( - {theme.name} + {cardTheme.name} - - { - createTheme({ - method: 'PATCH', - endpoint: 'api/themes', - body: { ...theme, randomEnabled: !theme.randomEnabled }, - }); + zIndex: 300, + position: 'absolute', + right: 0, + backgroundColor: 'white', + borderRadius: '50%', + padding: '8px', + margin: '4px', + border: 'solid 2px black', }} > - - - handleOpen(theme)} - mb={2} + + + ) : ( + - - - handleDeleteTheme(theme)} - > - - - + { + createTheme({ + method: 'PATCH', + endpoint: 'api/themes', + body: { ...cardTheme, randomEnabled: !cardTheme.randomEnabled }, + }); + }} + > + {cardTheme.randomEnabled ? : } + + handleOpen(cardTheme)} + mb={2} + > + + + handleDeleteTheme(cardTheme)} + > + + + + )} ); } diff --git a/src/pages/settings/components/ThemeModal.tsx b/src/pages/settings/components/ThemeModal.tsx index a6273a0..2619bac 100644 --- a/src/pages/settings/components/ThemeModal.tsx +++ b/src/pages/settings/components/ThemeModal.tsx @@ -254,7 +254,7 @@ function ThemeModal({ - diff --git a/src/pages/settings/components/Themes.tsx b/src/pages/settings/components/Themes.tsx index e33c81a..da6b2ed 100644 --- a/src/pages/settings/components/Themes.tsx +++ b/src/pages/settings/components/Themes.tsx @@ -1,4 +1,4 @@ -import { Button, Group, Stack, Switch, Text } from '@mantine/core'; +import { Box, Button, Group, Overlay, Stack, Switch, Text } from '@mantine/core'; import { useDisclosure, useLocalStorage } from '@mantine/hooks'; import { useMutationAPI, useQueryAPI } from 'hooks'; import { useEffect, useState } from 'react'; @@ -74,7 +74,6 @@ function ThemesSettings({ theme }: any) { openDeleteConfirmModal(theme); close(); }; - return ( <> - - {themesList.map((theme: any) => ( - - {theme.name === currentTheme && ( + + + {themesList.map((cardTheme: any) => ( + + {cardTheme.name === currentTheme && ( )} - + + + ))}