generated from goitacademy/react-homework-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,44 @@ | ||
import { selectorTheme } from 'redux/Auth/authSelectors'; | ||
import { useSelector } from 'react-redux'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
import React, { useState } from 'react'; | ||
import { HeaderDashBoard } from 'components/HeaderDashBoard/HeaderDashBoard'; | ||
import s from './Default.module.scss'; | ||
import { BoardModalWindow } from '../BoardModalWindow/BoardModalWindow'; | ||
|
||
export const DefaultDashBoard = () => { | ||
import { addNewBoard } from 'redux/Boards/boardsOperations'; | ||
export const DefaultDashBoard = () => { | ||
const dispatch = useDispatch(); | ||
const theme = useSelector(selectorTheme); | ||
const [showModalWindow, setShowModalWindow] = useState(false); | ||
const handleModalWindowOpen = () => setShowModalWindow(true); | ||
const handleModalWindowClose = () => setShowModalWindow(false); | ||
|
||
const handleAddBoard = async newBoard => { | ||
await dispatch(addNewBoard(newBoard)); | ||
}; | ||
return ( | ||
<> | ||
<div className={clsx(s.backGround, s[theme])}> | ||
<HeaderDashBoard /> | ||
|
||
<p className={clsx(s.defaultTitle, s[theme])}> | ||
Before starting your project, it is essential | ||
<span className={clsx(s.defaultLink, s[theme])}> | ||
{' '} | ||
to create a board{' '} | ||
<span className={clsx(s.defaultLink, s[theme])} onClick={handleModalWindowOpen}> to create a board | ||
</span> | ||
to visualize and track all the necessary tasks and milestones. This | ||
board serves as a powerful tool to organize the workflow and ensure | ||
effective collaboration among team members. | ||
</p> | ||
</div> | ||
{showModalWindow && ( | ||
<BoardModalWindow | ||
titleModalButton="Create" | ||
modalTitle="New board" | ||
handleToggleModal={handleModalWindowClose} | ||
onSubmit={handleAddBoard} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,8 @@ export const TaskColumn = ({ columnId }) => { | |
}), | ||
); | ||
}; | ||
|
||
console.log(cards); | ||
return ( | ||
<> | ||
<ul | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters