├── README.md ├── app_todo ├── .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 │ ├── components │ ├── Todoapp.css │ └── Todoapp.js │ └── index.js ├── blogsite ├── .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 │ ├── Pages │ ├── CreateBlog.css │ ├── CreateBlog.js │ ├── Details.css │ ├── Details.js │ ├── Home.css │ └── Home.js │ ├── index.css │ ├── index.js │ └── logo.svg ├── bootstrap_tutorial ├── .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 ├── firstone ├── .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 │ ├── Component │ ├── Cmg.js │ ├── Form.css │ ├── Form.js │ ├── Para.js │ └── title.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js └── routerdom ├── .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 ├── Pages ├── About.js ├── Book.js ├── BookLayout.js ├── BookList.js ├── Contact.js ├── Home.js ├── Login.js ├── NewBook.js ├── NotFound.js └── Registration.js ├── index.css ├── index.js ├── logo.svg ├── reportWebVitals.js └── setupTests.js /README.md: -------------------------------------------------------------------------------- 1 |

2 | React Logo 3 |

4 | 5 | # Reactify: From Novice to Ninja 🚀 6 | 7 | Welcome to Reactify, the ultimate playground for mastering React from novice to ninja! This repository is your one-stop destination for a thrilling React learning journey. Whether you're dipping your toes into React waters or aiming to become a React superhero, you're in the right place. 8 | 9 | ## 🚀 Getting Started 10 | 11 | To embark on this epic React adventure, follow these steps: 12 | 13 | 1. **Clone the Reactify repository**: Clone this repository to your local machine 14 | 2. **Choose Your Quest**: Browse our quest directory, categorized by difficulty levels: 15 | 16 | 🏹 Beginner: Start your journey here if you're new to React. These quests cover the foundational concepts of React components, state, and props. 17 | 18 | ⚔️ Intermediate: Ready to level up? These quests explore more advanced topics like routing, forms, and state management. 19 | 20 | 🌟 Advanced: For the React champions out there, these quests delve into advanced concepts like Redux integration, performance sorcery, and server-side enchantments. 21 | 3.**Unleash Your Skills**: Open a quest folder, read the README instructions, and begin your coding adventure! Each quest README contains clues and challenges to help you on your quest. 22 | 23 | ## 🎮 Quests & Challenges 24 | Explore the diverse quests and challenges that await you: 25 | **Beginner's Boon**: A gentle start for fledgling Reactors. 26 | **The Redux Riddle**: Unravel the mysteries of state management with Redux. 27 | **Routing Realms**: Navigate through the React realms with React Router. 28 | **Masters of Styling**: Conquer the art of styling in React with CSS-in-JS and CSS modules. 29 | **Beyond the DOM**: Dive into React's lifecycle and hooks for ultimate control. 30 | **Server-side Sorcery**: Master server-side rendering with Next.js. 31 | **React Realms Collide**: Battle-tested, real-world projects to hone your skills. 32 | Each quest is designed to be challenging yet rewarding. Can you become a React legend? 33 | 34 | ## 🏰 Project Citadel 35 | The Project Citadel is where our Reactor community thrives. Collaborate, share knowledge, and embark on epic group quests. Feel free to open issues, suggest improvements, or join forces with fellow Reactors. 36 | 37 | ## ⚡ Contribute & Level Up 38 | Contributions are the lifeblood of Reactify. To contribute to our React ecosystem: 39 | 1.🛡️ Fork the Reactify repository. 40 | 41 | 2.🚀 Create a branch for your quest, feature, or bug fix. 42 | 43 | 3.✨ Conjure your magic and make the React world a better place. 44 | 45 | 4.📜 Draft a scroll (pull request) to share your accomplishments with the Reactor community. 46 | 47 | ## 48 | Now, brave Reactor, seize your keyboard and begin your journey to React enlightenment! May your code be bug-free and your React skills boundless. 🌟✨🚀 49 | -------------------------------------------------------------------------------- /app_todo/.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 | -------------------------------------------------------------------------------- /app_todo/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 your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may 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 | -------------------------------------------------------------------------------- /app_todo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app_todo", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.17.0", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "bootstrap": "^5.3.1", 10 | "react": "^18.2.0", 11 | "react-bootstrap": "^2.8.0", 12 | "react-dom": "^18.2.0", 13 | "react-scripts": "5.0.1", 14 | "web-vitals": "^2.1.4" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": [ 24 | "react-app", 25 | "react-app/jest" 26 | ] 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.2%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app_todo/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/app_todo/public/favicon.ico -------------------------------------------------------------------------------- /app_todo/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 18 | 19 | 20 | 21 | 22 | Todo App 23 | 24 | 25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app_todo/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/app_todo/public/logo192.png -------------------------------------------------------------------------------- /app_todo/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/app_todo/public/logo512.png -------------------------------------------------------------------------------- /app_todo/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 | -------------------------------------------------------------------------------- /app_todo/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /app_todo/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/app_todo/src/App.css -------------------------------------------------------------------------------- /app_todo/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Todoapp from './components/Todoapp'; 3 | import './App.css'; 4 | // import Child from "./Child"; 5 | // import Child from "./Child"; 6 | 7 | function App() { 8 | return ( 9 |
10 | 11 |
12 | ); 13 | } 14 | 15 | export default App; 16 | -------------------------------------------------------------------------------- /app_todo/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 | -------------------------------------------------------------------------------- /app_todo/src/components/Todoapp.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin: 0; 3 | background-color: lightskyblue; 4 | font-family: 'Times New Roman', Times, serif; 5 | } 6 | .todo-container{ 7 | /* background-color: white; */ 8 | width: 350px; 9 | position: absolute; 10 | left: 50%; 11 | top: 50%; 12 | transform: translate(-50%, -50%); 13 | text-align: center; 14 | } 15 | .input-section{ 16 | display: flex; 17 | 18 | background-color: white; 19 | } 20 | .input-section input{ 21 | border-radius: 5px; 22 | border: 1px solid silver; 23 | width: 100%; 24 | padding: 10px; 25 | box-sizing: border-box; 26 | } 27 | 28 | 29 | ul{ 30 | 31 | text-align: left; 32 | padding: 0; 33 | } 34 | ul li{ 35 | list-style-type: none; 36 | background-color: lightpink; 37 | padding: 15px; 38 | border-radius: 5px; 39 | margin-top: 5px; 40 | display: flex; 41 | justify-content: space-between; 42 | 43 | 44 | 45 | } 46 | h1{ 47 | margin: 0; 48 | color: red; 49 | padding: 15px; 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /app_todo/src/components/Todoapp.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import Button from 'react-bootstrap/Button'; 3 | 4 | import "./Todoapp.css" 5 | 6 | const Todoapp = () => { 7 | const[text,setText]=useState("") 8 | const[list,setList]=useState([]) 9 | function AddItem(){ 10 | if(text === ""){ 11 | alert("Enter Any Item to Add") 12 | }else{ 13 | const item ={id:list.length,value:text} 14 | setList((pre)=> [...pre,item]) 15 | } 16 | 17 | } 18 | function removeItem(id){ 19 | 20 | const filtered= list.filter((item)=> item.id !=id) 21 | setList(filtered) 22 | 23 | } 24 | return ( 25 |
26 |
27 |

Todo App

28 |
29 | setText(e.target.value)}/> 30 | {' '} 31 |
32 |
    33 | {list.map((item,index)=>( 34 | 35 |
  • {item.value}
  • 36 | ))} 37 |
38 |
39 |
40 | ) 41 | } 42 | 43 | export default Todoapp 44 | -------------------------------------------------------------------------------- /app_todo/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import App from './App'; 4 | 5 | const root = ReactDOM.createRoot(document.getElementById('root')); 6 | root.render( 7 | 8 | 9 | 10 | ); 11 | -------------------------------------------------------------------------------- /blogsite/.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 | -------------------------------------------------------------------------------- /blogsite/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 your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may 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 | -------------------------------------------------------------------------------- /blogsite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blogsite", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.17.0", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.2.0", 10 | "react-dom": "^18.2.0", 11 | "react-router-dom": "^6.16.0", 12 | "react-scripts": "5.0.1", 13 | "web-vitals": "^2.1.4" 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 | -------------------------------------------------------------------------------- /blogsite/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/blogsite/public/favicon.ico -------------------------------------------------------------------------------- /blogsite/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 | -------------------------------------------------------------------------------- /blogsite/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/blogsite/public/logo192.png -------------------------------------------------------------------------------- /blogsite/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/blogsite/public/logo512.png -------------------------------------------------------------------------------- /blogsite/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 | -------------------------------------------------------------------------------- /blogsite/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /blogsite/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/blogsite/src/App.css -------------------------------------------------------------------------------- /blogsite/src/App.js: -------------------------------------------------------------------------------- 1 | import { Route, Routes } from 'react-router-dom'; 2 | import './App.css'; 3 | // import Details from './Pages/Details'; 4 | import Home from './Pages/Home'; 5 | import CreateBlog from './Pages/CreateBlog'; 6 | import Details from './Pages/Details'; 7 | import { createContext,useState } from 'react'; 8 | // import CreateBlog from './Pages/CreateBlog'; 9 | export const mycontext =createContext() 10 | function App() { 11 | 12 | 13 | const [datas,setDatas]=useState([]) 14 | 15 | return ( 16 |
17 | 18 | 19 | } /> 20 | }/> 21 | 22 | } /> 23 | 24 | 25 | 26 | 27 |
28 | ); 29 | } 30 | 31 | export default App; 32 | -------------------------------------------------------------------------------- /blogsite/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 | -------------------------------------------------------------------------------- /blogsite/src/Pages/CreateBlog.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | body{ 7 | background-color: bisque; 8 | } -------------------------------------------------------------------------------- /blogsite/src/Pages/CreateBlog.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from 'react'; 2 | import "./CreateBlog.css"; 3 | import { Link } from 'react-router-dom'; 4 | import { mycontext } from '../App'; 5 | 6 | const CreateBlog = () => { 7 | const { datas, setDatas } = useContext(mycontext); 8 | 9 | const handleDelete = (titleToDelete) => { 10 | // Filter out the blog with the specified title 11 | const updatedDatas = datas.filter(item => item.title !== titleToDelete); 12 | setDatas(updatedDatas); 13 | }; 14 | 15 | return ( 16 |
17 |

26 | Submitted Blog List 27 |

28 |
29 |
30 | {datas.map((item,idx)=>{ 31 | return( 32 |

33 | 34 | 45 | 46 | 47 | Title:{item.title} 54 |

55 | 56 | ) 57 | })} 58 | 59 |
60 | 61 |
62 |
63 | ) 64 | } 65 | 66 | export default CreateBlog; 67 | -------------------------------------------------------------------------------- /blogsite/src/Pages/Details.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | body{ 7 | background-color: bisque; 8 | } -------------------------------------------------------------------------------- /blogsite/src/Pages/Details.js: -------------------------------------------------------------------------------- 1 | // import React, { useContext } from 'react' 2 | import { useContext } from 'react'; 3 | import './Details.css'; 4 | import { Link, useParams } from 'react-router-dom'; 5 | import { mycontext } from '../App'; 6 | 7 | const Details = () => { 8 | const {id}=useParams() 9 | const {datas}=useContext(mycontext) 10 | console.log(id) 11 | const filter=datas.filter(item=>item.title==id) 12 | console.log(filter.map(item=>item.detail)); 13 | return ( 14 |
15 |

24 | Details Of Selected Blog 25 |

26 |
27 |

28 | Blog in Detail:{filter.map(item=>item.detail)}

35 | 36 |
37 |
38 | ) 39 | } 40 | 41 | export default Details 42 | -------------------------------------------------------------------------------- /blogsite/src/Pages/Home.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | body{ 7 | background-color: bisque; 8 | } 9 | .form{ 10 | font-size:25px; 11 | font-weight:700; 12 | } -------------------------------------------------------------------------------- /blogsite/src/Pages/Home.js: -------------------------------------------------------------------------------- 1 | import React, { useContext, useState } from "react"; 2 | import "./Home.css"; 3 | import { Link } from "react-router-dom"; 4 | import { mycontext } from "../App"; 5 | 6 | const Home = () => { 7 | const{datas,setDatas} = useContext(mycontext); 8 | const [title,setTitle]=useState("") 9 | const [detail,setDetail]=useState("") 10 | const handleChange=()=>{ 11 | 12 | setDatas([ 13 | ...datas,{title:title,detail:detail} 14 | ]) 15 | }; 16 | 17 | 18 | return ( 19 |
20 |

30 | Welcome To The Blog Home Page 31 |

32 |
39 |
40 |
41 | 42 |
43 | setTitle(e.target.value)} 50 | 51 | /> 52 |
53 | 54 |
55 | 64 |
65 | 66 | 77 | 78 |
79 |
80 |
81 |
82 | ); 83 | }; 84 | 85 | export default Home; 86 | -------------------------------------------------------------------------------- /blogsite/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 | -------------------------------------------------------------------------------- /blogsite/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | // import reportWebVitals from './reportWebVitals'; 6 | import { BrowserRouter } from 'react-router-dom'; 7 | 8 | const root = ReactDOM.createRoot(document.getElementById('root')); 9 | root.render( 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | 17 | -------------------------------------------------------------------------------- /blogsite/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bootstrap_tutorial/.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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/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 your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may 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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap_tutorial", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.17.0", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "bootstrap": "^5.3.1", 10 | "react": "^18.2.0", 11 | "react-bootstrap": "^2.8.0", 12 | "react-dom": "^18.2.0", 13 | "react-scripts": "5.0.1", 14 | "web-vitals": "^2.1.4" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": [ 24 | "react-app", 25 | "react-app/jest" 26 | ] 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.2%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bootstrap_tutorial/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/bootstrap_tutorial/public/favicon.ico -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/bootstrap_tutorial/public/logo192.png -------------------------------------------------------------------------------- /bootstrap_tutorial/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/bootstrap_tutorial/public/logo512.png -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/src/App.js: -------------------------------------------------------------------------------- 1 | 2 | import './App.css'; 3 | import Button from 'react-bootstrap/Button'; 4 | import InputGroup from 'react-bootstrap/InputGroup'; 5 | import Form from 'react-bootstrap/Form'; 6 | function App() { 7 | return ( 8 |
9 | 10 | 11 | 15 | 16 | 17 |
18 | ); 19 | } 20 | 21 | export default App; 22 | -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /bootstrap_tutorial/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 | -------------------------------------------------------------------------------- /firstone/.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 | -------------------------------------------------------------------------------- /firstone/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 your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may 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 | -------------------------------------------------------------------------------- /firstone/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firstone", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.17.0", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.2.0", 10 | "react-dom": "^18.2.0", 11 | "react-scripts": "5.0.1", 12 | "web-vitals": "^2.1.4" 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 | -------------------------------------------------------------------------------- /firstone/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/firstone/public/favicon.ico -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /firstone/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/firstone/public/logo192.png -------------------------------------------------------------------------------- /firstone/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/firstone/public/logo512.png -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /firstone/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /firstone/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | // import Sreet from "./Component/title"; 3 | // import Para from "./Component/Para"; 4 | // import Cmg from "./Component/Cmg"; 5 | // import Form from "./Component/Form"; 6 | 7 | import './App.css'; 8 | 9 | function App() { 10 | return ( 11 |
12 | {/* 13 | 14 | */} 15 | {/*
*/} 16 |
17 | 18 | ); 19 | } 20 | 21 | export default App; 22 | -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /firstone/src/Component/Cmg.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | const newi = () =>

Continue learning React

4 | 5 | export default newi -------------------------------------------------------------------------------- /firstone/src/Component/Form.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | .container{ 7 | background-color: lightblue; 8 | padding: 50px; 9 | } 10 | .fluid-ui-button-blue{ 11 | background-color: blue; 12 | border-radius: 15%; 13 | color: white; 14 | font-size: larger; 15 | } -------------------------------------------------------------------------------- /firstone/src/Component/Form.js: -------------------------------------------------------------------------------- 1 | import React, {useState, useEffect}from "react"; 2 | import "./Form.css"; 3 | 4 | function Form(){ 5 | const initialvalues ={username:"",email:"",password:""}; 6 | const[formvalues, setFormvalues] =useState(initialvalues); 7 | const[formErrors, setFormErrors] =useState({}); 8 | const [isSubmit, setIsSubmit]=useState(false); 9 | const handleChange=(e) => { 10 | console.log(e.target); 11 | const{name, value }=e.target; 12 | setFormvalues({...formvalues,[name]:value}); 13 | console.log(formvalues); 14 | }; 15 | const handleSubmit = (e) =>{ 16 | e.preventDefault(); 17 | setFormErrors(validate(formvalues)); 18 | setIsSubmit(true); 19 | }; 20 | useEffect(() => { 21 | console.log(formErrors); 22 | if(Object.keys(formErrors).length === 0 && isSubmit){ 23 | console.log(formvalues);} 24 | }, [formErrors]); 25 | const validate=(values)=>{ 26 | const errors={}; 27 | const regex =/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/i; 28 | if(!values.username){ 29 | errors.username="Username is required !"; 30 | } 31 | if(!values.email){ 32 | errors.email="Email is required !"; 33 | }else if(!regex.test(values.email)){ 34 | errors.email="Email is invalid format!"; 35 | 36 | } 37 | if(!values.password){ 38 | errors.password="Password is required !"; 39 | } else if(values.password.length < 4){ 40 | errors.password="Password must be more tha 4 characters!"; 41 | } 42 | return errors; 43 | } 44 | return( 45 |
46 | {Object.keys(formErrors).length === 0 && isSubmit ? (
Signed in Successfully
):( 47 |
{JSON.stringify(formvalues,undefined,2)}
48 | 49 | )} 50 | 51 |

Login Form

52 |
53 |
54 |
55 |
56 | 62 |

{formErrors.username}

63 |

64 |
65 |
66 | 73 |

{formErrors.email}

74 |

75 | 76 |
77 |
78 | 85 |

{formErrors.password}

86 |

87 | 88 | 89 |
90 | 91 |
92 | ) 93 | } 94 | export default Form; 95 | 96 | -------------------------------------------------------------------------------- /firstone/src/Component/Para.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | // function Para(){ 3 | // return

Learning React

4 | // } 5 | const Para =() =>

Learning React

6 | 7 | export default Para -------------------------------------------------------------------------------- /firstone/src/Component/title.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | function Sreet(){ 4 | return

Introduction to React

5 | } 6 | 7 | export default Sreet -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /firstone/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 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 | -------------------------------------------------------------------------------- /firstone/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /firstone/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 | -------------------------------------------------------------------------------- /routerdom/.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 | -------------------------------------------------------------------------------- /routerdom/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 your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may 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 | -------------------------------------------------------------------------------- /routerdom/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "routerdom", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.17.0", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.2.0", 10 | "react-dom": "^18.2.0", 11 | "react-router-dom": "^6.16.0", 12 | "react-scripts": "5.0.1", 13 | "web-vitals": "^2.1.4" 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 | -------------------------------------------------------------------------------- /routerdom/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/routerdom/public/favicon.ico -------------------------------------------------------------------------------- /routerdom/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 | -------------------------------------------------------------------------------- /routerdom/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/routerdom/public/logo192.png -------------------------------------------------------------------------------- /routerdom/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SID41214/Reactjs_Introduction/98ffe0e59daed95b61f4019f429c05743500b4ec/routerdom/public/logo512.png -------------------------------------------------------------------------------- /routerdom/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 | -------------------------------------------------------------------------------- /routerdom/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /routerdom/src/App.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /routerdom/src/App.js: -------------------------------------------------------------------------------- 1 | // import logo from './logo.svg'; 2 | import {Link, Route, Routes } from 'react-router-dom'; 3 | import './App.css'; 4 | import Registration from './Pages/Registration'; 5 | import Login from './Pages/Login'; 6 | import Home from './Pages/Home'; 7 | // import { Home } from './Pages/Home'; 8 | // import { BookList } from './Pages/BookList'; 9 | // import { Book } from './Pages/Book'; 10 | // import { NewBook } from './Pages/NewBook'; 11 | // import { NotFound } from './Pages/NotFound'; 12 | // import { BookLayout } from './Pages/BookLayout'; 13 | 14 | function App() { 15 | return ( 16 |
17 | 18 | } /> 19 | 20 | } /> 21 | 22 | } /> 23 | 24 | 25 | 26 | 27 |
28 | ); 29 | } 30 | 31 | export default App; 32 | {/* 42 | 43 | } /> 44 | }> 45 | } /> 46 | } /> 47 | } /> 48 | 49 | 50 | {/* } /> 51 | } /> 52 | } /> */} 53 | // {/* } /> 54 | // */} */} 55 | -------------------------------------------------------------------------------- /routerdom/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 | -------------------------------------------------------------------------------- /routerdom/src/Pages/About.js: -------------------------------------------------------------------------------- 1 | export function About(){ 2 | return

About

3 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/Book.js: -------------------------------------------------------------------------------- 1 | import { useOutletContext, useParams } from "react-router-dom" 2 | 3 | export function Book(){ 4 | const { id } = useParams() 5 | const obj =useOutletContext() 6 | 7 | 8 | return

Book {id} {obj.hello}

9 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/BookLayout.js: -------------------------------------------------------------------------------- 1 | import { Link, Outlet } from "react-router-dom" 2 | 3 | export function BookLayout(){ 4 | return( 5 |
6 | 7 | Book 1 8 |
9 | Book 2 10 |
11 | NewBook 12 | 13 |
14 | ) 15 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/BookList.js: -------------------------------------------------------------------------------- 1 | // import { Link } from "react-router-dom"; 2 | 3 | export function BookList(){ 4 | return ( 5 |
6 |

BookList

7 | {/* Book 1 8 |
9 | Book 2 10 |
11 | NewBook */} 12 | 13 |
14 | ) 15 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/Contact.js: -------------------------------------------------------------------------------- 1 | export function Contact(){ 2 | return

Contact

3 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/Home.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router-dom' 3 | 4 | function Home() { 5 | return ( 6 |
7 |

Home Page

8 |
14 |
15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 |
23 | 24 | 25 |
26 |
27 | ) 28 | } 29 | 30 | export default Home 31 | -------------------------------------------------------------------------------- /routerdom/src/Pages/Login.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router-dom' 3 | 4 | function Login() { 5 | return ( 6 |
7 |

Login

8 |
14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |

23 | 24 | 25 | 26 |
27 |
28 |
29 | ) 30 | } 31 | 32 | export default Login 33 | -------------------------------------------------------------------------------- /routerdom/src/Pages/NewBook.js: -------------------------------------------------------------------------------- 1 | export function NewBook(){ 2 | return

Inside NewBook

3 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/NotFound.js: -------------------------------------------------------------------------------- 1 | export function NotFound(){ 2 | return

NotFound

3 | } -------------------------------------------------------------------------------- /routerdom/src/Pages/Registration.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Link } from "react-router-dom"; 3 | 4 | function Registration() { 5 | return ( 6 |
7 |

Register

8 |
16 |
17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 |
33 | 34 |

35 | 36 | 37 | 38 |
39 |
40 |
41 | ); 42 | }; 43 | 44 | export default Registration; 45 | -------------------------------------------------------------------------------- /routerdom/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 | -------------------------------------------------------------------------------- /routerdom/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import {BrowserRouter} from "react-router-dom"; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /routerdom/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /routerdom/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 | -------------------------------------------------------------------------------- /routerdom/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 | --------------------------------------------------------------------------------