From c5dcb2937dd2b1cd2791af2465bfb644e5fa0545 Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Sun, 13 Nov 2022 19:17:08 +0000 Subject: [PATCH] fix: background blur transition --- .../modals/main/settings/ChipSelect.jsx | 56 +++++++++++++++++++ .../sections/background/Background.jsx | 30 ++++++---- .../widgets/background/Background.jsx | 11 +++- .../widgets/background/PhotoInformation.jsx | 2 +- .../background/scss/_photoinformation.scss | 21 ++++++- .../widgets/background/scss/index.scss | 15 +++++ src/modules/constants.js | 2 +- 7 files changed, 121 insertions(+), 16 deletions(-) create mode 100644 src/components/modals/main/settings/ChipSelect.jsx 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}) + + ))} + + + */} + )}