feat: add theme manager

awesome!
This commit is contained in:
Sonny
2024-05-12 00:46:48 +02:00
committed by Sonny
parent b5cda75790
commit 3531038321
19 changed files with 271 additions and 203 deletions

View File

@@ -1,7 +1,12 @@
import styled from '@emotion/styled';
import { MouseEventHandler } from 'react';
import { AiFillStar, AiOutlineStar } from 'react-icons/ai';
import ActionStyle from '~/components/dashboard/quick_action/_quick_action_style';
import { theme } from '~/styles/theme';
const StartIcon = styled(AiFillStar)(({ theme }) => ({
color: theme.colors.yellow,
}));
const UnstaredIcon = StartIcon.withComponent(AiOutlineStar);
const QuickLinkFavoriteStyle = ActionStyle.withComponent('div');
const QuickLinkFavorite = ({
@@ -14,11 +19,7 @@ const QuickLinkFavorite = ({
<QuickLinkFavoriteStyle
onClick={onClick ? (event) => onClick(event) : undefined}
>
{isFavorite ? (
<AiFillStar color={theme.colors.yellow} />
) : (
<AiOutlineStar color={theme.colors.yellow} />
)}
{isFavorite ? <StartIcon /> : <UnstaredIcon />}
</QuickLinkFavoriteStyle>
);