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 #18 from 001elijah/create-edit-forms
Create edit forms
- Loading branch information
Showing
53 changed files
with
4,627 additions
and
286 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,48 @@ | ||
import PropTypes from 'prop-types'; | ||
import { useState } from 'react'; | ||
import { ReusableColumnModalWindow } from 'components/ReusableColumnModalWindow/ReusableColumnModalWindow'; | ||
import { BoxRadioIconGroup } from 'components/BoxRadioIconGroup/BoxRadioIconGroup'; | ||
import { BoxRadioBackgroundGroup } from 'components/BoxRadioBackgroundGroup/BoxRadioBackgroundGroup'; | ||
|
||
export const BoardModalWindow = ({ | ||
inputTitle, | ||
modalTitle, | ||
titleModalButton, | ||
onClick, | ||
handleToggleModal, | ||
}) => { | ||
const [Background, setBackground] = useState('dark'); | ||
const [icon, setIcon] = useState(''); | ||
|
||
const handleAddBoard = value => { | ||
const newCard = { | ||
value, | ||
icon, | ||
Background, | ||
}; | ||
console.log(newCard); | ||
console.log(onClick); | ||
// onclick(dispatch(addNewCard()); | ||
}; | ||
|
||
return ( | ||
<ReusableColumnModalWindow | ||
inputTitle={inputTitle} | ||
modalTitle={modalTitle} | ||
titleModalButton={titleModalButton} | ||
onClick={handleAddBoard} | ||
handleToggleModal={handleToggleModal} | ||
> | ||
<BoxRadioIconGroup valueChange={setIcon} /> | ||
<BoxRadioBackgroundGroup valueChange={setBackground} /> | ||
</ReusableColumnModalWindow> | ||
); | ||
}; | ||
|
||
BoardModalWindow.propTypes = { | ||
modalTitle: PropTypes.string.isRequired, | ||
inputTitle: PropTypes.string.isRequired, | ||
titleModalButton: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
handleToggleModal: PropTypes.func, | ||
}; |
232 changes: 232 additions & 0 deletions
232
src/components/BoxRadioBackgroundGroup/BoxRadioBackgroundGroup.jsx
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,232 @@ | ||
import { useState, useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import s from './BoxRadioBackgroundGroup.module.scss'; | ||
|
||
export const BoxRadioBackgroundGroup = ({ valueChange }) => { | ||
const [background, setBackground] = useState('one'); | ||
// const handleChange = e => { | ||
// setColor(e.target.value); | ||
// valueColor(color); | ||
// console.log(color); | ||
// }; | ||
|
||
const handleCheked = e => { | ||
setBackground(e.target.value); | ||
}; | ||
|
||
useEffect(() => { | ||
valueChange(background); | ||
}, [valueChange, background]); | ||
|
||
return ( | ||
<div className={s.backgroundGroupWrapper}> | ||
<h1 className={s.label}>Background</h1> | ||
<div className={s.radioWrapper}> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput1} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="one" | ||
name="background" | ||
id="one" | ||
checked={background === 'one'} | ||
/> | ||
<label htmlFor="one" className={s.radioLabel1}></label> | ||
</div> | ||
|
||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput2} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="two" | ||
name="background" | ||
id="two" | ||
checked={background === 'two'} | ||
/> | ||
<label htmlFor="two" className={s.radioLabel2}></label> | ||
</div> | ||
|
||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput3} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="three" | ||
name="background" | ||
id="three" | ||
checked={background === 'three'} | ||
/> | ||
<label htmlFor="three" className={s.radioLabel3}></label> | ||
</div> | ||
|
||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput4} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="four" | ||
name="background" | ||
id="four" | ||
checked={background === 'four'} | ||
/> | ||
<label htmlFor="four" className={s.radioLabel4}></label> | ||
</div> | ||
{/* 4 */} | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput5} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="five" | ||
name="background" | ||
id="five" | ||
checked={background === 'five'} | ||
/> | ||
<label htmlFor="five" className={s.radioLabel5}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput6} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="six" | ||
name="background" | ||
id="six" | ||
checked={background === 'six'} | ||
/> | ||
<label htmlFor="six" className={s.radioLabel6}></label> | ||
</div> | ||
|
||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput7} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="seven" | ||
name="background" | ||
id="seven" | ||
checked={background === 'seven'} | ||
/> | ||
<label htmlFor="seven" className={s.radioLabel7}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput8} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="eight" | ||
name="background" | ||
id="eight" | ||
checked={background === 'eight'} | ||
/> | ||
<label htmlFor="eight" className={s.radioLabel8}></label> | ||
</div> | ||
{/* 8 */} | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput9} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="nine" | ||
name="background" | ||
id="nine" | ||
checked={background === 'nine'} | ||
/> | ||
<label htmlFor="nine" className={s.radioLabel9}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput10} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="ten" | ||
name="background" | ||
id="ten" | ||
checked={background === 'ten'} | ||
/> | ||
<label htmlFor="ten" className={s.radioLabel10}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput11} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="eleven" | ||
name="background" | ||
id="eleven" | ||
checked={background === 'eleven'} | ||
/> | ||
<label htmlFor="eleven" className={s.radioLabel11}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput12} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="twelve" | ||
name="background" | ||
id="twelve" | ||
checked={background === 'twelve'} | ||
/> | ||
<label htmlFor="twelve" className={s.radioLabel12}></label> | ||
</div> | ||
{/* 12 */} | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput13} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="thirteen" | ||
name="background" | ||
id="thirteen" | ||
checked={background === 'thirteen'} | ||
/> | ||
<label htmlFor="thirteen" className={s.radioLabel13}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput14} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="fourteen" | ||
name="background" | ||
id="fourteen" | ||
checked={background === 'fourteen'} | ||
/> | ||
<label htmlFor="fourteen" className={s.radioLabel14}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput15} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="fifteen" | ||
name="background" | ||
id="fifteen" | ||
checked={background === 'fifteen'} | ||
/> | ||
<label htmlFor="fifteen" className={s.radioLabel15}></label> | ||
</div> | ||
<div className={s.radioContainer}> | ||
<input | ||
className={s.radioInput16} | ||
type="radio" | ||
onChange={handleCheked} | ||
value="sixteen" | ||
name="background" | ||
id="sixteen" | ||
checked={background === 'sixteen'} | ||
/> | ||
<label htmlFor="sixteen" className={s.radioLabel16}></label> | ||
</div> | ||
{/* 16 */} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
BoxRadioBackgroundGroup.propTypes = { | ||
valueChange: PropTypes.func.isRequired, | ||
}; |
Oops, something went wrong.