diff --git a/package.json b/package.json index c6d92bfa..42b2e092 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@sentry/react": "^7.17.2", "embla-carousel-autoplay": "^7.0.3", "embla-carousel-react": "^7.0.3", + "fast-blurhash": "^1.1.1", "image-conversion": "^2.1.1", "react": "^18.2.0", "react-clock": "3.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f18ba89..fe9bf7a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,7 @@ specifiers: embla-carousel-react: ^7.0.3 eslint: ^8.26.0 eslint-config-react-app: ^7.0.1 + fast-blurhash: ^1.1.1 husky: ^8.0.1 image-conversion: ^2.1.1 prettier: ^2.7.1 @@ -45,6 +46,7 @@ dependencies: '@sentry/react': 7.17.2_react@18.2.0 embla-carousel-autoplay: 7.0.3 embla-carousel-react: 7.0.3_react@18.2.0 + fast-blurhash: 1.1.1 image-conversion: 2.1.1 react: 18.2.0 react-clock: 3.1.0_biqbaboplfbrettd7655fr4n2y @@ -3605,6 +3607,10 @@ packages: resolution: {integrity: sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==} dev: false + /fast-blurhash/1.1.1: + resolution: {integrity: sha512-U3mTWNRE92S4gKARJBbUmEpuYtnet+1BEeUf1qWrUHs54Db4+0aDqI9LBu7doCueFf2SRlfbR89bj+Cm89uw8A==} + dev: false + /fast-deep-equal/3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true diff --git a/src/components/modals/main/settings/ChipSelect.jsx b/src/components/modals/main/settings/ChipSelect.jsx new file mode 100644 index 00000000..ec7c2547 --- /dev/null +++ b/src/components/modals/main/settings/ChipSelect.jsx @@ -0,0 +1,56 @@ +import { useState, memo, useEffect } from 'react'; +import { useTheme } from '@mui/material/styles'; +import Box from '@mui/material/Box'; +import OutlinedInput from '@mui/material/OutlinedInput'; +import InputLabel from '@mui/material/InputLabel'; +import MenuItem from '@mui/material/MenuItem'; +import FormControl from '@mui/material/FormControl'; +import Select from '@mui/material/Select'; +import Chip from '@mui/material/Chip'; + +function ChipSelect({ label, options, name }) { + const [optionsSelected, setoptionsSelected] = useState([]); + + const handleChange = (event) => { + const { + target: { value }, + } = event; + setoptionsSelected( + typeof value === 'string' ? value.split(',') : value, + ); + localStorage.setItem('apiCategories', optionsSelected) + }; + console.log(localStorage.getItem('apiCategories')) + + + return ( +
+ + {label} + + +
+ ); +} + +export default memo(ChipSelect); diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 2ead80c4..1131a7d7 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -5,6 +5,7 @@ import { MdSource, MdOutlineKeyboardArrowRight, MdOutlineAutoAwesome } from 'rea import Header from '../../Header'; import Checkbox from '../../Checkbox'; +import ChipSelect from '../../ChipSelect'; import Dropdown from '../../Dropdown'; import Slider from '../../Slider'; import Radio from '../../Radio'; @@ -125,16 +126,25 @@ export default class BackgroundSettings extends PureComponent { ) : ( - - {this.state.backgroundCategories.map((category) => ( - - {category.name.charAt(0).toUpperCase() + category.name.slice(1)} ({category.count}) - - ))} - + <> + {/* + {this.state.backgroundCategories.map((category) => ( + + {category.name.charAt(0).toUpperCase() + category.name.slice(1)} ( + {category.count}) + + ))} + + + */} + )}