Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,841 changes: 12,841 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1"
"react-scripts": "3.1.1",
"styled-components": "^4.3.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -27,6 +27,7 @@
<title>React App</title>
</head>
<body>

<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
33 changes: 0 additions & 33 deletions src/App.css

This file was deleted.

22 changes: 6 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import TodoItem from './TodoItem'

function App() {
const add_todo = (item)=> {
console.log('itrm:',item);
}
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
{/* <header className="App-header"><h1>Todo App</h1></header> */}
<TodoItem add_todo={add_todo}/>
</div>
);
}
Expand Down
9 changes: 0 additions & 9 deletions src/App.test.js

This file was deleted.

71 changes: 71 additions & 0 deletions src/TodoItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React, { useState } from "react";
import styled from "styled-components";
import PropTypes from 'prop-types';

const Form = ({ add_todo }) => {

const [todo_text, set_todo_text] = useState('');

const on_click = (event) => {
event.preventDefault();
add_todo({
text: todo_text,
status: 'open'
})
}

// console.log('Text:',text)
return (
<Warpper>
<h1>My todo Up</h1>
<TodoItem>
<input onChange={(event) => set_todo_text(event.target.value)} type="text" placeholder="what needs to be done"></input>
<button onClick={on_click}>ADD</button>
</TodoItem>
</Warpper>
);
};
export default Form;


Form.propTypes = {
add_todo: PropTypes.func.isRequired,
};

const Warpper = styled.form`

display: flex;
flex-direction: column;
align-items: center;
height: auto;
/* width: 50%; */
margin: 10px 200px;
padding: 2px;
border: 2px gray solid;
`;

const TodoItem = styled.form`

display: flex;
justify-content: center;
margin: 10px;
color: papayawhip;
font-size: 10rem;
width: 50%;
background: slategray;

`;





// const Text = styled.h1`
// font-size: 3rem;
// font-weight: normal;
// font-family: "Griffy", cursive;
// color: papayawhip;
// cursor: pointer;
// user-select: none;
// position: relative;
// `;
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
// import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
// serviceWorker.unregister();
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.