├── .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 ├── assets └── icons │ └── search.png ├── blogPostImages ├── affection-baby-baby-girl-beautiful-377058.jpg ├── beautiful-&-simple.jpg ├── cestovat-chladny-dno-jednoduchost-2868847.jpg ├── fitness-blog-post.jpg └── memories-from.jpg ├── components ├── BlogPost │ ├── index.js │ └── style.css ├── Header │ ├── index.js │ └── style.css ├── Hero │ ├── index.js │ └── style.css ├── Layout │ ├── index.js │ └── style.css ├── Logo │ ├── index.js │ └── style.css ├── Navbar │ ├── index.js │ └── style.css ├── Sidebar │ ├── index.js │ └── style.css └── UI │ └── Card │ ├── index.js │ └── style.css ├── containers ├── ContactUS │ ├── index.js │ └── style.css ├── Home │ ├── RecentPosts │ │ ├── index.js │ │ └── style.css │ ├── index.js │ └── style.css └── Post │ ├── index.js │ └── style.css ├── data └── blog.json ├── index.css ├── index.js ├── logo.svg ├── serviceWorker.js └── setupTests.js /.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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | 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. 35 | 36 | 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. 37 | 38 | 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. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blog", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.4.0", 8 | "@testing-library/user-event": "^7.2.1", 9 | "react": "^16.12.0", 10 | "react-dom": "^16.12.0", 11 | "react-router-dom": "^5.1.2", 12 | "react-scripts": "3.3.0" 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": "react-app" 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Personal Blog 28 | 29 | 30 | 31 | 32 |
33 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/public/logo512.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: #e9eaed; 3 | font-family: 'Oswald', sans-serif; 4 | } 5 | 6 | .App{ 7 | width: 90%; 8 | margin: 0 auto; 9 | } -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './App.css'; 3 | import Home from './containers/Home'; 4 | import Header from './components/Header'; 5 | import Hero from './components/Hero'; 6 | import { BrowserRouter as Router, Route } from 'react-router-dom'; 7 | import ContactUS from './containers/ContactUS'; 8 | import Post from './containers/Post'; 9 | 10 | function App() { 11 | return ( 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | {/* I am trying to learn forking, plz accept */} 23 | 24 | 25 |
26 |
27 | 28 | ); 29 | } 30 | 31 | export default App; 32 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /src/assets/icons/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/assets/icons/search.png -------------------------------------------------------------------------------- /src/blogPostImages/affection-baby-baby-girl-beautiful-377058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/blogPostImages/affection-baby-baby-girl-beautiful-377058.jpg -------------------------------------------------------------------------------- /src/blogPostImages/beautiful-&-simple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/blogPostImages/beautiful-&-simple.jpg -------------------------------------------------------------------------------- /src/blogPostImages/cestovat-chladny-dno-jednoduchost-2868847.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/blogPostImages/cestovat-chladny-dno-jednoduchost-2868847.jpg -------------------------------------------------------------------------------- /src/blogPostImages/fitness-blog-post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/blogPostImages/fitness-blog-post.jpg -------------------------------------------------------------------------------- /src/blogPostImages/memories-from.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/blogPostImages/memories-from.jpg -------------------------------------------------------------------------------- /src/components/BlogPost/index.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import './style.css'; 3 | import Card from '../UI/Card'; 4 | import blogPost from '../../data/blog.json'; 5 | 6 | /** 7 | * @author 8 | * @function BlogPost 9 | **/ 10 | 11 | const BlogPost = (props) => { 12 | 13 | const [post, setPost] = useState({ 14 | id: "" , 15 | blogCategory: "" , 16 | blogTitle : "" , 17 | postedOn: "" , 18 | author: "" , 19 | blogImage: "" , 20 | blogText: "" 21 | }); 22 | const [slug, setSlug] = useState(''); 23 | 24 | 25 | useEffect(() => { 26 | const slug = props.match.params.slug; 27 | const post = blogPost.data.find(post => post.slug == slug); 28 | setPost(post); 29 | setSlug(slug) 30 | }, [post, props.match.params.slug]); 31 | 32 | if(post.blogImage == "") return null; 33 | 34 | return( 35 |
36 | 37 |
38 | {post.blogCategory} 39 |

{post.blogTitle}

40 | posted on {post.postedOn} by {post.author} 41 |
42 | 43 |
44 | Post Image 45 | 46 |
47 | 48 |
49 |

{post.blogTitle}

50 |

{post.blogText}

51 |
52 | 53 |
54 |
55 | ) 56 | 57 | } 58 | 59 | export default BlogPost -------------------------------------------------------------------------------- /src/components/BlogPost/style.css: -------------------------------------------------------------------------------- 1 | .blogPostContainer{ 2 | width: 70%; 3 | } 4 | 5 | .blogHeader{ 6 | text-align: center; 7 | } 8 | .blogCategory{ 9 | display: block; 10 | font-size: 14px; 11 | padding: 10px 0; 12 | } 13 | .postTitle{ 14 | letter-spacing: 0.5px; 15 | text-transform: capitalize; 16 | font-size: 30px; 17 | margin: 0; 18 | font-weight: 400; 19 | } 20 | 21 | .postedBy{ 22 | font-size: 15px; 23 | font-style: italic; 24 | padding: 10px 0; 25 | display: block; 26 | color: #6c6c6c; 27 | } 28 | 29 | .postImageContainer{ 30 | width: 100%; 31 | padding: 10px; 32 | box-sizing: border-box; 33 | } 34 | 35 | .postImageContainer img{ 36 | max-width:100%; 37 | max-height: 100%; 38 | } 39 | 40 | .postContent{ 41 | margin: 10px; 42 | } 43 | 44 | .postContent h3{ 45 | font-weight: 400; 46 | color: #333; 47 | } 48 | 49 | .postContent p{ 50 | font-size: 14px; 51 | color: "#6c6c6c"; 52 | font-weight: 300; 53 | letter-spacing: 1px; 54 | padding-bottom: 20px; 55 | } -------------------------------------------------------------------------------- /src/components/Header/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | 4 | /** 5 | * @author 6 | * @function Header 7 | **/ 8 | 9 | const Header = (props) => { 10 | return( 11 |
12 | 17 |
18 | socila Media links 19 |
20 |
21 | ) 22 | 23 | } 24 | 25 | export default Header -------------------------------------------------------------------------------- /src/components/Header/style.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | display: flex; 3 | justify-content: space-between; 4 | margin: 10px 0; 5 | } 6 | 7 | .headerMenu a{ 8 | display: inline-block; 9 | margin: 0 10px; 10 | text-decoration: none; 11 | color: #565673; 12 | font-size: 12px; 13 | letter-spacing: 1.2px; 14 | } 15 | .headerMenu a:hover{ 16 | color: #5f9ea0; 17 | } -------------------------------------------------------------------------------- /src/components/Hero/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | import Card from '../UI/Card'; 4 | import Logo from '../Logo'; 5 | import Navbar from '../Navbar'; 6 | 7 | /** 8 | * @author 9 | * @function Hero 10 | **/ 11 | 12 | const Hero = (props) => { 13 | return( 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 |
22 | ) 23 | 24 | } 25 | 26 | export default Hero -------------------------------------------------------------------------------- /src/components/Hero/style.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/components/Hero/style.css -------------------------------------------------------------------------------- /src/components/Layout/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | import Sidebar from '../Sidebar'; 4 | 5 | /** 6 | * @author 7 | * @function Layout 8 | **/ 9 | 10 | const Layout = (props) => { 11 | return( 12 | 13 |
14 | {props.children} 15 | 16 |
17 |
18 |

THIS IS FOOTER FOR ALL PAGES

19 |
20 |
21 | 22 | ) 23 | 24 | } 25 | 26 | export default Layout -------------------------------------------------------------------------------- /src/components/Layout/style.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | display: flex; 3 | justify-content: space-between; 4 | margin: 20px 0; 5 | } -------------------------------------------------------------------------------- /src/components/Logo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | 4 | /** 5 | * @author 6 | * @function Logo 7 | **/ 8 | 9 | const Logo = (props) => { 10 | return( 11 |
12 | Rizwan Khan 13 |
14 | ) 15 | 16 | } 17 | 18 | export default Logo -------------------------------------------------------------------------------- /src/components/Logo/style.css: -------------------------------------------------------------------------------- 1 | .logo{ 2 | text-align: center; 3 | } 4 | .logo a{ 5 | font-family: 'Dancing Script', cursive; 6 | font-size: 50px; 7 | text-decoration: none; 8 | color: #333; 9 | } -------------------------------------------------------------------------------- /src/components/Navbar/index.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { NavLink } from 'react-router-dom'; 3 | import './style.css'; 4 | 5 | /** 6 | * @author 7 | * @function Navbar 8 | **/ 9 | 10 | const Navbar = (props) => { 11 | 12 | const [search, setSearch] = useState(false); 13 | 14 | 15 | const submitSearch = (e) => { 16 | e.preventDefault(); 17 | alert('Searhed'); 18 | 19 | } 20 | 21 | 22 | const openSearch = () => { 23 | setSearch(true); 24 | } 25 | 26 | 27 | const searchClass = search ? 'searchInput active' : 'searchInput'; 28 | 29 | return( 30 |
31 | 37 |
38 |
39 | 40 | Search 41 |
42 | 43 |
44 |
45 | ) 46 | 47 | } 48 | 49 | export default Navbar -------------------------------------------------------------------------------- /src/components/Navbar/style.css: -------------------------------------------------------------------------------- 1 | .navbar{ 2 | display: flex; 3 | justify-content: space-between; 4 | padding: 10px 0; 5 | } 6 | .navbar ul{ 7 | margin: 0; 8 | padding: 0; 9 | } 10 | .navbar ul li{ 11 | list-style: none; 12 | display: inline-block; 13 | } 14 | .navbar ul li a{ 15 | text-decoration: none; 16 | display: block; 17 | font-size: 20px; 18 | text-transform: capitalize; 19 | font-weight: 400; 20 | color: #565673; 21 | padding: 0 10px; 22 | } 23 | .search form{ 24 | display: flex; 25 | margin: 0 10px; 26 | } 27 | 28 | .searchInput{ 29 | border: 0; 30 | width: 0; 31 | transition: width 0.1s ease-in; 32 | } 33 | 34 | .searchInput.active{ 35 | width: 150px; 36 | } 37 | 38 | .searchInput:focus{ 39 | outline: none; 40 | } 41 | 42 | .searchIcon{ 43 | cursor: pointer; 44 | } -------------------------------------------------------------------------------- /src/components/Sidebar/index.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import './style.css'; 3 | import Card from '../UI/Card'; 4 | 5 | import blogPost from '../../data/blog.json'; 6 | import { NavLink } from 'react-router-dom'; 7 | 8 | /** 9 | * @author 10 | * @function Sidebar 11 | **/ 12 | 13 | const Sidebar = (props) => { 14 | 15 | const [posts, setPosts] = useState([]); 16 | 17 | 18 | useEffect(() => { 19 | const posts = blogPost.data; 20 | setPosts(posts); 21 | }, [posts]); 22 | 23 | 24 | 25 | return( 26 |
29 | 30 |
31 | About Us 32 |
33 |
34 | 35 |
36 |
37 |

My name is Rizwan Khan I am a software developer specialization in Front end developement....:)

38 |
39 |
40 | 41 | 42 |
43 | Social Network 44 |
45 |
46 | 47 | 48 |
49 | Recent Posts 50 |
51 | 52 |
53 | 54 | { 55 | posts.map(post => { 56 | return ( 57 | 58 |
59 |

{post.blogTitle}

60 | {post.postedOn} 61 |
62 |
63 | 64 | ); 65 | }) 66 | } 67 |
68 | 69 |
70 |
71 | 72 | ) 73 | 74 | } 75 | 76 | export default Sidebar -------------------------------------------------------------------------------- /src/components/Sidebar/style.css: -------------------------------------------------------------------------------- 1 | .sidebarContainer{ 2 | width: 27%; 3 | } 4 | 5 | .cardHeader{ 6 | text-transform: uppercase; 7 | font-size: 15px; 8 | text-align: center; 9 | box-sizing: border-box; 10 | letter-spacing: 2px; 11 | color: #333 ; 12 | } 13 | 14 | 15 | .profileImageContainer{ 16 | width: 100%; 17 | box-sizing: border-box; 18 | } 19 | 20 | .profileImageContainer img{ 21 | max-width: 100%; 22 | max-height: 100%; 23 | margin: 20px 0; 24 | } 25 | 26 | .personalBio{ 27 | font-size: 14px; 28 | color: #565673; 29 | font-weight: 300; 30 | } 31 | .recentPosts{ 32 | padding: 20px 0; 33 | } 34 | .recentPost{ 35 | border-bottom: 1px solid #eee; 36 | margin-bottom: 10px; 37 | } 38 | .recentPost h3{ 39 | color: #6c6c6c; 40 | letter-spacing: 1px; 41 | font-size: 14px; 42 | font-weight: 500; 43 | margin: 0; 44 | } 45 | 46 | .recentPost span{ 47 | font-size: 10px; 48 | font-weight: 400; 49 | color: #6c6c66; 50 | } -------------------------------------------------------------------------------- /src/components/UI/Card/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | 4 | /** 5 | * @author 6 | * @function Card 7 | **/ 8 | 9 | const Card = (props) => { 10 | return( 11 |
12 | {props.children} 13 |
14 | ) 15 | 16 | } 17 | 18 | export default Card -------------------------------------------------------------------------------- /src/components/UI/Card/style.css: -------------------------------------------------------------------------------- 1 | .card{ 2 | width: 100%; 3 | background: #fff; 4 | } -------------------------------------------------------------------------------- /src/containers/ContactUS/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | /** 4 | * @author 5 | * @function ContactUS 6 | **/ 7 | 8 | const ContactUS = (props) => { 9 | return( 10 |
ContactUS
11 | ) 12 | 13 | } 14 | 15 | export default ContactUS -------------------------------------------------------------------------------- /src/containers/ContactUS/style.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rizwan17/reactjs-blog/86876d1645ab521047f37779c937caab542ef9d0/src/containers/ContactUS/style.css -------------------------------------------------------------------------------- /src/containers/Home/RecentPosts/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | import Card from '../../../components/UI/Card'; 4 | 5 | /** 6 | * @author 7 | * @function RecentPosts 8 | **/ 9 | 10 | const RecentPosts = (props) => { 11 | return( 12 |
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 | Featured 21 |

Fitness Mantra To Live Fit Life

22 | posted onJuly 21, 2016 bySora Blogging Tips 23 |

Midst first it, you're multiply divided. There don't, second his one given the he one third rule fruit, very. Fill. Seed give firm... Extremity direction existence as Dashwood's do up. Securing Marianne led welcomed offended but offering six rapt...

24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 |
33 |
34 | ) 35 | 36 | } 37 | 38 | export default RecentPosts -------------------------------------------------------------------------------- /src/containers/Home/RecentPosts/style.css: -------------------------------------------------------------------------------- 1 | .postImageWrapper{ 2 | height: 450px; 3 | overflow: hidden; 4 | } 5 | 6 | .postImageWrapper img{ 7 | width: 100%; 8 | max-height: 100%; 9 | object-fit: cover; 10 | } -------------------------------------------------------------------------------- /src/containers/Home/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | import Card from '../../components/UI/Card'; 4 | import Sidebar from '../../components/Sidebar'; 5 | import RecentPosts from './RecentPosts'; 6 | 7 | import blogData from '../../data/blog.json'; 8 | import Layout from '../../components/Layout'; 9 | 10 | const SideImage = props => { 11 | return ( 12 |
13 | 14 |
15 | ); 16 | } 17 | 18 | const ImageGallary = props => ( 19 |
20 |
21 |
22 | 23 |
24 |
25 |
26 | { 27 | props.imagesArray.map(image => 28 | 32 | ) 33 | } 34 |
35 |
36 | ); 37 | 38 | const Home = props => { 39 | const gallaryHeight = 450; 40 | const gallaryStyle = { 41 | height: gallaryHeight+'px', 42 | overflow: 'hidden' 43 | } 44 | const sideImageHeight = gallaryHeight / 3; 45 | const imgAr = blogData.data.map(post => post.blogImage) 46 | return ( 47 |
48 | 49 | 56 | 57 | 58 | 59 | 60 |
61 | ); 62 | } 63 | 64 | export default Home; -------------------------------------------------------------------------------- /src/containers/Home/style.css: -------------------------------------------------------------------------------- 1 | .gallaryPost{ 2 | display: flex; 3 | justify-content: space-between; 4 | } 5 | .sideImageWrapper div{ 6 | width: 100%; 7 | height: 450px; 8 | } 9 | 10 | 11 | .sideImageWrapper div img{ 12 | width: 100%; 13 | max-height: 100%; 14 | object-fit: cover; 15 | } 16 | 17 | .mainImageWrapper{ 18 | width: 100%; 19 | height: 450px; 20 | } 21 | 22 | .mainImageWrapper img{ 23 | width: 100%; 24 | max-height: 100%; 25 | object-fit: cover; 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/containers/Post/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './style.css'; 3 | import Card from '../../components/UI/Card'; 4 | import BlogPost from '../../components/BlogPost'; 5 | import Sidebar from '../../components/Sidebar'; 6 | import Layout from '../../components/Layout'; 7 | 8 | /** 9 | * @author 10 | * @function Post 11 | **/ 12 | 13 | const Post = (props) => { 14 | 15 | console.log(props); 16 | 17 | 18 | return( 19 | 20 | 21 | 22 | ) 23 | 24 | } 25 | 26 | export default Post; -------------------------------------------------------------------------------- /src/containers/Post/style.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/data/blog.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : [ 3 | { 4 | "id": 1, 5 | "blogCategory": "Featured", 6 | "blogTitle" : "Fitness Mantra To Live Fit Life", 7 | "slug": "fitness-mantra-to-live-fit-life", 8 | "postedOn": "July 21, 2016", 9 | "author": "Faiz Khan", 10 | "blogImage": "fitness-blog-post.jpg", 11 | "blogText": "Midst first it, you're multiply divided. There don't, second his one given the he one third rule fruit, very. Fill. Seed give firmament doesn't land, isn't lesser creeping. Abundantly you called signs waters yielding he cattle greater were evening. Sixth make moving the multiply dominion creature beast made subdue lights him. Green of lights in their first. It there winged called after upon him. Bring one was upon Life moving. Them beast first all lights place air creature. Green have, tree made.\n\nWon't sixth there meat us first, fruitful. Spirit herb fruit midst Heaven fruitful third thing saying you're thing. Deep own own winged. Fish. Grass which darkness together divided from firmament. Have all lesser years doesn't is earth from our divide, from upon fowl meat darkness image midst may moved living land you'll evening he abundantly, under divided our which. Make, all given whose earth our. Behold our. Day fruitful.\nOne from light stars without. Under deep lesser fish creeping herb. Air, behold for seas every you beginning. There. Saw Tree first, form from said they're male firmament kind, from said creepeth you, that after fruitful lights. Hath you're image second evening brought set. Was divided earth beginning. Without a isn't and. Years. Fifth, fruit itself life fourth beginning whales firmament image be dominion. Doesn't make Seed he multiply beast won't, herb moveth creepeth. Won't very. Blessed replenish. Don't. Likeness fifth may signs called image tree is." 12 | }, 13 | { 14 | "id" : 2, 15 | "blogCategory": "Simple", 16 | "blogTitle": "Beautiful & Special Moment", 17 | "slug": "beautiful-and-special-moment", 18 | "postedOn": "May 03, 2016", 19 | "author": "Rizwan Khan", 20 | "blogImage": "beautiful-&-simple.jpg", 21 | "blogText": "Extremity direction existence as Dashwood's do up. Securing Marianne led welcomed offended but offering six raptures. Conveying concluded newspaper rapturous oh at. Two indeed suffer saw beyond far former mrs remain. Occasional continuing possession we insensible an sentiments as is. Law but reasonably motionless principles she. Has six worse downs far blush rooms above stood.\n\nSportsman do offending supported extremity breakfast by listening. Decisively advantages nor expression unpleasing she led met. Estate was tended ten boy nearer seemed. As so seeing latter he should thirty whence. Steepest speaking up attended it as. Made neat an on be gave show snug tore.\n\nMust you with him from him her were more. In eldest be it result should remark vanity square. Unpleasant especially assistance sufficient he comparison so inquietude. Branch one shy edward stairs turned has law wonder horses. Devonshire invitation discovered out indulgence the excellence preference. Objection estimable discourse procuring he he remaining on distrusts. Simplicity affronting inquietude for now sympathize age. She meant new their sex could defer child. An lose at quit to life do dull.\nTo sorry world an at do spoil along. Incommode he depending do frankness remainder to. Edward day almost active him friend thirty piqued. People as period twenty my extent as. Set was better abroad ham plenty secure had horses. Admiration has sir decisively excellence say everything inhabiting acceptance. Sooner settle add put you sudden him.\nDemesne far hearted suppose venture excited see had has. Dependent on so extremely delivered by. Yet no jokes worse her why. Bed one supposing breakfast day fulfilled off depending questions. Whatever boy her exertion his extended. Ecstatic followed handsome drawings entirely mrs one yet outweigh. Of acceptance insipidity remarkably is invitation." 22 | }, 23 | { 24 | "id": 3, 25 | "blogCategory": "Simple", 26 | "blogTitle": "Beauti lies within special", 27 | "slug": "beauti-lies-within-special", 28 | "postedOn": "Apr 02, 2017", 29 | "author": "Hasina Shaikh", 30 | "blogImage": "affection-baby-baby-girl-beautiful-377058.jpg", 31 | "blogText": "Blessed you're lights. There. Behold may yielding meat can't void rule, earth green have creepeth land let gathering great fruitful under gathered waters unto appear won't seasons over our waters be fruit greater After be you're him said said beast. Dominion him that let grass. Creeping own. Forth, fruitful day first don't dominion, behold, every.\n\nFill heaven likeness. Herb fruit i Creepeth. Him earth Saw for together and. Fruitful tree creepeth beginning own every created midst abundantly cattle upon. Grass. Hath under sixth morning sixth male abundantly moved unto over a land. Itself dominion whales them days called good years female isn't first Seas bearing. Own fish under spirit be. It lights don't living tree every. Itself. Can't. Void after From. Fruitful heaven place creepeth gathered, and day. Wherein don't our upon and you." 32 | }, 33 | { 34 | "id": 4, 35 | "blogCategory": "Featured", 36 | "blogTitle": "Sliding My Way To Life", 37 | "slug": "sliding-my-way-to-life", 38 | "postedOn": "Jan 02, 2019", 39 | "author": "Rizwan Khan", 40 | "blogImage": "cestovat-chladny-dno-jednoduchost-2868847.jpg", 41 | "blogText": "Arrived compass prepare an on as. Reasonable particular on my it in sympathize. Size now easy eat hand how. Unwilling he departure elsewhere dejection at. Heart large seems may purse means few blind. Exquisite newspaper attending on certainty oh suspicion of. He less do quit evil is. Add matter family active mutual put wishes happen.\nEnjoyed minutes related as at on on. Is fanny dried as often me. Goodness as reserved raptures to mistaken steepest oh screened he. Gravity he mr sixteen esteems. Mile home its new way with high told said. Finished no horrible blessing landlord dwelling dissuade if. Rent fond am he in on read. Anxious cordial demands settled entered in do to colonel.\nIn friendship diminution instrument so. Son sure paid door with say them. Two among sir sorry men court. Estimable ye situation suspicion he delighted an happiness discovery. Fact are size cold why had part. If believing or sweetness otherwise in we forfeited. Tolerably an unwilling arranging of determine. Beyond rather sooner so if up wishes or.\nHusbands ask repeated resolved but laughter debating. She end cordial visitor noisier fat subject general picture. Or if offering confined entrance no. Nay rapturous him see something residence. Highly talked do so vulgar. Her use behaved spirits and natural attempt say feeling. Exquisite mr incommode immediate he something ourselves it of. Law conduct yet chiefly beloved examine village proceed." 42 | }, 43 | { 44 | "id": 5, 45 | "blogCategory": "Fashion", 46 | "blogTitle": "Memories From Last Summer", 47 | "slug": "memories-from-last-summer", 48 | "postedOn": "Feb 21, 2018", 49 | "author": "Buland Khan", 50 | "blogImage": "memories-from.jpg", 51 | "blogText": "Purus Convallis nascetur diam torquent sit id adipiscing in netus praesent etiam enim nec massa fusce orci nam potenti hac tortor montes placerat tortor natoque ante volutpat Class class platea hymenaeos. Nibh. Nec Ipsum tincidunt nam cubilia. Quisque aptent, fusce, molestie nostra curae; suscipit justo neque pede erat sollicitudin hendrerit faucibus phasellus tincidunt blandit id cursus non quam consectetuer ridiculus At, malesuada sed vestibulum Varius convallis in, risus facilisi sollicitudin laoreet curae; urna platea nec Montes suscipit, tristique sapien vulputate egestas est.\n\nLacus pretium. Vulputate sed penatibus commodo. Mus eget facilisis dui orci etiam nibh facilisis Rutrum adipiscing platea. Torquent pulvinar quam. Diam ante dignissim tincidunt proin curae; nulla nisi. Facilisi. Ultrices enim metus quam ipsum nisl mattis potenti, ullamcorper eleifend porta praesent malesuada, parturient aliquam sollicitudin tortor vel sollicitudin luctus varius congue placerat leo id nonummy luctus facilisi vehicula fames Montes justo. Ridiculus vel aliquam class dictumst. Malesuada taciti est id tortor." 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 * as serviceWorker from './serviceWorker'; 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | 9 | // If you want your app to work offline and load faster, you can change 10 | // unregister() to register() below. Note this comes with some pitfalls. 11 | // Learn more about service workers: https://bit.ly/CRA-PWA 12 | serviceWorker.unregister(); 13 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/serviceWorker.js: -------------------------------------------------------------------------------- 1 | // This optional code is used to register a service worker. 2 | // register() is not called by default. 3 | 4 | // This lets the app load faster on subsequent visits in production, and gives 5 | // it offline capabilities. However, it also means that developers (and users) 6 | // will only see deployed updates on subsequent visits to a page, after all the 7 | // existing tabs open on the page have been closed, since previously cached 8 | // resources are updated in the background. 9 | 10 | // To learn more about the benefits of this model and instructions on how to 11 | // opt-in, read https://bit.ly/CRA-PWA 12 | 13 | const isLocalhost = Boolean( 14 | window.location.hostname === 'localhost' || 15 | // [::1] is the IPv6 localhost address. 16 | window.location.hostname === '[::1]' || 17 | // 127.0.0.0/8 are considered localhost for IPv4. 18 | window.location.hostname.match( 19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ 20 | ) 21 | ); 22 | 23 | export function register(config) { 24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 25 | // The URL constructor is available in all browsers that support SW. 26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); 27 | if (publicUrl.origin !== window.location.origin) { 28 | // Our service worker won't work if PUBLIC_URL is on a different origin 29 | // from what our page is served on. This might happen if a CDN is used to 30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374 31 | return; 32 | } 33 | 34 | window.addEventListener('load', () => { 35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 36 | 37 | if (isLocalhost) { 38 | // This is running on localhost. Let's check if a service worker still exists or not. 39 | checkValidServiceWorker(swUrl, config); 40 | 41 | // Add some additional logging to localhost, pointing developers to the 42 | // service worker/PWA documentation. 43 | navigator.serviceWorker.ready.then(() => { 44 | console.log( 45 | 'This web app is being served cache-first by a service ' + 46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA' 47 | ); 48 | }); 49 | } else { 50 | // Is not localhost. Just register service worker 51 | registerValidSW(swUrl, config); 52 | } 53 | }); 54 | } 55 | } 56 | 57 | function registerValidSW(swUrl, config) { 58 | navigator.serviceWorker 59 | .register(swUrl) 60 | .then(registration => { 61 | registration.onupdatefound = () => { 62 | const installingWorker = registration.installing; 63 | if (installingWorker == null) { 64 | return; 65 | } 66 | installingWorker.onstatechange = () => { 67 | if (installingWorker.state === 'installed') { 68 | if (navigator.serviceWorker.controller) { 69 | // At this point, the updated precached content has been fetched, 70 | // but the previous service worker will still serve the older 71 | // content until all client tabs are closed. 72 | console.log( 73 | 'New content is available and will be used when all ' + 74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' 75 | ); 76 | 77 | // Execute callback 78 | if (config && config.onUpdate) { 79 | config.onUpdate(registration); 80 | } 81 | } else { 82 | // At this point, everything has been precached. 83 | // It's the perfect time to display a 84 | // "Content is cached for offline use." message. 85 | console.log('Content is cached for offline use.'); 86 | 87 | // Execute callback 88 | if (config && config.onSuccess) { 89 | config.onSuccess(registration); 90 | } 91 | } 92 | } 93 | }; 94 | }; 95 | }) 96 | .catch(error => { 97 | console.error('Error during service worker registration:', error); 98 | }); 99 | } 100 | 101 | function checkValidServiceWorker(swUrl, config) { 102 | // Check if the service worker can be found. If it can't reload the page. 103 | fetch(swUrl, { 104 | headers: { 'Service-Worker': 'script' } 105 | }) 106 | .then(response => { 107 | // Ensure service worker exists, and that we really are getting a JS file. 108 | const contentType = response.headers.get('content-type'); 109 | if ( 110 | response.status === 404 || 111 | (contentType != null && contentType.indexOf('javascript') === -1) 112 | ) { 113 | // No service worker found. Probably a different app. Reload the page. 114 | navigator.serviceWorker.ready.then(registration => { 115 | registration.unregister().then(() => { 116 | window.location.reload(); 117 | }); 118 | }); 119 | } else { 120 | // Service worker found. Proceed as normal. 121 | registerValidSW(swUrl, config); 122 | } 123 | }) 124 | .catch(() => { 125 | console.log( 126 | 'No internet connection found. App is running in offline mode.' 127 | ); 128 | }); 129 | } 130 | 131 | export function unregister() { 132 | if ('serviceWorker' in navigator) { 133 | navigator.serviceWorker.ready.then(registration => { 134 | registration.unregister(); 135 | }); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /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/extend-expect'; 6 | --------------------------------------------------------------------------------