chore: refine bookmarking

This commit is contained in:
Ibrahima G. Coulibaly
2025-07-15 14:01:38 +01:00
parent afc61e6f4c
commit 1031db7ed2
4 changed files with 47 additions and 37 deletions

View File

@@ -8,6 +8,7 @@ import { categoriesColors } from '../config/uiConfig';
import { getToolsByCategory } from '@tools/index';
import { useEffect, useState } from 'react';
import { isBookmarked, toggleBookmarked } from '@utils/bookmark';
import IconButton from '@mui/material/IconButton';
const StyledButton = styled(Button)(({ theme }) => ({
backgroundColor: 'white',
@@ -107,19 +108,22 @@ export default function ToolHeader({
<Typography mb={2} fontSize={30} color={'primary'}>
{title}
</Typography>
<Icon
fontSize={30}
color={
bookmarked
? theme.palette.primary.main
: theme.palette.grey[500]
}
<IconButton
onClick={(e) => {
toggleBookmarked(path);
setBookmarked(!bookmarked);
}}
icon={bookmarked ? 'mdi:bookmark' : 'mdi:bookmark-plus-outline'}
/>
>
<Icon
fontSize={30}
color={
bookmarked
? theme.palette.primary.main
: theme.palette.grey[500]
}
icon={bookmarked ? 'mdi:bookmark' : 'mdi:bookmark-plus-outline'}
/>
</IconButton>
</Stack>
<Typography fontSize={20}>{description}</Typography>
<ToolLinks />