Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
001elijah committed Jun 29, 2023
1 parent cbd816f commit 81d3eb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/BoardList/BoardList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { BoardItem } from '../BoardItem/BoardItem';
import sprite from 'assets/icons/sprite.svg';
import s from './BoardList.module.scss';
import shortid from 'shortid';

export const BoardList = ({ theme, boards, currentBoard }) => {
const [current, setCurrent] = useState(currentBoard?._id);
Expand All @@ -13,12 +14,11 @@ export const BoardList = ({ theme, boards, currentBoard }) => {
useEffect(() => {
setCurrent(currentBoard?._id);
}, [currentBoard?._id]);

return (
<ul className={s.list}>
{boards.map(({ title, icon, _id }) => (
<BoardItem
key={_id}
key={shortid.generate()}
boardName={title}
icon={`${sprite}#${icon}`}
theme={theme}
Expand Down
2 changes: 1 addition & 1 deletion src/components/BoardModalWindow/BoardModalWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const BoardModalWindow = ({
}) => {
const theme = useSelector(selectorTheme);
const [title, setTitle] = useState(inputTitle);
const [background, setBackground] = useState('dark');
const [background, setBackground] = useState('null');
const [icon, setIcon] = useState('');
const [isValid, setIsValid] = useState(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import s from './BoxRadioBackgroundGroup.module.scss';
import { currentBoard } from 'redux/Boards/boardsSelectors';

export const BoxRadioBackgroundGroup = ({ valueChange }) => {
const dispatch = useDispatch();

const thumbnails = useSelector(selectBackgroundThumbnails);
const loading = useSelector(selectBackgroundLoading);
const theme = useSelector(selectorTheme);
const dispatch = useDispatch();
const board = useSelector(currentBoard);
const [background, setBackground] = useState(board.background);

const [background, setBackground] = useState(board?.background);

const handleChange = e => {
const selectedBackground = e.target.value;
Expand All @@ -28,10 +30,7 @@ export const BoxRadioBackgroundGroup = ({ valueChange }) => {
useEffect(() => {
dispatch(getListOfThumbnails());
}, [dispatch]);

useEffect(() => {
setBackground('default');
}, []);

return (
<div className={s.backgroundGroupWrapper}>
<h1 className={`${s.label} ${s[theme]}`}>Background</h1>
Expand Down

0 comments on commit 81d3eb6

Please sign in to comment.