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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Empty file added LAB.md
Empty file.
13,046 changes: 13,046 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "28-starter-code-practice",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "src/index.js",
"dependencies": {
"react": "16.8.6",
"react-dom": "16.8.6",
"react-scripts": "3.0.1"
},
"devDependencies": {},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
42 changes: 42 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>

<body>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
27 changes: 27 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';

import './styles.css';

import Message from './components/message.js';

class App extends React.Component {
constructor(props) {
super(props)

}
render() {
return (
<Message
text = "This is my amazing app"
title = "This is my title"
action = {this.sayIt}
input = {this.state.input}
/>
);
}
sayIt(str) {
setState(input)
}
}

export default App;
11 changes: 11 additions & 0 deletions src/components/form.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

class Form extends React.Component {

render() {
return null;
}

}

export default Form;
28 changes: 28 additions & 0 deletions src/components/message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import Title from './title';
import Form from './form';

class Message extends React.Component {
constructor(props) {
super(props)
this.state = {
words: "These words belong to message component",
text: { Title },
do: { action }
}
}

render() {

return (
<>
<Title text = { this.props.title}>
</Title>
<h2>{ this.props.text }</h2>
<h3>{ this.state.words }</h3>
</>
);
}
}

export default Message;
14 changes: 14 additions & 0 deletions src/components/title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

class Title extends React.Component {
render() {
console.log(this.props);
return (
<>
<h1>{ this.props.text }</h1>
</>
)
}
}

export default Title;
11 changes: 11 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';

import App from './app.js';

const Main = () => {
return <App />;
};

const rootElement = document.getElementById('root');
ReactDOM.render(<Main />, rootElement);
4 changes: 4 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.App {
font-family: sans-serif;
text-align: center;
}