-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Long overdue initial commit, created Layout(Header and Footer), TaskL…
…ist, TaskCard, and ButtonForm components, along with redux folders, and stylings for all components etc.
- Loading branch information
1 parent
7353d47
commit e4a2098
Showing
28 changed files
with
15,569 additions
and
10,951 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.vscode | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import '../styles/App.scss'; | ||
// Components | ||
import Layout from '../components/Layout/index'; | ||
import TaskList from '../components/TaskList'; | ||
import ButtonForm from '../components/ButtonForm/index' | ||
// Redux | ||
import { connect } from 'react-redux' | ||
|
||
const App = (props) => { | ||
|
||
const { list } = props; | ||
|
||
return ( | ||
<div className='App'> | ||
<Layout> | ||
{ | ||
list.map(list => ( | ||
<TaskList | ||
title={list.title} | ||
cards={list.cards} | ||
key={list.id} | ||
/> | ||
)) | ||
} | ||
<ButtonForm list/> | ||
</Layout> | ||
</div> | ||
); | ||
} | ||
|
||
const mapStateToProps = state => ({ | ||
list: state.list, | ||
}) | ||
|
||
export default connect(mapStateToProps) (App); |
File renamed without changes.
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,98 @@ | ||
import React, {useState, useEffect } from 'react'; | ||
import AddIcon from '@material-ui/icons/Add'; | ||
import CloseIcon from '@material-ui/icons/Close'; | ||
import './style.scss'; | ||
|
||
const ButtonForm = (props) => { | ||
// State | ||
const [openForm, setOpenForm] = useState(false) | ||
const [text, setText] = useState('') | ||
|
||
// Props | ||
const { list } = props; | ||
|
||
// Open | ||
const open = () => { | ||
setOpenForm(!openForm) | ||
} | ||
|
||
// Close | ||
const close = () => { | ||
setOpenForm(false) | ||
} | ||
|
||
// Handle Textfield Change | ||
const handleInputChange = (e) => { | ||
setText(e.target.value) | ||
} | ||
|
||
// Handle Textfield Submit | ||
const handleSubmit = (e) => { | ||
e.preventDefault() | ||
} | ||
|
||
// Conditional Button | ||
const renderButton = () => { | ||
const buttonText = list ? 'Add another list' : 'Add another card'; | ||
|
||
return ( | ||
<button | ||
className={list ? 'add-list-button' : 'add-card-button'} | ||
onClick={() => open()} | ||
> | ||
<span className="add-button-text"> | ||
<AddIcon /> {buttonText} | ||
</span> | ||
</button> | ||
) | ||
} | ||
|
||
// Conditional Form | ||
const renderForm = () => { | ||
|
||
const placeholder = list | ||
? 'Enter a title for this list...' | ||
: 'Enter a title for this card...'; | ||
|
||
const title = list | ||
? 'Add List' | ||
: 'Add Card'; | ||
|
||
return ( | ||
<> | ||
<form | ||
className={list ? 'add-list-form' : 'add-card-form'} | ||
> | ||
<textarea | ||
className={list ? 'task-list add-list-input' :'add-card-input'} | ||
placeholder={placeholder} | ||
value={text} | ||
onBlur={() => close()} | ||
onChange={handleInputChange} | ||
autoFocus | ||
/> | ||
<div className="form-button-container"> | ||
<button | ||
className={list ? 'add-list-input-button' : 'add-card-input-button'} | ||
title={title} | ||
onSubmit={() => handleSubmit()} | ||
> | ||
{title} | ||
</button> | ||
<button | ||
className="close-form-button" | ||
onClick={() => close()} | ||
> | ||
<CloseIcon fontSize={"large"}/> | ||
</button> | ||
</div> | ||
|
||
</form> | ||
</> | ||
); | ||
} | ||
|
||
return openForm ? renderForm() : renderButton() | ||
} | ||
|
||
export default ButtonForm; |
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,103 @@ | ||
// Button Styles | ||
button { | ||
padding: none; | ||
font-size: 1.5rem; | ||
padding: 1rem; | ||
transition: all 0.2s; | ||
border: none; | ||
background-color: transparent; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
.add-card-button, | ||
.add-list-button { | ||
width: 100%; | ||
border-radius: 0.5rem; | ||
transition: all 0.05s ease-in; | ||
text-align: left; | ||
transition: all 0.2s; | ||
} | ||
|
||
.add-card-button { | ||
span { | ||
opacity: 0.7; | ||
|
||
&:focus, | ||
&:hover { | ||
opacity: 1; | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
&:focus, | ||
&:hover { | ||
background-color: #d9dce2; | ||
} | ||
} | ||
|
||
.add-list-button { | ||
margin-top: 1rem; | ||
background-color: #ebecf080; | ||
width: 300px; | ||
height: 100%; | ||
|
||
&:focus, | ||
&:hover { | ||
background-color: #ebecf095; | ||
} | ||
|
||
span { | ||
color: #fff; | ||
} | ||
} | ||
|
||
// Form Styles | ||
|
||
.add-card-input-button, | ||
.add-list-input-button { | ||
background-color: #5aac44; | ||
color: #fff; | ||
border: 0.05rem solid #bbbbbb; | ||
border-radius: 0.5rem; | ||
|
||
&:focus, | ||
&:hover { | ||
background-color: lighten(#5aac44, 10%); | ||
} | ||
} | ||
|
||
.form-button-container { | ||
display: flex; | ||
} | ||
|
||
.close-form-button { | ||
color: lighten(#000, 30%); | ||
|
||
&:focus, | ||
&:hover { | ||
color: #000; | ||
} | ||
} | ||
|
||
.add-list-form { | ||
margin-top: 1rem; | ||
height: 100%; | ||
background-color: #ffffffdc; | ||
padding: 1rem; | ||
} | ||
|
||
.add-list-form, | ||
.add-list-input { | ||
border-radius: 0.5rem; | ||
} | ||
|
||
.add-list-input { | ||
width: 100%; | ||
min-width: 300px; | ||
margin-bottom: 1rem; | ||
padding: 1rem; | ||
border: 0.2rem solid #0079bf; | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
import './style.scss'; | ||
|
||
const Footer = () => { | ||
return ( | ||
<footer className="footer"> | ||
<p className="copyright"> | ||
Created by <a href="alan-martin.dev" title='Click here to visit alan-martin.dev'>Alan Martin ©</a> | ||
</p> | ||
</footer> | ||
) | ||
} | ||
|
||
export default Footer; |
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,14 @@ | ||
.footer { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
left: 0; | ||
height: 3rem; | ||
|
||
a { | ||
color: black; | ||
} | ||
} |
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,12 @@ | ||
import React from 'react'; | ||
import './style.scss'; | ||
|
||
const Header = () => { | ||
return ( | ||
<header className="header"> | ||
<h1 className='site-title'>Trello Clone</h1> | ||
</header> | ||
) | ||
} | ||
|
||
export default Header; |
Oops, something went wrong.