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.
Merge pull request #36 from 001elijah/dashboard
Dashboard
- Loading branch information
Showing
13 changed files
with
433 additions
and
88 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
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import PropTypes from 'prop-types'; | ||
import { useState } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { selectorTheme } from 'redux/Auth/authSelectors'; | ||
import { Modal } from 'components/Modal/Modal'; | ||
import sprite from '../../assets/icons/sprite.svg'; | ||
import s from './ReusableColumnModalWindow.module.scss'; | ||
import { addNewBoard } from '../../redux/Boards/boardsOperations'; | ||
|
||
export const ReusableColumnModalWindow = ({ | ||
inputTitle, | ||
titleModalButton, | ||
modalTitle, | ||
onClick, | ||
icon = '', | ||
background = '', | ||
children, | ||
}) => { | ||
const dispatch = useDispatch(); | ||
const [value, setValue] = useState(''); | ||
const theme = useSelector(selectorTheme); | ||
|
||
const handleSubmit = e => { | ||
e.preventDefault(); | ||
const newCard = { | ||
title: value, | ||
icon, | ||
background, | ||
}; | ||
// console.log(newCard); | ||
dispatch(addNewBoard(newCard)); | ||
setValue(''); | ||
onClick(); | ||
}; | ||
|
||
return ( | ||
<Modal title={modalTitle} onClose={onClick}> | ||
<form onSubmit={handleSubmit}> | ||
<input | ||
className={`${s.inputModal} ${s[theme]}`} | ||
value={value} | ||
placeholder={inputTitle} | ||
onChange={e => setValue(e.target.value)} | ||
/> | ||
{children} | ||
<button className={`${s.buttonModal} ${s[theme]}`} type="submit"> | ||
<span className={`${s.iconButtonModalWrapper} ${s[theme]}`}> | ||
<svg | ||
className={`${s.iconButtonModal} ${s[theme]}`} | ||
width="14" | ||
height="14" | ||
> | ||
<use href={sprite + '#icon-plus'}></use> | ||
</svg> | ||
</span> | ||
{titleModalButton} | ||
</button> | ||
</form> | ||
</Modal> | ||
); | ||
}; | ||
|
||
ReusableColumnModalWindow.propTypes = { | ||
modalTitle: PropTypes.string.isRequired, | ||
inputTitle: PropTypes.string.isRequired, | ||
titleModalButton: PropTypes.string.isRequired, | ||
onClick: PropTypes.func.isRequired, | ||
icon: PropTypes.string.isRequired, | ||
background: PropTypes.string.isRequired, | ||
children: PropTypes.array.isRequired, | ||
}; |
164 changes: 164 additions & 0 deletions
164
src/components/ModalAddChangeCard/ModalAddChangeCard.module.scss
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 |
---|---|---|
@@ -0,0 +1,164 @@ | ||
@import '../../assets/styles/vars'; | ||
@import '../../assets/styles/mixins'; | ||
|
||
.inputModal { | ||
width: 287px; | ||
height: 49px; | ||
padding-left: 18px; | ||
|
||
border: 1px solid #bedbb0; | ||
border-radius: 8px; | ||
margin-bottom: 24px; | ||
|
||
font-family: 'Poppins-Regular'; | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 14px; | ||
line-height: calc(21 / 14); | ||
|
||
letter-spacing: -0.02em; | ||
|
||
&.colorful { | ||
border: 1px solid rgba(82, 85, 188, 1); | ||
color: #161616; | ||
background-color: inherit; | ||
opacity: 0.4; | ||
&::placeholder { | ||
color: rgba(22, 22, 22, 0.5); | ||
} | ||
|
||
&:focus { | ||
border: 1px solid #5255bc; | ||
outline: none; | ||
filter: drop-shadow(0px 4px 16px rgba(22, 22, 22, 0.08)); | ||
opacity: initial; | ||
} | ||
} | ||
|
||
&.dark { | ||
color: rgba(255, 255, 255, 1); | ||
background: #1f1f1f; | ||
border: 1px solid #bedbb0; | ||
box-shadow: 0px 4px 16px rgba(22, 22, 22, 0.08); | ||
opacity: 0.4; | ||
|
||
&::placeholder { | ||
color: rgba(255, 255, 255, 1); | ||
} | ||
|
||
&:focus { | ||
border: 1px solid #bedbb0; | ||
filter: drop-shadow(0px 4px 16px rgba(22, 22, 22, 0.08)); | ||
outline: none; | ||
opacity: initial; | ||
} | ||
} | ||
|
||
&.light { | ||
color: $black-text-color; | ||
opacity: 0.4; | ||
|
||
&::placeholder { | ||
color: rgba(22, 22, 22, 1); | ||
} | ||
|
||
&:focus { | ||
border: 1px solid #bedbb0; | ||
filter: drop-shadow(0px 4px 16px rgba(22, 22, 22, 0.08)); | ||
background-color: #fcfcfc; | ||
color: #161616; | ||
opacity: initial; | ||
outline: none; | ||
} | ||
} | ||
|
||
@include tablet { | ||
max-width: 302px; | ||
width: 100%; | ||
} | ||
|
||
@include desktop { | ||
max-width: 302px; | ||
width: 100%; | ||
} | ||
} | ||
|
||
.buttonModal { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
max-width: 287px; | ||
height: 49px; | ||
cursor: pointer; | ||
|
||
background: #bedbb0; | ||
border-radius: 8px; | ||
border: none; | ||
|
||
font-family: 'Poppins-Regular'; | ||
font-weight: 500; | ||
font-size: 14px; | ||
line-height: calc(21 / 14); | ||
|
||
letter-spacing: -0.02em; | ||
|
||
color: #161616; | ||
|
||
padding: 10px; | ||
|
||
&.colorful { | ||
background: rgba(82, 85, 188, 1); | ||
color: white; | ||
} | ||
|
||
&.dark { | ||
color: rgba(22, 22, 22, 1); | ||
} | ||
|
||
&.light { | ||
color: rgba(22, 22, 22, 1); | ||
} | ||
|
||
@include tablet { | ||
max-width: 302px; | ||
} | ||
|
||
@include desktop { | ||
max-width: 302px; | ||
} | ||
} | ||
|
||
.iconButtonModal { | ||
&.colorful { | ||
stroke: rgba(22, 22, 22, 1); | ||
} | ||
|
||
&.dark, | ||
&.light { | ||
stroke: rgba(255, 255, 255, 1); | ||
} | ||
} | ||
|
||
.iconButtonModalWrapper { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 28px; | ||
height: 28px; | ||
margin-right: 8px; | ||
background-color: rgba(22, 22, 22, 1); | ||
border-radius: 6px; | ||
|
||
&.colorful { | ||
background-color: rgba(255, 255, 255, 1); | ||
} | ||
|
||
&.dark { | ||
color: rgba(255, 255, 255, 1); | ||
} | ||
|
||
&.light { | ||
color: rgba(22, 22, 22, 1); | ||
} | ||
} |
Oops, something went wrong.