diff --git a/src/pages/settings/components/ThemeCard.tsx b/src/pages/settings/components/ThemeCard.tsx index 2fef68c..212084c 100644 --- a/src/pages/settings/components/ThemeCard.tsx +++ b/src/pages/settings/components/ThemeCard.tsx @@ -12,7 +12,8 @@ function ThemeCard({ allThemes, }: any) { const [hover, setHover] = useState(false); - const [shift, setShift] = useState(0); + const [shiftEdit, setShiftEdit] = useState(0); + const [shiftShuffle, setShiftShuffle] = useState(0); const { handleThemeChange, currentTheme, setCurrentTheme, theme } = useCommonHooks(); return ( @@ -145,41 +146,79 @@ function ThemeCard({ {currentTheme === 'random' && cardTheme.name === theme.name ? ( - { - setShift(2); - }} - onMouseLeave={() => { - setShift(0); - }} - onClick={() => { - setShift(0); - }} - gap={0} - style={{ - zIndex: 300, - position: 'absolute', - right: 0, - top: 27 - shift, - backgroundColor: shift === 0 ? 'white' : 'var(--color-background)', - borderRadius: '50%', - padding: '8px', - margin: '4px', - border: 'solid 2px', - borderColor: shift === 0 ? 'black' : 'var(--color-text-pri)', - transition: 'all 0.2s', - }} - > - + { + setShiftEdit(2); + }} + onMouseLeave={() => { + setShiftEdit(0); + }} onClick={() => { - handleThemeChange(allThemes, false); + setShiftEdit(0); }} + gap={0} style={{ - fontSize: '2em', - fontWeight: 'bold', - color: shift === 0 ? 'black' : 'var(--color-text-pri)', + zIndex: 300, + position: 'absolute', + left: 0, + top: 27 - shiftEdit, + backgroundColor: shiftEdit === 0 ? 'white' : 'var(--color-background)', + borderRadius: '50%', + padding: '8px', + margin: '4px', + border: 'solid 2px', + borderColor: shiftEdit === 0 ? 'black' : 'var(--color-text-pri)', + transition: 'all 0.2s', }} - /> + > + { + handleOpen(cardTheme); + }} + style={{ + fontSize: '2em', + fontWeight: 'bold', + color: shiftEdit === 0 ? 'black' : 'var(--color-text-pri)', + }} + /> + + { + setShiftShuffle(2); + }} + onMouseLeave={() => { + setShiftShuffle(0); + }} + onClick={() => { + setShiftShuffle(0); + }} + gap={0} + style={{ + zIndex: 300, + position: 'absolute', + right: 0, + top: 27 - shiftShuffle, + backgroundColor: shiftShuffle === 0 ? 'white' : 'var(--color-background)', + borderRadius: '50%', + padding: '8px', + margin: '4px', + border: 'solid 2px', + borderColor: shiftShuffle === 0 ? 'black' : 'var(--color-text-pri)', + transition: 'all 0.2s', + }} + > + { + handleThemeChange(allThemes, false); + }} + style={{ + fontSize: '2em', + fontWeight: 'bold', + color: shiftShuffle === 0 ? 'black' : 'var(--color-text-pri)', + }} + /> + ) : (