├── .github └── FUNDING.yml ├── 1-birthday-reminder ├── .gitignore ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.js │ ├── data │ └── Data.js │ ├── index.css │ ├── index.js │ ├── list │ └── List.js │ ├── reportWebVitals.js │ └── setupTests.js ├── 2-tours ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.js │ ├── components │ ├── loading │ │ └── Loading.js │ ├── tourComponent │ │ └── TourComponent.js │ └── tours │ │ └── Tours.js │ ├── index.css │ ├── index.js │ ├── reportWebVitals.js │ └── setupTests.js ├── 3-reviews ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.js │ ├── data │ └── Data.js │ ├── index.css │ ├── index.js │ ├── reportWebVitals.js │ ├── review │ └── Review.js │ └── setupTests.js ├── 4-accordion ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.js │ ├── data │ └── Data.js │ ├── index.css │ ├── index.js │ ├── reportWebVitals.js │ ├── setupTests.js │ └── singleQuestion │ └── SingleQuestion.js ├── 5-menu ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.js │ ├── categories │ └── Categories.js │ ├── data │ └── Data.js │ ├── index.css │ ├── index.js │ ├── menu │ └── Menu.js │ ├── reportWebVitals.js │ └── setupTests.js ├── 6-tabs ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js ├── 7-news ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── readme.md └── src │ ├── App.js │ ├── AppQuery.js │ ├── Modal.js │ ├── data.js │ ├── index.css │ ├── index.js │ ├── reportWebVitals.js │ └── setupTests.js ├── LICENSE └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | 14 | /* Comming soon */ 15 | -------------------------------------------------------------------------------- /1-birthday-reminder/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /1-birthday-reminder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-projects", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.10", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-scripts": "4.0.3", 12 | "web-vitals": "^1.1.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /1-birthday-reminder/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/1-birthday-reminder/public/favicon.ico -------------------------------------------------------------------------------- /1-birthday-reminder/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /1-birthday-reminder/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/1-birthday-reminder/public/logo192.png -------------------------------------------------------------------------------- /1-birthday-reminder/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/1-birthday-reminder/public/logo512.png -------------------------------------------------------------------------------- /1-birthday-reminder/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /1-birthday-reminder/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import List from "./list/List"; 3 | import Data from "./data/Data"; 4 | 5 | export default function App() { 6 | const [birthdayPeople, setBirthdayPeople] = useState(Data); 7 | const [cleared, setCleared] = useState(false); 8 | const renderOnClick = () => { 9 | if (cleared != true) { 10 | setBirthdayPeople([]); 11 | setCleared(true); 12 | } else { 13 | setBirthdayPeople(Data); 14 | setCleared(false); 15 | } 16 | }; 17 | return ( 18 | <> 19 |
20 |
21 |

{birthdayPeople.length} birthdays today

22 | {birthdayPeople.length < 1 && ( 23 |

I don't have users to show you

24 | )} 25 | 26 | 29 |
30 |
31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/data/Data.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | id: "0", 4 | username: "Bill Gates", 5 | image: 6 | "https://www.cnet.com/a/img/L9-S0VZL7Q6SI_slQ7pFeZMUm34=/940x0/2018/03/15/22b11eba-6122-4537-8dd1-a623d8fc1d90/iosgz49p-400x400.jpg", 7 | age: "65", 8 | }, 9 | { 10 | id: "1", 11 | username: "Mark Zuckerberg", 12 | image: 13 | "https://thumbor.forbes.com/thumbor/400x400/http://specials-images.forbes.com/imageserve/09kZdVWgJO0tu/960x960.jpg?fit=scale&background=000000", 14 | age: "36", 15 | }, 16 | { 17 | id: "2", 18 | username: "Elon Musk", 19 | image: 20 | "https://images.indulgexpress.com/uploads/user/imagelibrary/2020/10/7/original/ElonMusk.jpg", 21 | age: "49", 22 | }, 23 | { 24 | id: "3", 25 | username: "Jeff Bezos", 26 | image: 27 | "https://global-uploads.webflow.com/5dfd5aca7badfa129f80056c/5f89c9db933d223a087f5aa3_JeffBezosRecommendedBooks.jpeg", 28 | age: "57", 29 | }, 30 | ]; 31 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, 9 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; 10 | background: #3b5998; 11 | color: white; 12 | line-height: 1.5; 13 | font-size: 0.875rem; 14 | } 15 | 16 | ul { 17 | list-style-type: none; 18 | } 19 | 20 | a { 21 | text-decoration: none; 22 | } 23 | 24 | main { 25 | display: flex; 26 | align-items: center; 27 | justify-content: center; 28 | height: 100vh; 29 | } 30 | 31 | .container { 32 | background-color: #fff; 33 | color: black; 34 | width: 90vw; 35 | margin: 5rem 0; 36 | max-width: 450px; 37 | padding: 1.5rem 2rem; 38 | border-radius: 5px; 39 | box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); 40 | } 41 | 42 | .container h3 { 43 | font-weight: normal; 44 | text-transform: none; 45 | margin-bottom: 2rem; 46 | } 47 | 48 | button { 49 | width: 100%; 50 | max-width: 100%; 51 | cursor: pointer; 52 | background-color: #3b5998; 53 | border: none; 54 | outline: none; 55 | padding: 1rem 2rem; 56 | color: white; 57 | margin-top: 20px; 58 | transition: all 0.2s ease; 59 | border-radius: 5px; 60 | } 61 | 62 | button:hover { 63 | opacity: 0.9; 64 | } 65 | 66 | .person { 67 | display: grid; 68 | grid-template-columns: auto 1fr; 69 | column-gap: 0.75rem; 70 | margin-bottom: 1.5rem; 71 | align-items: center; 72 | } 73 | .person img { 74 | width: 75px; 75 | height: 75px; 76 | object-fit: cover; 77 | border-radius: 50%; 78 | box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 79 | } 80 | .person h4 { 81 | margin-bottom: 0.35rem; 82 | letter-spacing: 0.03rem; 83 | } 84 | .person p { 85 | margin-bottom: 0; 86 | } 87 | 88 | p { 89 | margin-bottom: 1.25rem; 90 | color: hsl(210, 22%, 49%); 91 | } 92 | 93 | .message { 94 | text-transform: capitalize; 95 | font-size: 0.9rem; 96 | user-select: none; 97 | text-align: center; 98 | } 99 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import "./index.css"; 4 | import App from "./App"; 5 | import reportWebVitals from "./reportWebVitals"; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById("root") 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/list/List.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function List({ birthdayData }) { 4 | return ( 5 | <> 6 | {birthdayData.map((item) => { 7 | const { id, username, age, image } = item; 8 | return ( 9 |
10 | {username} 11 |
12 |

{username}

13 |

{age} years

14 |
15 |
16 | ); 17 | })} 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /1-birthday-reminder/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /2-tours/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /2-tours/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /2-tours/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "2-tours", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.10", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-scripts": "4.0.3", 12 | "web-vitals": "^1.1.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /2-tours/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/2-tours/public/favicon.ico -------------------------------------------------------------------------------- /2-tours/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /2-tours/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/2-tours/public/logo192.png -------------------------------------------------------------------------------- /2-tours/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/2-tours/public/logo512.png -------------------------------------------------------------------------------- /2-tours/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /2-tours/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /2-tours/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import Loading from "./components/loading/Loading"; 3 | import Tours from "./components/tours/Tours"; 4 | 5 | const URL = "https://course-api.com/react-tours-project"; 6 | 7 | export default function App() { 8 | const [loadingComponent, setLoadingComponent] = useState(true); 9 | const [tours, setTours] = useState([]); 10 | 11 | const removeTour = (id) => { 12 | const newTours = tours.filter((tour) => tour.id !== id); 13 | setTours(newTours); 14 | }; 15 | 16 | const fetchTours = async () => { 17 | setLoadingComponent(true); 18 | try { 19 | const response = await fetch(URL); 20 | const tours = await response.json(); 21 | setLoadingComponent(false); 22 | setTours(tours); 23 | } catch (err) { 24 | setLoadingComponent(false); 25 | console.log(err); 26 | } 27 | }; 28 | 29 | useEffect(() => { 30 | fetchTours(); 31 | }, []); 32 | 33 | if (loadingComponent) { 34 | return ( 35 |
36 | 37 |
38 | ); 39 | } 40 | 41 | if (tours.length < 1) { 42 | return ( 43 | <> 44 |
45 |
46 |

no tours left

47 | 50 |
51 |
52 | 53 | ); 54 | } 55 | 56 | return ( 57 | <> 58 |
59 | 60 |
61 | 62 | ); 63 | } 64 | -------------------------------------------------------------------------------- /2-tours/src/components/loading/Loading.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Loading() { 4 | return ( 5 | <> 6 |
7 |

Loading...

8 |
9 | 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /2-tours/src/components/tourComponent/TourComponent.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | 3 | export default function Tour({ id, image, info, price, name, removeTour }) { 4 | const [readMore, setReadMore] = useState(false); 5 | return ( 6 | <> 7 |
8 | {name} 9 | 22 |
23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /2-tours/src/components/tours/Tours.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Tour from "../tourComponent/TourComponent"; 3 | 4 | export default function Tours({ tours, removeTour }) { 5 | return ( 6 | <> 7 |
8 |
9 |

ours tours

10 |
11 |
12 |
13 | {tours.map((item) => { 14 | return ( 15 | <> 16 | 17 | 18 | ); 19 | })} 20 |
21 |
22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /2-tours/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --clr-primary-1: hsl(205, 86%, 17%); 3 | --clr-primary-2: hsl(205, 77%, 27%); 4 | --clr-primary-3: hsl(205, 72%, 37%); 5 | --clr-primary-4: hsl(205, 63%, 48%); 6 | --clr-primary-5: hsl(205, 78%, 60%); 7 | --clr-primary-6: hsl(205, 89%, 70%); 8 | --clr-primary-7: hsl(205, 90%, 76%); 9 | --clr-primary-8: hsl(205, 86%, 81%); 10 | --clr-primary-9: hsl(205, 90%, 88%); 11 | --clr-primary-10: hsl(205, 100%, 96%); 12 | --clr-grey-1: hsl(209, 61%, 16%); 13 | --clr-grey-2: hsl(211, 39%, 23%); 14 | --clr-grey-3: hsl(209, 34%, 30%); 15 | --clr-grey-4: hsl(209, 28%, 39%); 16 | --clr-grey-5: hsl(210, 22%, 49%); 17 | --clr-grey-6: hsl(209, 23%, 60%); 18 | --clr-grey-7: hsl(211, 27%, 70%); 19 | --clr-grey-8: hsl(210, 31%, 80%); 20 | --clr-grey-9: hsl(212, 33%, 89%); 21 | --clr-grey-10: hsl(210, 36%, 96%); 22 | --clr-white: #fff; 23 | --clr-red-dark: hsl(360, 67%, 44%); 24 | --clr-red-light: hsl(360, 71%, 66%); 25 | --clr-green-dark: hsl(125, 67%, 44%); 26 | --clr-green-light: hsl(125, 71%, 66%); 27 | --clr-black: #222; 28 | --transition: all 0.3s linear; 29 | --spacing: 0.1rem; 30 | --radius: 0.25rem; 31 | --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 32 | --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); 33 | --max-width: 1170px; 34 | --fixed-width: 620px; 35 | } 36 | *, 37 | ::after, 38 | ::before { 39 | margin: 0; 40 | padding: 0; 41 | box-sizing: border-box; 42 | } 43 | body { 44 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, 45 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; 46 | background: var(--clr-grey-10); 47 | color: var(--clr-grey-1); 48 | line-height: 1.5; 49 | font-size: 0.875rem; 50 | } 51 | ul { 52 | list-style-type: none; 53 | } 54 | a { 55 | text-decoration: none; 56 | } 57 | h1, 58 | h2, 59 | h3, 60 | h4 { 61 | letter-spacing: var(--spacing); 62 | text-transform: capitalize; 63 | line-height: 1.25; 64 | margin-bottom: 0.75rem; 65 | } 66 | h1 { 67 | font-size: 3rem; 68 | } 69 | h2 { 70 | font-size: 2rem; 71 | } 72 | h3 { 73 | font-size: 1.25rem; 74 | } 75 | h4 { 76 | font-size: 0.875rem; 77 | } 78 | p { 79 | margin-bottom: 1.25rem; 80 | color: var(--clr-grey-5); 81 | } 82 | @media screen and (min-width: 800px) { 83 | h1 { 84 | font-size: 4rem; 85 | } 86 | h2 { 87 | font-size: 2.5rem; 88 | } 89 | h3 { 90 | font-size: 1.75rem; 91 | } 92 | h4 { 93 | font-size: 1rem; 94 | } 95 | body { 96 | font-size: 1rem; 97 | } 98 | h1, 99 | h2, 100 | h3, 101 | h4 { 102 | line-height: 1; 103 | } 104 | } 105 | .section { 106 | width: 90vw; 107 | margin: 0 auto; 108 | max-width: var(--max-width); 109 | } 110 | 111 | @media screen and (min-width: 992px) { 112 | .section { 113 | width: 95vw; 114 | } 115 | } 116 | .btn { 117 | background: var(--clr-primary-5); 118 | display: inline-block; 119 | padding: 0.25rem 0.5rem; 120 | border-radius: var(--radius); 121 | text-transform: capitalize; 122 | color: var(--clr-white); 123 | letter-spacing: var(--spacing); 124 | border-color: transparent; 125 | cursor: pointer; 126 | margin-top: 2rem; 127 | font-size: 1.2rem; 128 | } 129 | main { 130 | width: 90vw; 131 | max-width: var(--fixed-width); 132 | margin: 5rem auto; 133 | } 134 | .loading { 135 | text-align: center; 136 | } 137 | .title { 138 | text-align: center; 139 | margin-bottom: 4rem; 140 | } 141 | .underline { 142 | width: 6rem; 143 | height: 0.25rem; 144 | background: var(--clr-primary-5); 145 | margin-left: auto; 146 | margin-right: auto; 147 | } 148 | 149 | .single-tour { 150 | background: var(--clr-white); 151 | border-radius: var(--radius); 152 | margin: 2rem 0; 153 | box-shadow: var(--light-shadow); 154 | transition: var(--transition); 155 | } 156 | .single-tour:hover { 157 | box-shadow: var(--dark-shadow); 158 | } 159 | .single-tour img { 160 | width: 100%; 161 | height: 20rem; 162 | object-fit: cover; 163 | border-top-right-radius: var(--radius); 164 | border-top-left-radius: var(--radius); 165 | } 166 | .tour-info { 167 | display: flex; 168 | justify-content: space-between; 169 | align-items: center; 170 | margin-bottom: 1.5rem; 171 | } 172 | .tour-info h4 { 173 | margin-bottom: 0; 174 | } 175 | .single-tour button { 176 | background: transparent; 177 | border-color: transparent; 178 | text-transform: capitalize; 179 | color: var(--clr-primary-5); 180 | font-size: 1rem; 181 | cursor: pointer; 182 | padding-left: 0.25rem; 183 | } 184 | .tour-price { 185 | color: var(--clr-primary-5); 186 | background: var(--clr-primary-10); 187 | padding: 0.25rem 0.5rem; 188 | border-radius: var(--radius); 189 | } 190 | .single-tour footer { 191 | padding: 1.5rem 2rem; 192 | } 193 | .single-tour .delete-btn { 194 | display: block; 195 | width: 200px; 196 | margin: 1rem auto 0 auto; 197 | color: var(--clr-red-dark); 198 | letter-spacing: var(--spacing); 199 | background: transparent; 200 | border: 1px solid var(--clr-red-dark); 201 | padding: 0.25rem 0.5rem; 202 | border-radius: var(--radius); 203 | } 204 | -------------------------------------------------------------------------------- /2-tours/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /2-tours/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /2-tours/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /3-reviews/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /3-reviews/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /3-reviews/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "3-reviews", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.10", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-icons": "^4.2.0", 12 | "react-scripts": "4.0.3", 13 | "web-vitals": "^1.1.1" 14 | }, 15 | "scripts": { 16 | "start": "react-scripts start", 17 | "build": "react-scripts build", 18 | "test": "react-scripts test", 19 | "eject": "react-scripts eject" 20 | }, 21 | "eslintConfig": { 22 | "extends": [ 23 | "react-app", 24 | "react-app/jest" 25 | ] 26 | }, 27 | "browserslist": { 28 | "production": [ 29 | ">0.2%", 30 | "not dead", 31 | "not op_mini all" 32 | ], 33 | "development": [ 34 | "last 1 chrome version", 35 | "last 1 firefox version", 36 | "last 1 safari version" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /3-reviews/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/3-reviews/public/favicon.ico -------------------------------------------------------------------------------- /3-reviews/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /3-reviews/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/3-reviews/public/logo192.png -------------------------------------------------------------------------------- /3-reviews/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/3-reviews/public/logo512.png -------------------------------------------------------------------------------- /3-reviews/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /3-reviews/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /3-reviews/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Review from "./review/Review"; 3 | 4 | export default function App() { 5 | return ( 6 | <> 7 |
8 |
9 |
10 |

our reviews

11 |
12 |
13 | 14 |
15 |
16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /3-reviews/src/data/Data.js: -------------------------------------------------------------------------------- 1 | const reviews = [ 2 | { 3 | id: 1, 4 | name: "Mark Zuckerberg", 5 | job: "CEO", 6 | image: 7 | "https://thumbor.forbes.com/thumbor/400x400/http://specials-images.forbes.com/imageserve/09kZdVWgJO0tu/960x960.jpg?fit=scale&background=000000", 8 | text: 9 | "I'm just writing to thank you for this product. I had failed in so many interviews before, but I wanted to get into a top tech company so much that I even enrolled in a Master's program. Even then, I was unsure if I had what it takes to make it. From the moment I heard your first video explanation.", 10 | }, 11 | { 12 | id: 2, 13 | name: "Bill Gates", 14 | job: "CO-CEO", 15 | image: 16 | "https://www.cnet.com/a/img/L9-S0VZL7Q6SI_slQ7pFeZMUm34=/940x0/2018/03/15/22b11eba-6122-4537-8dd1-a623d8fc1d90/iosgz49p-400x400.jpg", 17 | text: 18 | "AlgoExpert was the backbone of my technical coding interview preparation. It allows you to efficiently work through the most common variations of problems asked by top-tier companies without having to spend hours 'battling' an algorithm only to come up with an inefficient or incorrect solution.", 19 | }, 20 | { 21 | id: 3, 22 | name: "Jeff Bezos", 23 | job: "CEO", 24 | image: 25 | "https://global-uploads.webflow.com/5dfd5aca7badfa129f80056c/5f89c9db933d223a087f5aa3_JeffBezosRecommendedBooks.jpeg", 26 | text: 27 | "As a scientist who was looking to break into Tech, I knew the underlying logic of programming, but I had a lot of gaps in my understanding, especially on the types of algorithms questions asked at interviews. I can confidently say that AlgoExpert is one of the best resources out there for interview preparation", 28 | }, 29 | ]; 30 | 31 | export default reviews; 32 | -------------------------------------------------------------------------------- /3-reviews/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --clr-primary-1: hsl(205, 86%, 17%); 3 | --clr-primary-2: hsl(205, 77%, 27%); 4 | --clr-primary-3: hsl(205, 72%, 37%); 5 | --clr-primary-4: hsl(205, 63%, 48%); 6 | --clr-primary-5: hsl(205, 78%, 60%); 7 | --clr-primary-6: hsl(205, 89%, 70%); 8 | --clr-primary-7: hsl(205, 90%, 76%); 9 | --clr-primary-8: hsl(205, 86%, 81%); 10 | --clr-primary-9: hsl(205, 90%, 88%); 11 | --clr-primary-10: hsl(205, 100%, 96%); 12 | --clr-grey-1: hsl(209, 61%, 16%); 13 | --clr-grey-2: hsl(211, 39%, 23%); 14 | --clr-grey-3: hsl(209, 34%, 30%); 15 | --clr-grey-4: hsl(209, 28%, 39%); 16 | --clr-grey-5: hsl(210, 22%, 49%); 17 | --clr-grey-6: hsl(209, 23%, 60%); 18 | --clr-grey-7: hsl(211, 27%, 70%); 19 | --clr-grey-8: hsl(210, 31%, 80%); 20 | --clr-grey-9: hsl(212, 33%, 89%); 21 | --clr-grey-10: hsl(210, 36%, 96%); 22 | --clr-white: #fff; 23 | --clr-red-dark: hsl(360, 67%, 44%); 24 | --clr-red-light: hsl(360, 71%, 66%); 25 | --clr-green-dark: hsl(125, 67%, 44%); 26 | --clr-green-light: hsl(125, 71%, 66%); 27 | --clr-black: #222; 28 | --transition: all 0.3s linear; 29 | --spacing: 0.1rem; 30 | --radius: 0.25rem; 31 | --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 32 | --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); 33 | --max-width: 1170px; 34 | --fixed-width: 620px; 35 | } 36 | *, 37 | ::after, 38 | ::before { 39 | margin: 0; 40 | padding: 0; 41 | box-sizing: border-box; 42 | } 43 | body { 44 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, 45 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; 46 | background: var(--clr-grey-10); 47 | color: var(--clr-grey-1); 48 | line-height: 1.5; 49 | font-size: 0.875rem; 50 | } 51 | ul { 52 | list-style-type: none; 53 | } 54 | a { 55 | text-decoration: none; 56 | } 57 | h1, 58 | h2, 59 | h3, 60 | h4 { 61 | letter-spacing: var(--spacing); 62 | text-transform: capitalize; 63 | line-height: 1.25; 64 | margin-bottom: 0.75rem; 65 | } 66 | h1 { 67 | font-size: 3rem; 68 | } 69 | h2 { 70 | font-size: 2rem; 71 | } 72 | h3 { 73 | font-size: 1.25rem; 74 | } 75 | h4 { 76 | font-size: 0.875rem; 77 | } 78 | p { 79 | margin-bottom: 1.25rem; 80 | color: var(--clr-grey-5); 81 | } 82 | @media screen and (min-width: 800px) { 83 | h1 { 84 | font-size: 4rem; 85 | } 86 | h2 { 87 | font-size: 2.5rem; 88 | } 89 | h3 { 90 | font-size: 1.75rem; 91 | } 92 | h4 { 93 | font-size: 1rem; 94 | } 95 | body { 96 | font-size: 1rem; 97 | } 98 | h1, 99 | h2, 100 | h3, 101 | h4 { 102 | line-height: 1; 103 | } 104 | } 105 | .section { 106 | width: 90vw; 107 | margin: 0 auto; 108 | max-width: var(--max-width); 109 | } 110 | 111 | @media screen and (min-width: 992px) { 112 | .section { 113 | width: 95vw; 114 | } 115 | } 116 | main { 117 | min-height: 100vh; 118 | display: grid; 119 | place-items: center; 120 | } 121 | .title { 122 | text-align: center; 123 | margin-bottom: 4rem; 124 | } 125 | .underline { 126 | height: 0.25rem; 127 | width: 5rem; 128 | background: var(--clr-primary-5); 129 | margin-left: auto; 130 | margin-right: auto; 131 | } 132 | .container { 133 | width: 80vw; 134 | max-width: var(--fixed-width); 135 | } 136 | .review { 137 | background: var(--clr-white); 138 | padding: 1.5rem 2rem; 139 | border-radius: var(--radius); 140 | box-shadow: var(--light-shadow); 141 | transition: var(--transition); 142 | text-align: center; 143 | } 144 | .review:hover { 145 | box-shadow: var(--dark-shadow); 146 | } 147 | .img-container { 148 | position: relative; 149 | width: 150px; 150 | height: 150px; 151 | border-radius: 50%; 152 | margin: 0 auto; 153 | margin-bottom: 1.5rem; 154 | } 155 | .person-img { 156 | width: 100%; 157 | display: block; 158 | height: 100%; 159 | object-fit: cover; 160 | border-radius: 50%; 161 | position: relative; 162 | } 163 | .quote-icon { 164 | position: absolute; 165 | top: 0; 166 | left: 0; 167 | width: 2.5rem; 168 | height: 2.5rem; 169 | display: grid; 170 | place-items: center; 171 | border-radius: 50%; 172 | transform: translateY(25%); 173 | background: var(--clr-primary-5); 174 | color: var(--clr-white); 175 | } 176 | .img-container::before { 177 | content: ""; 178 | width: 100%; 179 | height: 100%; 180 | background: var(--clr-primary-5); 181 | position: absolute; 182 | top: -0.25rem; 183 | right: -0.5rem; 184 | border-radius: 50%; 185 | } 186 | .author { 187 | margin-bottom: 0.25rem; 188 | } 189 | .job { 190 | margin-bottom: 0.5rem; 191 | text-transform: uppercase; 192 | color: var(--clr-primary-5); 193 | font-size: 0.85rem; 194 | } 195 | .info { 196 | margin-bottom: 0.75rem; 197 | } 198 | .prev-btn, 199 | .next-btn { 200 | color: var(--clr-primary-7); 201 | font-size: 1.25rem; 202 | background: transparent; 203 | border-color: transparent; 204 | margin: 0 0.5rem; 205 | transition: var(--transition); 206 | cursor: pointer; 207 | } 208 | .prev-btn:hover, 209 | .next-btn:hover { 210 | color: var(--clr-primary-5); 211 | } 212 | .random-btn { 213 | margin-top: 0.5rem; 214 | background: var(--clr-primary-10); 215 | color: var(--clr-primary-5); 216 | padding: 0.25rem 0.5rem; 217 | text-transform: capitalize; 218 | border-radius: var(--radius); 219 | transition: var(--transition); 220 | border-color: transparent; 221 | cursor: pointer; 222 | } 223 | .random-btn:hover { 224 | background: var(--clr-primary-5); 225 | color: var(--clr-primary-1); 226 | } 227 | -------------------------------------------------------------------------------- /3-reviews/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /3-reviews/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /3-reviews/src/review/Review.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import people from "../data/Data"; 3 | import { FaChevronLeft, FaChevronRight, FaQuoteRight } from "react-icons/fa"; 4 | 5 | export default function Review() { 6 | const [index, setIndex] = useState(0); 7 | const { name, job, image, text } = people[index]; 8 | 9 | const checkNumber = (number) => { 10 | if (number > people.length - 1) { 11 | let zero = 0; 12 | return zero; 13 | } 14 | if (number < 0) { 15 | let peopleMinus = people.length - 1; 16 | return peopleMinus; 17 | } 18 | return number; 19 | }; 20 | 21 | const nextPerson = () => { 22 | setIndex((index) => { 23 | let newIndex = index + 1; 24 | return checkNumber(newIndex); 25 | }); 26 | }; 27 | 28 | const prevPerson = () => { 29 | setIndex((index) => { 30 | let newIndex = index - 1; 31 | return checkNumber(newIndex); 32 | }); 33 | }; 34 | 35 | const randomPerson = () => { 36 | let randomNumber = Math.floor(Math.random() * people.length); 37 | if (randomNumber === index) { 38 | randomNumber = index + 1; 39 | } 40 | setIndex(checkNumber(randomNumber)); 41 | }; 42 | 43 | return ( 44 | <> 45 |
46 |
47 | {name} 48 | 49 | 50 | 51 |
52 |

{name}

53 |

{job}

54 |

{text}

55 |
56 | 59 | 62 |
63 | 66 |
67 | 68 | ); 69 | } 70 | -------------------------------------------------------------------------------- /3-reviews/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /4-accordion/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /4-accordion/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /4-accordion/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "4-accordion", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.10", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-icons": "^4.2.0", 12 | "react-scripts": "4.0.3", 13 | "web-vitals": "^1.1.1" 14 | }, 15 | "scripts": { 16 | "start": "react-scripts start", 17 | "build": "react-scripts build", 18 | "test": "react-scripts test", 19 | "eject": "react-scripts eject" 20 | }, 21 | "eslintConfig": { 22 | "extends": [ 23 | "react-app", 24 | "react-app/jest" 25 | ] 26 | }, 27 | "browserslist": { 28 | "production": [ 29 | ">0.2%", 30 | "not dead", 31 | "not op_mini all" 32 | ], 33 | "development": [ 34 | "last 1 chrome version", 35 | "last 1 firefox version", 36 | "last 1 safari version" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /4-accordion/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/4-accordion/public/favicon.ico -------------------------------------------------------------------------------- /4-accordion/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /4-accordion/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/4-accordion/public/logo192.png -------------------------------------------------------------------------------- /4-accordion/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/4-accordion/public/logo512.png -------------------------------------------------------------------------------- /4-accordion/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /4-accordion/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /4-accordion/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import data from "./data/Data"; 3 | import SingleQuestion from "./singleQuestion/SingleQuestion"; 4 | 5 | export default function App() { 6 | const [questions, setQuestions] = useState(data); 7 | return ( 8 | <> 9 |
10 |
11 |

questions and answers About Google

12 |
13 | {questions.map((item) => { 14 | return ( 15 | <> 16 | 17 | 18 | ); 19 | })} 20 |
21 |
22 |
23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /4-accordion/src/data/Data.js: -------------------------------------------------------------------------------- 1 | const questions = [ 2 | { 3 | id: 1, 4 | question: "What’s the difference between Google One and Google Drive?", 5 | answer: 6 | "Google Drive is a storage service. Google One is a subscription plan that gives you more storage to use across Google Drive, Gmail, and Google Photos. Plus, with Google One, you get extra benefits and can share your membership with your family.", 7 | }, 8 | { 9 | id: 2, 10 | question: 11 | "How does the storage I get with Google One compare to what I get for free?", 12 | answer: 13 | "Every Google Account starts with 15 GB of free storage that’s shared across Google Drive, Gmail, and Google Photos. When you upgrade to Google One, your total storage increases to 100 GB or more depending on what plan you choose. You also get extra member benefits and access to support from Google experts - all of which you can share with your family. Learn more about storage with Google One.", 14 | }, 15 | { 16 | id: 3, 17 | question: "How can I use Google One if I’m not a member?", 18 | answer: 19 | "As a free Google One user, you can back up data on your Android phone, and also free up space in your Google Account using the storage manager. If you get a Google One membership, you’ll unlock additional features like expanded cloud storage, support from our team of Google experts, and exclusive benefits.", 20 | }, 21 | { 22 | id: 4, 23 | question: "Who can I share my Google One membership with?", 24 | answer: 25 | "You can share Google One with up to 5 additional family members at no extra cost (so 6 total, including you). When you create a new family group, you can add or remove other family members.", 26 | }, 27 | { 28 | id: 5, 29 | question: 30 | "What do I share with my family group? Can they see all my stored stuff?", 31 | answer: 32 | "You can share all the benefits of Google One with your family group — without sharing any of your personal files. Family members share the storage space that comes with your Google One plan. But your family group can’t see what you store unless you specifically share it with them from Google Drive, Gmail, or Google Photos. Learn more about sharing Google Drive files.", 33 | }, 34 | ]; 35 | 36 | export default questions; 37 | -------------------------------------------------------------------------------- /4-accordion/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --clr-primary-1: hsl(205, 86%, 17%); 3 | --clr-primary-2: hsl(205, 77%, 27%); 4 | --clr-primary-3: hsl(205, 72%, 37%); 5 | --clr-primary-4: hsl(205, 63%, 48%); 6 | --clr-primary-5: hsl(205, 78%, 60%); 7 | --clr-primary-6: hsl(205, 89%, 70%); 8 | --clr-primary-7: hsl(205, 90%, 76%); 9 | --clr-primary-8: hsl(205, 86%, 81%); 10 | --clr-primary-9: hsl(205, 90%, 88%); 11 | --clr-primary-10: hsl(205, 100%, 96%); 12 | --clr-grey-1: hsl(209, 61%, 16%); 13 | --clr-grey-2: hsl(211, 39%, 23%); 14 | --clr-grey-3: hsl(209, 34%, 30%); 15 | --clr-grey-4: hsl(209, 28%, 39%); 16 | --clr-grey-5: hsl(210, 22%, 49%); 17 | --clr-grey-6: hsl(209, 23%, 60%); 18 | --clr-grey-7: hsl(211, 27%, 70%); 19 | --clr-grey-8: hsl(210, 31%, 80%); 20 | --clr-grey-9: hsl(212, 33%, 89%); 21 | --clr-grey-10: hsl(210, 36%, 96%); 22 | --clr-white: #fff; 23 | --clr-purple: #4b145b; 24 | --clr-red-special: #b4345c; 25 | --clr-grey-special: #eae6eb; 26 | --clr-red-dark: hsl(360, 67%, 44%); 27 | --clr-red-light: hsl(360, 71%, 66%); 28 | --clr-green-dark: hsl(125, 67%, 44%); 29 | --clr-green-light: hsl(125, 71%, 66%); 30 | --clr-black: #222; 31 | --transition: all 0.3s linear; 32 | --spacing: 0.1rem; 33 | --radius: 0.25rem; 34 | --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 35 | --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); 36 | --max-width: 1170px; 37 | --fixed-width: 920px; 38 | } 39 | *, 40 | ::after, 41 | ::before { 42 | margin: 0; 43 | padding: 0; 44 | box-sizing: border-box; 45 | } 46 | body { 47 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, 48 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; 49 | background: #3b5998; 50 | color: black; 51 | line-height: 1.5; 52 | font-size: 0.875rem; 53 | } 54 | ul { 55 | list-style-type: none; 56 | } 57 | a { 58 | text-decoration: none; 59 | } 60 | h1, 61 | h2, 62 | h3, 63 | h4 { 64 | letter-spacing: 0.015rem; 65 | text-transform: capitalize; 66 | line-height: 1.25; 67 | margin-bottom: 0.75rem; 68 | } 69 | h1 { 70 | font-size: 3rem; 71 | } 72 | h2 { 73 | font-size: 2rem; 74 | } 75 | h3 { 76 | font-size: 1.25rem; 77 | } 78 | h4 { 79 | font-size: 0.875rem; 80 | } 81 | p { 82 | margin-bottom: 1.25rem; 83 | color: black; 84 | } 85 | @media screen and (min-width: 800px) { 86 | h1 { 87 | font-size: 4rem; 88 | } 89 | h2 { 90 | font-size: 2.5rem; 91 | } 92 | h3 { 93 | font-size: 1.75rem; 94 | } 95 | h4 { 96 | font-size: 1rem; 97 | } 98 | body { 99 | font-size: 1rem; 100 | } 101 | h1, 102 | h2, 103 | h3, 104 | h4 { 105 | line-height: 1; 106 | } 107 | } 108 | .section { 109 | width: 90vw; 110 | margin: 0 auto; 111 | max-width: var(--max-width); 112 | } 113 | 114 | @media screen and (min-width: 992px) { 115 | .section { 116 | width: 95vw; 117 | } 118 | } 119 | main { 120 | min-height: 100vh; 121 | display: flex; 122 | justify-content: center; 123 | align-items: center; 124 | } 125 | 126 | .container { 127 | width: 90vw; 128 | margin: 5rem auto; 129 | background: var(--clr-white); 130 | border-radius: var(--radius); 131 | padding: 2.5rem 2rem; 132 | max-width: var(--fixed-width); 133 | display: grid; 134 | gap: 1rem 2rem; 135 | } 136 | .container h3 { 137 | line-height: 1.2; 138 | font-weight: 500; 139 | } 140 | @media screen and (min-width: 992px) { 141 | .container { 142 | display: grid; 143 | grid-template-columns: 250px 1fr; 144 | } 145 | } 146 | .question { 147 | padding: 1rem 1.5rem; 148 | border: 2px solid var(--clr-grey-special); 149 | margin-bottom: 1rem; 150 | border-radius: var(--radius); 151 | box-shadow: var(--light-shadow); 152 | } 153 | .question h4 { 154 | text-transform: none; 155 | line-height: 1.5; 156 | } 157 | .question p { 158 | color: var(--clr-grey-3); 159 | margin-bottom: 0; 160 | margin-top: 0.5rem; 161 | } 162 | .question header { 163 | display: flex; 164 | justify-content: space-between; 165 | align-items: center; 166 | } 167 | .question header h4 { 168 | margin-bottom: 0; 169 | } 170 | .btn { 171 | background: transparent; 172 | border-color: transparent; 173 | width: 2rem; 174 | height: 2rem; 175 | background: var(--clr-grey-special); 176 | display: flex; 177 | align-items: center; 178 | justify-content: center; 179 | border-radius: 50%; 180 | color: var(--clr-red-special); 181 | cursor: pointer; 182 | margin-left: 1rem; 183 | align-self: center; 184 | min-width: 2rem; 185 | } 186 | -------------------------------------------------------------------------------- /4-accordion/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /4-accordion/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /4-accordion/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /4-accordion/src/singleQuestion/SingleQuestion.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { AiOutlineMinus, AiOutlinePlus } from "react-icons/ai"; 3 | 4 | export default function SingleQuestion({ question, answer }) { 5 | const [showed, setShowed] = useState(false); 6 | return ( 7 | <> 8 |
9 |
10 |

{question}

11 | 14 |
15 | {showed &&

{answer}

} 16 |
17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /5-menu/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /5-menu/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /5-menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "5-menu", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.10", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-scripts": "4.0.3", 12 | "web-vitals": "^1.1.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /5-menu/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/5-menu/public/favicon.ico -------------------------------------------------------------------------------- /5-menu/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /5-menu/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/5-menu/public/logo192.png -------------------------------------------------------------------------------- /5-menu/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/5-menu/public/logo512.png -------------------------------------------------------------------------------- /5-menu/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /5-menu/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /5-menu/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import Categories from "./categories/Categories"; 3 | import Data from "./data/Data"; 4 | import Menu from "./menu/Menu"; 5 | 6 | export default function App() { 7 | const [menuItems, setMenuItems] = useState(Data); 8 | const [categories, setCategories] = useState([]); 9 | 10 | const filterItems = (category) => { 11 | if (category === "all") { 12 | const menuAllReturnData = setMenuItems(Data); 13 | return menuAllReturnData; 14 | } 15 | const newItems = Data.filter((item) => item.category === category); 16 | setMenuItems(newItems); 17 | }; 18 | 19 | return ( 20 | <> 21 |
22 |
23 |
24 |

our menu

25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /5-menu/src/categories/Categories.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Categories({ filterItems }) { 4 | return ( 5 | <> 6 |
7 | 15 | 23 | 31 |
32 | 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /5-menu/src/data/Data.js: -------------------------------------------------------------------------------- 1 | const menu = [ 2 | { 3 | id: 1, 4 | title: "iphone 12", 5 | category: "phone", 6 | price: "4999.99", 7 | img: 8 | "https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/iphone-12-family-select-2020?wid=940&hei=1112&fmt=jpeg&qlt=80&.v=1604343709000", 9 | desc: 10 | "The iPhone 12 and iPhone 12 mini are Apple's mainstream flagship iPhones for 2020. The phones come in 6.1-inch and 5.4-inch sizes with identical features", 11 | }, 12 | { 13 | id: 2, 14 | title: "Samsung S21", 15 | category: "phone", 16 | price: "3999.99", 17 | img: 18 | "https://images.samsung.com/is/image/samsung/p6pim/levant/sm-g991bzadmea/gallery/levant-galaxy-s21-5g-g991-sm-g991bzadmea-388257277?$720_576_PNG$", 19 | desc: 20 | "Click on any of the prices to see the best deals from the corresponding store. We may get a commission from qualifying sales.", 21 | }, 22 | { 23 | id: 3, 24 | title: "MacBook Pro 16", 25 | category: "laptop", 26 | price: "9999.99", 27 | img: 28 | "https://www.apple.com/v/mac/home/bc/images/overview/compare/macbook_pro_16__x90efpvdutu6_large.jpg", 29 | desc: 30 | "From $2399 or $199.91/mo. for 12 mo.** 16” Retina display1 Intel Core i7 or i9 processor Up to 64GB memory Up to 8TB storage2 Up to 11 hours battery life6", 31 | }, 32 | ]; 33 | 34 | export default menu; 35 | -------------------------------------------------------------------------------- /5-menu/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --clr-primary-1: hsl(205, 86%, 17%); 3 | --clr-primary-2: hsl(205, 77%, 27%); 4 | --clr-primary-3: hsl(205, 72%, 37%); 5 | --clr-primary-4: hsl(205, 63%, 48%); 6 | --clr-primary-5: hsl(205, 78%, 60%); 7 | --clr-primary-6: hsl(205, 89%, 70%); 8 | --clr-primary-7: hsl(205, 90%, 76%); 9 | --clr-primary-8: hsl(205, 86%, 81%); 10 | --clr-primary-9: hsl(205, 90%, 88%); 11 | --clr-primary-10: hsl(205, 100%, 96%); 12 | --clr-grey-1: hsl(209, 61%, 16%); 13 | --clr-grey-2: hsl(211, 39%, 23%); 14 | --clr-grey-3: hsl(209, 34%, 30%); 15 | --clr-grey-4: hsl(209, 28%, 39%); 16 | --clr-grey-5: hsl(210, 22%, 49%); 17 | --clr-grey-6: hsl(209, 23%, 60%); 18 | --clr-grey-7: hsl(211, 27%, 70%); 19 | --clr-grey-8: hsl(210, 31%, 80%); 20 | --clr-grey-9: hsl(212, 33%, 89%); 21 | --clr-grey-10: hsl(210, 36%, 96%); 22 | --clr-white: #fff; 23 | --clr-gold: #c59d5f; 24 | 25 | --clr-red-dark: hsl(360, 67%, 44%); 26 | --clr-red-light: hsl(360, 71%, 66%); 27 | --clr-green-dark: hsl(125, 67%, 44%); 28 | --clr-green-light: hsl(125, 71%, 66%); 29 | --clr-black: #222; 30 | --transition: all 0.3s linear; 31 | --spacing: 0.1rem; 32 | --radius: 0.25rem; 33 | --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 34 | --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); 35 | --max-width: 1170px; 36 | --fixed-width: 620px; 37 | } 38 | *, 39 | ::after, 40 | ::before { 41 | margin: 0; 42 | padding: 0; 43 | box-sizing: border-box; 44 | } 45 | body { 46 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, 47 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; 48 | background: var(--clr-grey-10); 49 | color: var(--clr-grey-1); 50 | line-height: 1.5; 51 | font-size: 0.875rem; 52 | } 53 | ul { 54 | list-style-type: none; 55 | } 56 | a { 57 | text-decoration: none; 58 | } 59 | h1, 60 | h2, 61 | h3, 62 | h4 { 63 | letter-spacing: var(--spacing); 64 | text-transform: capitalize; 65 | line-height: 1.25; 66 | margin-bottom: 0.75rem; 67 | } 68 | h1 { 69 | font-size: 3rem; 70 | } 71 | h2 { 72 | font-size: 2rem; 73 | } 74 | h3 { 75 | font-size: 1.25rem; 76 | } 77 | h4 { 78 | font-size: 0.875rem; 79 | } 80 | p { 81 | margin-bottom: 1.25rem; 82 | color: var(--clr-grey-5); 83 | } 84 | @media screen and (min-width: 800px) { 85 | h1 { 86 | font-size: 4rem; 87 | } 88 | h2 { 89 | font-size: 2.5rem; 90 | } 91 | h3 { 92 | font-size: 1.75rem; 93 | } 94 | h4 { 95 | font-size: 1rem; 96 | } 97 | body { 98 | font-size: 1rem; 99 | } 100 | h1, 101 | h2, 102 | h3, 103 | h4 { 104 | line-height: 1; 105 | } 106 | } 107 | .section { 108 | width: 90vw; 109 | margin: 0 auto; 110 | max-width: var(--max-width); 111 | } 112 | 113 | @media screen and (min-width: 992px) { 114 | .section { 115 | width: 95vw; 116 | } 117 | } 118 | .menu { 119 | padding: 5rem 0; 120 | } 121 | .title { 122 | text-align: center; 123 | margin-bottom: 2rem; 124 | } 125 | .underline { 126 | width: 5rem; 127 | height: 0.25rem; 128 | background: var(--clr-gold); 129 | margin-left: auto; 130 | margin-right: auto; 131 | } 132 | .btn-container { 133 | margin-bottom: 4rem; 134 | display: flex; 135 | justify-content: center; 136 | } 137 | .filter-btn { 138 | background: transparent; 139 | border-color: transparent; 140 | font-size: 1rem; 141 | text-transform: capitalize; 142 | margin: 0 0.5rem; 143 | letter-spacing: 1px; 144 | padding: 0.375rem 0.75rem; 145 | color: var(--clr-gold); 146 | cursor: pointer; 147 | transition: var(--transition); 148 | border-radius: var(--radius); 149 | } 150 | .filter-btn:hover { 151 | background: var(--clr-gold); 152 | color: var(--clr-white); 153 | } 154 | .section-center { 155 | width: 90vw; 156 | margin: 0 auto; 157 | max-width: 1170px; 158 | display: grid; 159 | gap: 3rem 2rem; 160 | justify-items: center; 161 | } 162 | .menu-item { 163 | display: grid; 164 | gap: 1rem 2rem; 165 | max-width: 25rem; 166 | } 167 | .photo { 168 | object-fit: cover; 169 | height: 200px; 170 | width: 100%; 171 | border: 0.25rem solid var(--clr-gold); 172 | border-radius: var(--radius); 173 | display: block; 174 | } 175 | .item-info header { 176 | display: flex; 177 | justify-content: space-between; 178 | border-bottom: 0.5px dotted var(--clr-grey-5); 179 | } 180 | .item-info h4 { 181 | margin-bottom: 0.5rem; 182 | } 183 | .price { 184 | color: var(--clr-gold); 185 | } 186 | .item-text { 187 | margin-bottom: 0; 188 | padding-top: 1rem; 189 | } 190 | 191 | @media screen and (min-width: 768px) { 192 | .menu-item { 193 | grid-template-columns: 225px 1fr; 194 | gap: 0 1.25rem; 195 | max-width: 40rem; 196 | } 197 | .photo { 198 | height: 175px; 199 | } 200 | } 201 | @media screen and (min-width: 1200px) { 202 | .section-center { 203 | width: 95vw; 204 | grid-template-columns: 1fr 1fr; 205 | } 206 | .photo { 207 | height: 150px; 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /5-menu/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /5-menu/src/menu/Menu.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Menu({ items }) { 4 | return ( 5 | <> 6 |
7 | {items.map((item) => { 8 | const { id, title, img, desc, price } = item; 9 | return ( 10 | <> 11 |
12 | {title} 13 |
14 |
15 |

{title}

16 |

{price}

17 |
18 |

{desc}

19 |
20 |
21 | 22 | ); 23 | })} 24 |
25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /5-menu/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /5-menu/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /6-tabs/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /6-tabs/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /6-tabs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "6-tabs", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.10", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-scripts": "4.0.3", 12 | "web-vitals": "^1.1.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /6-tabs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/6-tabs/public/favicon.ico -------------------------------------------------------------------------------- /6-tabs/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /6-tabs/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/6-tabs/public/logo192.png -------------------------------------------------------------------------------- /6-tabs/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/6-tabs/public/logo512.png -------------------------------------------------------------------------------- /6-tabs/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /6-tabs/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /6-tabs/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /6-tabs/src/App.js: -------------------------------------------------------------------------------- 1 | import logo from './logo.svg'; 2 | import './App.css'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | logo 9 |

10 | Edit src/App.js and save to reload. 11 |

12 | 18 | Learn React 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /6-tabs/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /6-tabs/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /6-tabs/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /6-tabs/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /6-tabs/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /6-tabs/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /7-news/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /7-news/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "news", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.12.0", 7 | "@testing-library/react": "^11.2.6", 8 | "@testing-library/user-event": "^12.8.3", 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-scripts": "4.0.3", 12 | "web-vitals": "^1.1.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /7-news/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/7-news/public/favicon.ico -------------------------------------------------------------------------------- /7-news/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /7-news/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/7-news/public/logo192.png -------------------------------------------------------------------------------- /7-news/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncfinkd/react-projects/3517116fde9126ad681df5a7a3f7b502c23a6909/7-news/public/logo512.png -------------------------------------------------------------------------------- /7-news/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /7-news/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /7-news/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /7-news/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import AppQuery from "./AppQuery"; 3 | import { data } from "./data"; 4 | 5 | export default function App() { 6 | return ( 7 | <> 8 |
9 |

ახალი ამბები

10 |
11 |
12 | {data.map((item) => { 13 | return 14 | })} 15 |
16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /7-news/src/AppQuery.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import Modal from "./Modal"; 3 | 4 | export default function AppQuery({ id, title, image, category, time, modalTitle, author }) { 5 | const [showModal, setShowModal] = useState(false); 6 | return ( 7 | <> 8 | {showModal && ( 9 | <> 10 | setShowModal(false)} image={image} title={title} author={author} category={category} time={time} modalTitle={modalTitle} /> 11 | 12 | )} 13 |
setShowModal(!showModal)}> 14 |
15 |
16 | {title} 17 |
18 |
19 | 25 | 26 | 27 |
28 |
29 |
30 | {category} 31 | {time} 32 |
33 |
{title}
34 |
35 |
36 |
37 | 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /7-news/src/Modal.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default function Modal({closeModal, image, title, category, time, modalTitle, author}) { 4 | return( 5 | <> 6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 | 14 |
15 |
16 |

{title}

17 |
18 | {category} 19 | {time} 20 |
21 |
22 | ავტორი:

{author}

23 |
24 | 27 |
28 |
29 |
30 |
31 | 32 | ) 33 | } 34 | -------------------------------------------------------------------------------- /7-news/src/data.js: -------------------------------------------------------------------------------- 1 | export const data = [ 2 | { 3 | id: 0, 4 | category: "განცხადება", 5 | time: "33 წუთის წინ", 6 | title: "გსურთ დიდი გუნდის შექმნა? დაუკავშირდით Google-ს", 7 | image: "http://sites.psu.edu/leadership/wp-content/uploads/sites/8069/2015/03/google_AU_team-730285.png", 8 | author: "მარკ ცუკერბერგი", 9 | modalTitle: "საბეჭდი და ტიპოგრაფიული ინდუსტრიის უშინაარსო ტექსტია. იგი სტანდარტად 1500-იანი წლებიდან იქცა, როდესაც უცნობმა მბეჭდავმა ამწყობ დაზგაზე წიგნის საცდელი ეგზემპლარი დაბეჭდა. მისი ტექსტი არამარტო 5 საუკუნის მანძილზე შემორჩა, არამედ მან დღემდე, ელექტრონული ტიპოგრაფიის დრომდეც უცვლელად მოაღწია. განსაკუთრებული პოპულარობა მას 1960-იან წლებში გამოსულმა Letraset-ის ცნობილმა ტრაფარეტებმა მოუტანა, უფრო მოგვიანებით კი — Aldus PageMaker-ის ტიპის საგამომცემლო პროგრამებმა, რომლებშიც Lorem Ipsum-ის სხვადასხვა ვერსიები იყო ჩაშენებული.", 10 | }, 11 | { 12 | id: 1, 13 | category: "შეკრება", 14 | time: "17 წუთის წინ", 15 | title: "შეხვედრა 2 საათზე გუგლის სათავო ოფისში თემა იქნება პროექტებზე", 16 | image: "https://g.foolcdn.com/editorial/images/446553/meeting_gettyimages-603992138.jpg", 17 | author: "მარკ ცუკერბერგი", 18 | modalTitle: "საბეჭდი და ტიპოგრაფიული ინდუსტრიის უშინაარსო ტექსტია. იგი სტანდარტად 1500-იანი წლებიდან იქცა, როდესაც უცნობმა მბეჭდავმა ამწყობ დაზგაზე წიგნის საცდელი ეგზემპლარი დაბეჭდა. მისი ტექსტი არამარტო 5 საუკუნის მანძილზე შემორჩა, არამედ მან დღემდე, ელექტრონული ტიპოგრაფიის დრომდეც უცვლელად მოაღწია. განსაკუთრებული პოპულარობა მას 1960-იან წლებში გამოსულმა Letraset-ის ცნობილმა ტრაფარეტებმა მოუტანა, უფრო მოგვიანებით კი — Aldus PageMaker-ის ტიპის საგამომცემლო პროგრამებმა, რომლებშიც Lorem Ipsum-ის სხვადასხვა ვერსიები იყო ჩაშენებული.", 19 | }, 20 | { 21 | id: 2, 22 | category: "ტრენინგი", 23 | time: "25 წუთის წინ", 24 | title: "ტრენინგის გასავლელად იქონიეთ აუცილებლად დამადასტურებელი კოდი", 25 | image: "https://datacenterfrontier.com/wp-content/uploads/2019/11/google-belgium-servers-web.jpg", 26 | modalTitle: "საბეჭდი და ტიპოგრაფიული ინდუსტრიის უშინაარსო ტექსტია. იგი სტანდარტად 1500-იანი წლებიდან იქცა, როდესაც უცნობმა მბეჭდავმა ამწყობ დაზგაზე წიგნის საცდელი ეგზემპლარი დაბეჭდა. მისი ტექსტი არამარტო 5 საუკუნის მანძილზე შემორჩა, არამედ მან დღემდე, ელექტრონული ტიპოგრაფიის დრომდეც უცვლელად მოაღწია. განსაკუთრებული პოპულარობა მას 1960-იან წლებში გამოსულმა Letraset-ის ცნობილმა ტრაფარეტებმა მოუტანა, უფრო მოგვიანებით კი — Aldus PageMaker-ის ტიპის საგამომცემლო პროგრამებმა, რომლებშიც Lorem Ipsum-ის სხვადასხვა ვერსიები იყო ჩაშენებული.", 27 | author: "მარკ ცუკერბერგი", 28 | }, 29 | { 30 | id: 0, 31 | category: "განცხადება", 32 | time: "33 წუთის წინ", 33 | title: "გსურთ დიდი გუნდის შექმნა? დაუკავშირდით Google-ს", 34 | image: "http://sites.psu.edu/leadership/wp-content/uploads/sites/8069/2015/03/google_AU_team-730285.png", 35 | author: "მარკ ცუკერბერგი", 36 | modalTitle: "საბეჭდი და ტიპოგრაფიული ინდუსტრიის უშინაარსო ტექსტია. იგი სტანდარტად 1500-იანი წლებიდან იქცა, როდესაც უცნობმა მბეჭდავმა ამწყობ დაზგაზე წიგნის საცდელი ეგზემპლარი დაბეჭდა. მისი ტექსტი არამარტო 5 საუკუნის მანძილზე შემორჩა, არამედ მან დღემდე, ელექტრონული ტიპოგრაფიის დრომდეც უცვლელად მოაღწია. განსაკუთრებული პოპულარობა მას 1960-იან წლებში გამოსულმა Letraset-ის ცნობილმა ტრაფარეტებმა მოუტანა, უფრო მოგვიანებით კი — Aldus PageMaker-ის ტიპის საგამომცემლო პროგრამებმა, რომლებშიც Lorem Ipsum-ის სხვადასხვა ვერსიები იყო ჩაშენებული.", 37 | }, 38 | { 39 | id: 1, 40 | category: "შეკრება", 41 | time: "17 წუთის წინ", 42 | title: "შეხვედრა 2 საათზე გუგლის სათავო ოფისში თემა იქნება პროექტებზე", 43 | image: "https://g.foolcdn.com/editorial/images/446553/meeting_gettyimages-603992138.jpg", 44 | author: "მარკ ცუკერბერგი", 45 | modalTitle: "საბეჭდი და ტიპოგრაფიული ინდუსტრიის უშინაარსო ტექსტია. იგი სტანდარტად 1500-იანი წლებიდან იქცა, როდესაც უცნობმა მბეჭდავმა ამწყობ დაზგაზე წიგნის საცდელი ეგზემპლარი დაბეჭდა. მისი ტექსტი არამარტო 5 საუკუნის მანძილზე შემორჩა, არამედ მან დღემდე, ელექტრონული ტიპოგრაფიის დრომდეც უცვლელად მოაღწია. განსაკუთრებული პოპულარობა მას 1960-იან წლებში გამოსულმა Letraset-ის ცნობილმა ტრაფარეტებმა მოუტანა, უფრო მოგვიანებით კი — Aldus PageMaker-ის ტიპის საგამომცემლო პროგრამებმა, რომლებშიც Lorem Ipsum-ის სხვადასხვა ვერსიები იყო ჩაშენებული.", 46 | }, 47 | { 48 | id: 2, 49 | category: "ტრენინგი", 50 | time: "25 წუთის წინ", 51 | title: "ტრენინგის გასავლელად იქონიეთ აუცილებლად დამადასტურებელი კოდი", 52 | image: "https://datacenterfrontier.com/wp-content/uploads/2019/11/google-belgium-servers-web.jpg", 53 | author: "მარკ ცუკერბერგი", 54 | modalTitle: "საბეჭდი და ტიპოგრაფიული ინდუსტრიის უშინაარსო ტექსტია. იგი სტანდარტად 1500-იანი წლებიდან იქცა, როდესაც უცნობმა მბეჭდავმა ამწყობ დაზგაზე წიგნის საცდელი ეგზემპლარი დაბეჭდა. მისი ტექსტი არამარტო 5 საუკუნის მანძილზე შემორჩა, არამედ მან დღემდე, ელექტრონული ტიპოგრაფიის დრომდეც უცვლელად მოაღწია. განსაკუთრებული პოპულარობა მას 1960-იან წლებში გამოსულმა Letraset-ის ცნობილმა ტრაფარეტებმა მოუტანა, უფრო მოგვიანებით კი — Aldus PageMaker-ის ტიპის საგამომცემლო პროგრამებმა, რომლებშიც Lorem Ipsum-ის სხვადასხვა ვერსიები იყო ჩაშენებული.", 55 | }, 56 | ]; 57 | -------------------------------------------------------------------------------- /7-news/src/index.css: -------------------------------------------------------------------------------- 1 | @import url("//cdn.web-fonts.ge/fonts/bpg-arial-caps/css/bpg-arial-caps.min.css"); 2 | 3 | * { 4 | margin: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | } 8 | 9 | .news-container { 10 | margin-bottom: 20px; 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | margin-top: 20px; 14 | } 15 | 16 | .news-text { 17 | font-family: "BPG Arial Caps", sans-serif; 18 | font-size: 26px; 19 | user-select: none; 20 | color: #202124; 21 | } 22 | 23 | .info-container { 24 | display: flex; 25 | justify-content: flex-start; 26 | flex-wrap: wrap; 27 | flex-grow: 0; 28 | flex-shrink: 0; 29 | } 30 | 31 | .info-child { 32 | min-height: 1px; 33 | position: relative; 34 | padding-left: 15px; 35 | padding-right: 15px; 36 | flex-basis: 0%; 37 | cursor: pointer; 38 | flex-grow: 0; 39 | flex-shrink: 0; 40 | margin-left: 0%; 41 | right: auto; 42 | left: auto; 43 | } 44 | 45 | .info-section { 46 | position: relative; 47 | overflow: hidden; 48 | margin-bottom: 30px; 49 | outline: none; 50 | } 51 | 52 | .info-thumbnail { 53 | position: relative; 54 | width: 250px; 55 | max-width: 100%; 56 | overflow: hidden; 57 | } 58 | 59 | .info-image { 60 | width: 100%; 61 | height: auto; 62 | display: block; 63 | transition: transform 0.4s ease-in-out 0s; 64 | backface-visibility: hidden; 65 | border-radius: 2px; 66 | } 67 | 68 | .info-textAndTitle { 69 | margin-top: 9px; 70 | width: 250px; 71 | max-width: 100%; 72 | } 73 | 74 | .info-category { 75 | display: flex; 76 | font-weight: bold; 77 | font-size: 10px; 78 | font-family: "BPG Arial Caps", sans-serif; 79 | } 80 | 81 | .info-item-category { 82 | color: #1a73e8; 83 | margin-right: 0px; 84 | margin-bottom: 3px; 85 | } 86 | 87 | .info-item-category::after { 88 | content: " | "; 89 | color: rgb(100, 100, 107); 90 | margin-right: 4px; 91 | margin-left: 2px; 92 | transform: translateY(-2px); 93 | } 94 | 95 | .info-item-time { 96 | color: rgb(100, 100, 107); 97 | margin-right: 0px; 98 | margin-bottom: 3px; 99 | } 100 | 101 | .info-text { 102 | font-size: 14.5px; 103 | line-height: 1.31; 104 | font-family: "BPG Arial Caps", sans-serif; 105 | word-spacing: -0.15em; 106 | color: #202124; 107 | transition: color 0.4s ease-in-out 0s; 108 | font-weight: normal; 109 | margin-top: 5px; 110 | display: block; 111 | } 112 | 113 | .info-child:hover .info-text { 114 | color: #1a73e8; 115 | } 116 | 117 | .info-linker { 118 | width: 25px; 119 | position: absolute; 120 | right: 15px; 121 | opacity: 0; 122 | pointer-events: none; 123 | transition: 0.4s ease-in-out 0s; 124 | margin-top: -40px; 125 | border-radius: 100px; 126 | } 127 | 128 | .info-linker svg { 129 | color: #1a73e8; 130 | background-color: #fff; 131 | border-radius: 25px; 132 | } 133 | 134 | .info-child:hover .info-linker { 135 | opacity: 1; 136 | pointer-events: visible; 137 | } 138 | 139 | 140 | .modal-container { 141 | background-color: rgba(0,0,0,0.5); 142 | position: fixed; 143 | width: 100%; 144 | height: 100vh; 145 | z-index: 5; 146 | top: 0; 147 | left: 0; 148 | } 149 | 150 | .modal-content { 151 | position: fixed; 152 | top: 50%; 153 | left: 50%; 154 | transform: translate(-50%, -50%); 155 | background-color: white; 156 | width: 800px; 157 | box-shadow: 0 1px 6px rgb(32 33 36 / 28%); 158 | height: 500px; 159 | border-radius: 2px; 160 | max-width: 100%; 161 | } 162 | 163 | .modal-icon { 164 | position: absolute; 165 | right: 15px; 166 | top: 15px; 167 | } 168 | 169 | .modal-icon svg { 170 | cursor: pointer; 171 | } 172 | 173 | .modal-image-header img { 174 | width: 250px; 175 | height: 500px; 176 | object-fit: cover; 177 | } 178 | 179 | .modal-flex { 180 | display: flex; 181 | } 182 | 183 | .modal-right { 184 | font-family: "BPG Arial Caps", sans-serif; 185 | margin-left: 25px; 186 | margin-top: 15px; 187 | width: 480px; 188 | max-width: 100%; 189 | } 190 | 191 | .modal-right h2 { 192 | font-size: 17px; 193 | user-select: none; 194 | } 195 | 196 | .margin-t3 { 197 | margin-top: 1rem; 198 | } 199 | 200 | .font-md { 201 | font-size: 14px; 202 | user-select: none; 203 | } 204 | 205 | .modal-title { 206 | margin-top: 15px; 207 | color: #666; 208 | user-select: none; 209 | height: 350px; 210 | font-size: 14px; 211 | overflow-y: scroll; 212 | } 213 | 214 | #modal::-webkit-scrollbar { 215 | width: 8px; 216 | } 217 | 218 | /* Track */ 219 | #modal::-webkit-scrollbar-track { 220 | border-radius: 10px; 221 | } 222 | 223 | /* Handle */ 224 | #modal::-webkit-scrollbar-thumb { 225 | background: #3E4042; 226 | border-radius: 10px; 227 | } 228 | 229 | /* Handle on hover */ 230 | #modal::-webkit-scrollbar-thumb:hover { 231 | background: #3E4545; 232 | } 233 | 234 | .modal-author { 235 | display: flex; 236 | align-items: center; 237 | margin-top: 10px; 238 | user-select: none; 239 | } 240 | 241 | .lighter { 242 | font-weight: lighter; 243 | } 244 | 245 | .modal-author span { 246 | margin-right: 5px; 247 | color: #666; 248 | font-size: 14px; 249 | } 250 | 251 | .modal-author p { 252 | font-size: 14px; 253 | } 254 | 255 | @media (max-width: 835px) { 256 | .modal-flex { 257 | flex-direction: column; 258 | } 259 | .modal-right { 260 | margin-left: 10px; 261 | } 262 | .modal-title { 263 | height: 200px; 264 | } 265 | .modal-content { 266 | width: 500px; 267 | height: 90vh; 268 | } 269 | .modal-image-header img { 270 | width: 100%; 271 | } 272 | } 273 | 274 | @media (max-width: 600px) { 275 | .modal-right { 276 | padding-right: 15px; 277 | } 278 | } 279 | -------------------------------------------------------------------------------- /7-news/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /7-news/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /7-news/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021-present, react-projects 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-projects 2 | 3 | React projects 4 | --------------------------------------------------------------------------------