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
44 changes: 44 additions & 0 deletions 1-basics/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 1-basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "my-app",
"version": "0.1.0",
"dependencies": {
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Binary file added 1-basics/src/assets/Bulbazaur.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1-basics/src/assets/Charmander.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1-basics/src/assets/Pikachu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1-basics/src/assets/Squirtle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions 1-basics/src/components/App.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
main {
flex: 1;
display: flex;
background-color: brown;
}
h1 {
text-align: center;
}
.btn{
size-adjust:
}

body {
text-align: center;
}

10 changes: 5 additions & 5 deletions 1-basics/src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { List } from './List';
import { Button } from './Button';
import { Header } from './header';

import './App.css';

export const App = () => (
<>
<header>
<h1>Pokemon app</h1>
<Button>Click me</Button>
</header>

<Header/>


<main>
<List />
</main>
Expand Down
1 change: 1 addition & 0 deletions 1-basics/src/components/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
border-radius: 5px;
padding: 5px 15px;
}

10 changes: 7 additions & 3 deletions 1-basics/src/components/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import PropTypes from 'prop-types';
import './Button.css';

export const Button = (props) => {
console.log('props', props);
export const Button = ({text}) => {
//console.log('props', props);

return <button className='btn'>{props.children}</button>;
return <button className='btn'>{text}</button>;
};
Button.prototype={
text: PropTypes.string.isRequired
};
12 changes: 5 additions & 7 deletions 1-basics/src/components/List.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { Button } from './Button';
import {Listitem} from './Listitem';

const list = ['Pikachu', 'Bulbazaur', 'Charmander', 'Squirtle']

export const List = () => (
<div>
<ul>
{list.map((listItem) => (
<li key={listItem}>{listItem}</li>
<Listitem ListItem={listItem}key={listItem}/>
))}
</ul>
<ul>
<li>{list[0]}</li>
<li>{list[1]}</li>
<li>{list[2]}</li>
</ul>
<Button>Do it!</Button>

<Button text = 'Do it!'/>

</div>
);
12 changes: 12 additions & 0 deletions 1-basics/src/components/Listitem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//import Pikachu from '../assets/Pikachu.jpg';

export const Listitem= ({ListItem, fileSrc, id})=>{
return(
<>
<h1 className="item">{ListItem}</h1>
<img src={`../assets/${ListItem}.jpg`}/>


</>
)
}
Binary file added 1-basics/src/components/Pikachu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
12 changes: 12 additions & 0 deletions 1-basics/src/components/header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Button } from './Button';
import './header.css';

export const Header = () => {


return ( <header> <h1>Pokemon App</h1>
<Button text="Click Me"/>
</header>)

};