├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── _redirects ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt └── src ├── App.js ├── assets ├── loading.gif ├── logo.svg └── mainBcg.jpeg ├── components ├── Alert.js ├── Cart │ ├── CartItem.js │ ├── CartLink.js │ └── EmptyCart.js ├── Header.js ├── Hero.js ├── Loading.js ├── LoginLink.js ├── PrivateRoute.js └── Products │ ├── FeaturedProducts.js │ ├── Product.js │ └── ProductList.js ├── context ├── cart.js ├── products.js └── user.js ├── index.css ├── index.js ├── pages ├── About.js ├── Cart.js ├── Checkout.js ├── Error.js ├── Home.js ├── Login.js ├── ProductDetails.js └── Products.js ├── strapi ├── loginUser.js ├── registerUser.js └── submitOrder.js └── utils ├── URL.js ├── helpers.js └── localCart.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": "store", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "axios": "^0.19.0", 7 | "react": "^16.12.0", 8 | "react-dom": "^16.12.0", 9 | "react-icons": "^3.8.0", 10 | "react-router-dom": "^5.1.2", 11 | "react-scripts": "3.2.0", 12 | "react-stripe-elements": "^6.0.1" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": "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/_redirects: -------------------------------------------------------------------------------- 1 | /* /index.html 200 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/john-smilga/starter-project-react-tech-store-v2/8303987da4650f50430dd6a99ed4fd2c44055058/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | 28 | 29 | React Store Recording 30 | 31 | 32 | 33 |
34 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/john-smilga/starter-project-react-tech-store-v2/8303987da4650f50430dd6a99ed4fd2c44055058/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/john-smilga/starter-project-react-tech-store-v2/8303987da4650f50430dd6a99ed4fd2c44055058/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.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function App() { 4 | return

hello from app component

; 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/john-smilga/starter-project-react-tech-store-v2/8303987da4650f50430dd6a99ed4fd2c44055058/src/assets/loading.gif -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/mainBcg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/john-smilga/starter-project-react-tech-store-v2/8303987da4650f50430dd6a99ed4fd2c44055058/src/assets/mainBcg.jpeg -------------------------------------------------------------------------------- /src/components/Alert.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Alert() { 4 | return

hello from alert

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Cart/CartItem.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function CartItem() { 4 | return

hello form cart item

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Cart/CartLink.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function CartLink() { 4 | return

hello from cart link

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Cart/EmptyCart.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function EmptyCart() { 4 | return

hello from empty cart

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Header() { 4 | return

hello from header

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Hero.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Hero() { 4 | return

hello from hero

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Loading.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Loading() { 4 | return

hello from Loading

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/LoginLink.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function LoginLink() { 4 | return

hello from login link

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/PrivateRoute.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function PrivateRoute() { 4 | return

hello from private route

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Products/FeaturedProducts.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function FeaturedProducts() { 4 | return

hello from featured products

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Products/Product.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Product() { 4 | return

hello from product

; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Products/ProductList.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function ProductList() { 4 | return

hello from product list

; 5 | } 6 | -------------------------------------------------------------------------------- /src/context/cart.js: -------------------------------------------------------------------------------- 1 | // cart context 2 | -------------------------------------------------------------------------------- /src/context/products.js: -------------------------------------------------------------------------------- 1 | // products context 2 | -------------------------------------------------------------------------------- /src/context/user.js: -------------------------------------------------------------------------------- 1 | // user context 2 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | /* 2 | ====== 3 | Fonts 4 | ====== 5 | */ 6 | @import url("https://fonts.googleapis.com/css?family=Catamaran:300,400|Kaushan+Script&display=swap"); 7 | /* 8 | ====== 9 | Variables 10 | ====== 11 | */ 12 | :root { 13 | /* --primaryColor: #9e3aa3; */ 14 | /* --primaryDarkColor: #4e1d51; */ 15 | --primaryColor: #f15025; 16 | --primaryDarkColor: #c02c03; 17 | --primaryFont: "Catamaran", sans-serif; 18 | --slantedFont: "Kaushan Script", cursive; 19 | --mainWhite: #fff; 20 | --offWhite: #f7f7f7; 21 | --mainBackground: #ececec; 22 | --mainOverlay: rgba(35, 10, 36, 0.4); 23 | --mainBlack: #222; 24 | --mainGrey: #ececec; 25 | --darkGrey: #afafaf; 26 | --mainRed: #bd0303; 27 | --mainTransition: all 0.3s linear; 28 | --mainSpacing: 0.3rem; 29 | --lightShadow: 2px 5px 3px 0px rgba(0, 0, 0, 0.5); 30 | --darkShadow: 4px 10px 5px 0px rgba(0, 0, 0, 0.5); 31 | --mainBorderRadius: 0.25rem; 32 | --maxWidth: 40rem; 33 | --smallWidth: 85vw; 34 | --fullWidth: 1170px; 35 | } 36 | /* 37 | ====== 38 | Global Styles 39 | ====== 40 | */ 41 | * { 42 | margin: 0; 43 | padding: 0; 44 | box-sizing: border-box; 45 | } 46 | 47 | body { 48 | font-family: var(--primaryFont); 49 | color: var(--mainBlack); 50 | background: var(--mainBackground); 51 | line-height: 1.4; 52 | font-size: 1rem; 53 | font-weight: 300; 54 | } 55 | h1, 56 | h2, 57 | h3, 58 | h4, 59 | h5, 60 | h6 { 61 | font-family: var(--primaryFont); 62 | margin-bottom: 1.25rem; 63 | letter-spacing: var(--mainSpacing); 64 | } 65 | p { 66 | margin-bottom: 1.25rem; 67 | } 68 | ul { 69 | list-style-type: none; 70 | } 71 | a { 72 | text-decoration: none; 73 | color: var(--mainBlack); 74 | } 75 | img { 76 | width: 100%; 77 | display: block; 78 | } 79 | .loading { 80 | text-transform: capitalize; 81 | text-align: center; 82 | font-size: 1.7rem; 83 | margin-top: 3rem; 84 | letter-spacing: var(--mainSpacing); 85 | } 86 | .loading img { 87 | width: 10rem; 88 | margin: 0 auto; 89 | } 90 | /* 91 | ====== 92 | Buttons 93 | ====== 94 | */ 95 | .btn, 96 | .btn-white, 97 | .btn-primary { 98 | text-transform: uppercase; 99 | letter-spacing: var(--mainSpacing); 100 | color: var(--primaryColor); 101 | border: 2px solid var(--primaryColor); 102 | padding: 0.45rem 0.8rem; 103 | display: inline-block; 104 | transition: var(--mainTransition); 105 | cursor: pointer; 106 | font-size: 0.8rem; 107 | background: transparent; 108 | } 109 | .btn:hover { 110 | background: var(--primaryColor); 111 | color: var(--mainWhite); 112 | } 113 | .btn-white { 114 | background: transparent; 115 | color: var(--mainWhite); 116 | border-color: var(--mainWhite); 117 | } 118 | .btn-white:hover { 119 | background: var(--mainWhite); 120 | color: var(--primaryColor); 121 | } 122 | .btn-primary { 123 | background: var(--primaryColor); 124 | color: var(--mainWhite); 125 | border-color: var(--primaryColor); 126 | } 127 | .btn-primary:hover { 128 | background: transparent; 129 | color: var(--primaryColor); 130 | } 131 | .btn-block { 132 | width: 100%; 133 | display: block; 134 | margin: 0 auto; 135 | box-shadow: var(--lightShadow); 136 | text-align: center; 137 | } 138 | /* 139 | ====== 140 | Header 141 | ====== 142 | */ 143 | .header { 144 | padding: 2rem 0; 145 | } 146 | .logo { 147 | margin: 0 auto; 148 | width: 9rem; 149 | } 150 | .header ul { 151 | display: flex; 152 | justify-content: space-between; 153 | width: var(--smallWidth); 154 | margin: 0 auto; 155 | margin-top: 2rem; 156 | max-width: var(--maxWidth); 157 | } 158 | .header ul div { 159 | display: flex; 160 | align-items: center; 161 | } 162 | .header a { 163 | text-transform: capitalize; 164 | margin: 0 0.25rem; 165 | font-size: 0.85rem; 166 | letter-spacing: 2px; 167 | transition: var(--mainTransition); 168 | } 169 | .header a:hover { 170 | color: var(--primaryColor); 171 | } 172 | @media screen and (min-width: 768px) { 173 | .header a { 174 | font-size: 1.5rem; 175 | margin: 0 0.5rem; 176 | } 177 | } 178 | /* 179 | ====== 180 | Hero 181 | ====== 182 | */ 183 | .hero { 184 | min-height: calc(65vh); 185 | background: linear-gradient( 186 | to right, 187 | rgba(0, 0, 0, 0.7) 50%, 188 | rgba(255, 255, 255, 0.1) 189 | ), 190 | url("./assets/mainBcg.jpeg") center/cover no-repeat; 191 | display: flex; 192 | justify-content: center; 193 | align-items: center; 194 | color: var(--primaryDarkColor); 195 | } 196 | .banner { 197 | width: var(--smallWidth); 198 | max-width: var(--fullWidth); 199 | } 200 | .hero h1 { 201 | font-size: 3rem; 202 | text-transform: capitalize; 203 | } 204 | .hero p { 205 | font-size: 1.5rem; 206 | font-weight: bold; 207 | letter-spacing: 3px; 208 | margin-bottom: 1.75rem; 209 | } 210 | .btn-hero { 211 | border-radius: 0; 212 | font-weight: bold; 213 | padding: 0.8rem 1.5rem; 214 | background: var(--primaryDarkColor); 215 | border-color: var(--primaryDarkColor); 216 | color: var(--mainBlack); 217 | } 218 | .btn-hero:hover { 219 | color: var(--primaryDarkColor); 220 | } 221 | @media screen and (min-width: 768px) { 222 | .banner { 223 | margin-top: 0; 224 | } 225 | 226 | .hero h1 { 227 | font-size: 5.3rem; 228 | } 229 | .hero p { 230 | font-size: 2.3rem; 231 | } 232 | .btn-hero { 233 | font-size: 1.2rem; 234 | padding: 1rem 3rem; 235 | } 236 | } 237 | /* 238 | ====== 239 | About 240 | ====== 241 | */ 242 | .about-section { 243 | width: var(--smallWidth); 244 | max-width: var(--maxWidth); 245 | margin: 0 auto; 246 | } 247 | .about-section p { 248 | line-height: 2rem; 249 | font-weight: 400; 250 | letter-spacing: 2px; 251 | } 252 | /* 253 | ====== 254 | Error 255 | ====== 256 | */ 257 | .error-page { 258 | display: flex; 259 | justify-content: center; 260 | } 261 | .error-container { 262 | text-align: center; 263 | text-transform: capitalize; 264 | } 265 | /* 266 | ====== 267 | Product List 268 | ====== 269 | */ 270 | 271 | .section { 272 | padding: 4rem 0; 273 | } 274 | .section-title, 275 | .search-errors { 276 | font-size: 2rem; 277 | text-transform: capitalize; 278 | letter-spacing: var(--mainSpacing); 279 | text-align: center; 280 | margin-bottom: 3.5rem; 281 | } 282 | .products-center { 283 | width: var(--smallWidth); 284 | margin: 0 auto; 285 | max-width: var(--fullWidth); 286 | display: grid; 287 | grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 288 | column-gap: 1.8rem; 289 | row-gap: 1.8rem; 290 | /* align-items: start; */ 291 | } 292 | .product { 293 | background: var(--mainWhite); 294 | margin-bottom: 2rem; 295 | box-shadow: var(--lightShadow); 296 | transition: var(--mainTransition); 297 | display: grid; 298 | grid-template-rows: auto 1fr; 299 | min-height: 19.69rem; 300 | } 301 | .product:hover { 302 | box-shadow: var(--darkShadow); 303 | } 304 | .img-container { 305 | padding: 3rem; 306 | background: rgba(255, 255, 255, 0.5); 307 | position: relative; 308 | /* height: 5rem; */ 309 | } 310 | .product img { 311 | transition: var(--mainTransition); 312 | min-height: 9rem; 313 | } 314 | 315 | .product:hover img { 316 | opacity: 0.3; 317 | } 318 | .product-link { 319 | position: absolute; 320 | top: 50%; 321 | left: 50%; 322 | transform: translate(-50%, -50%); 323 | opacity: 0; 324 | transition: var(--mainTransition); 325 | } 326 | .product:hover .product-link { 327 | opacity: 1; 328 | } 329 | .product-footer { 330 | padding: 0rem 1rem 1rem 1rem; 331 | text-align: center; 332 | letter-spacing: var(--mainSpacing); 333 | display: grid; 334 | grid-template-rows: 1fr auto; 335 | } 336 | .product-title { 337 | text-transform: uppercase; 338 | font-weight: bold; 339 | font-size: 0.8rem; 340 | margin-bottom: 0.5rem; 341 | } 342 | .product-price { 343 | color: var(--primaryColor); 344 | font-weight: bold; 345 | margin-bottom: 0; 346 | font-size: 1.1rem; 347 | } 348 | /* 349 | ====== 350 | Single Product 351 | ====== 352 | */ 353 | 354 | .single-product { 355 | width: var(--smallWidth); 356 | max-width: var(--fullWidth); 357 | margin: 4rem auto; 358 | } 359 | 360 | .single-product article { 361 | margin-bottom: 3rem; 362 | } 363 | .single-product-image { 364 | max-width: 25rem; 365 | align-self: center; 366 | margin: 0 auto; 367 | margin-bottom: 2rem; 368 | } 369 | .single-product h1 { 370 | text-transform: capitalize; 371 | font-size: 2.3rem; 372 | letter-spacing: var(--mainSpacing); 373 | } 374 | .single-product h2 { 375 | color: var(--primaryColor); 376 | } 377 | .single-product p { 378 | line-height: 2; 379 | letter-spacing: 1px; 380 | } 381 | @media screen and (min-width: 992px) { 382 | .single-product { 383 | display: grid; 384 | grid-template-columns: 2fr 3fr; 385 | column-gap: 3rem; 386 | } 387 | } 388 | /* 389 | ====== 390 | Cart 391 | ====== 392 | */ 393 | .empty-cart { 394 | text-align: center; 395 | text-transform: capitalize; 396 | } 397 | .cart-items { 398 | width: var(--smallWidth); 399 | margin: 0 auto; 400 | max-width: var(--maxWidth); 401 | } 402 | .cart-items h2 { 403 | margin-bottom: 2rem; 404 | text-align: center; 405 | text-transform: capitalize; 406 | } 407 | .cart-item { 408 | display: grid; 409 | align-items: center; 410 | grid-template-columns: auto 1fr auto; 411 | grid-column-gap: 1.5rem; 412 | margin: 1.5rem 0; 413 | } 414 | .cart-item img { 415 | width: 5rem; 416 | } 417 | .cart-item h4 { 418 | font-size: 0.85rem; 419 | text-transform: capitalize; 420 | letter-spacing: var(--mainSpacing); 421 | margin-bottom: 0; 422 | } 423 | .cart-item h5 { 424 | margin: 0.5rem 0; 425 | letter-spacing: var(--mainSpacing); 426 | } 427 | .item-amount { 428 | text-align: center; 429 | margin-bottom: 0; 430 | } 431 | .cart-btn { 432 | background: transparent; 433 | border: none; 434 | cursor: pointer; 435 | } 436 | .remove-btn { 437 | color: var(--darkGrey); 438 | letter-spacing: var(--mainSpacing); 439 | cursor: pointer; 440 | font-size: 0.8rem; 441 | } 442 | .amount-btn { 443 | color: var(--primaryColor); 444 | font-size: 1rem; 445 | } 446 | /* 447 | ====== 448 | Cart Link 449 | ====== 450 | */ 451 | .cart-link-container { 452 | position: relative; 453 | } 454 | .cart-link-container a { 455 | margin-right: 10px; 456 | font-weight: bolder; 457 | } 458 | .cart-link-total { 459 | display: block; 460 | position: absolute; 461 | background: var(--primaryColor); 462 | top: -10px; 463 | right: -10px; 464 | padding: 0rem 0.4rem; 465 | border-radius: 50%; 466 | font-size: 1rem; 467 | color: var(--mainWhite); 468 | } 469 | /* 470 | ====== 471 | Login Form 472 | ====== 473 | */ 474 | .form { 475 | width: var(--smallWidth); 476 | margin: 0 auto; 477 | max-width: var(--maxWidth); 478 | } 479 | .login-form, 480 | .checkout-form { 481 | background: var(--mainWhite); 482 | padding: 1.25rem 1rem; 483 | text-transform: capitalize; 484 | border-radius: var(--mainBorderRadius); 485 | box-shadow: var(--lightShadow); 486 | } 487 | 488 | .form-control label { 489 | display: block; 490 | } 491 | .form-control input { 492 | width: 100%; 493 | border: none; 494 | border-bottom: 2px solid var(--darkGrey); 495 | margin-bottom: 1.25rem; 496 | padding: 0.5rem; 497 | font-size: 1.2rem; 498 | } 499 | .form-empty, 500 | .stripe-errors { 501 | text-align: center; 502 | color: var(--mainRed); 503 | } 504 | .register-link { 505 | margin-bottom: 0; 506 | margin-top: 1rem; 507 | text-align: center; 508 | } 509 | .register-link button { 510 | background: transparent; 511 | border: none; 512 | color: var(--primaryColor); 513 | text-transform: capitalize; 514 | font-size: inherit; 515 | display: inline-block; 516 | margin-left: 0.5rem; 517 | cursor: pointer; 518 | } 519 | .disabled { 520 | color: var(--mainWhite); 521 | background: var(--darkGrey); 522 | border-color: var(--darkGrey); 523 | } 524 | .disabled:hover { 525 | background: transparent; 526 | color: var(--darkGrey); 527 | border-color: var(--darkGrey); 528 | } 529 | /* 530 | ====== 531 | Login Button 532 | ====== 533 | */ 534 | .login-btn { 535 | text-transform: capitalize; 536 | background: transparent; 537 | display: inline-block; 538 | border: none; 539 | cursor: pointer; 540 | font-family: var(--primaryFont); 541 | margin: 0 0.25rem; 542 | font-size: 0.85rem; 543 | letter-spacing: 2px; 544 | transition: var(--mainTransition); 545 | font-weight: 300; 546 | } 547 | .login-btn:hover { 548 | color: var(--primaryColor); 549 | } 550 | @media screen and (min-width: 768px) { 551 | .login-btn { 552 | font-size: 1.5rem; 553 | margin: 0 0.5rem; 554 | } 555 | } 556 | /* 557 | ====== 558 | Alert 559 | ====== 560 | */ 561 | .alert-container { 562 | position: fixed; 563 | top: 30%; 564 | left: 50%; 565 | transform: translate(-50%, -50%); 566 | display: none; 567 | z-index: 10; 568 | background: green; 569 | width: 24rem; 570 | padding: 2.5rem 1.5rem; 571 | text-align: center; 572 | color: var(--mainWhite); 573 | font-size: 1.2rem; 574 | font-weight: bold; 575 | text-transform: capitalize; 576 | letter-spacing: var(--mainSpacing); 577 | border-radius: var(--mainBorderRadius); 578 | transition: all 0.3s linear; 579 | } 580 | .alert-show { 581 | display: block; 582 | } 583 | .alert-center { 584 | position: relative; 585 | } 586 | .alert p { 587 | margin-bottom: 0; 588 | line-height: 2; 589 | } 590 | .alert-danger { 591 | background: var(--mainRed); 592 | } 593 | .alert-close { 594 | color: var(--mainWhite); 595 | font-size: 1.5rem; 596 | background: transparent; 597 | border: none; 598 | display: inline-block; 599 | position: absolute; 600 | top: 5px; 601 | right: 7px; 602 | cursor: pointer; 603 | line-height: 0; 604 | } 605 | /* 606 | ====== 607 | Checkout 608 | ====== 609 | */ 610 | .checkout-form h3 span { 611 | color: var(--primaryColor); 612 | } 613 | .stripe-info { 614 | font-size: 80%; 615 | margin-top: 0.5rem; 616 | color: var(--darkGrey); 617 | } 618 | .stripe-info span { 619 | color: var(--primaryColor); 620 | } 621 | 622 | .card-element { 623 | border: 2px solid var(--darkGrey); 624 | padding: 0.5rem; 625 | font-size: 4rem; 626 | border-radius: var(--mainBorderRadius); 627 | } 628 | 629 | .checkout-form .form-empty { 630 | margin-top: 1rem; 631 | margin-bottom: 0; 632 | } 633 | .checkout-form button { 634 | margin-top: 1rem; 635 | } 636 | /* 637 | ====== 638 | Scroll Button 639 | ====== 640 | */ 641 | .scroll-btn { 642 | position: fixed; 643 | right: 1.5rem; 644 | bottom: 1.5rem; 645 | background: var(--mainBlack); 646 | color: var(--mainWhite); 647 | z-index: -100; 648 | opacity: 0; 649 | transition: var(--mainTransition); 650 | font-size: 2rem; 651 | line-height: 0; 652 | padding: 0.3rem 0.5rem; 653 | cursor: pointer; 654 | } 655 | .show-scroll-btn { 656 | z-index: 100; 657 | opacity: 1; 658 | } 659 | /* 660 | ====== 661 | Pagination Buttons 662 | ====== 663 | */ 664 | .pagination-buttons { 665 | width: var(--smallWidth); 666 | max-width: var(--fullWidth); 667 | margin: 0 auto; 668 | margin-top: -4.5rem; 669 | padding-bottom: 2rem; 670 | } 671 | 672 | .pagination-buttons { 673 | display: flex; 674 | justify-content: center; 675 | flex-wrap: wrap; 676 | align-items: center; 677 | } 678 | .page-btn, 679 | .prev-page-btn, 680 | .next-page-btn { 681 | margin: 0.5rem; 682 | padding: 0.25rem 0.5rem; 683 | cursor: pointer; 684 | background: transparent; 685 | transition: var(--mainTransition); 686 | font-size: 1.2rem; 687 | color: var(--primaryColor); 688 | border: none; 689 | } 690 | .page-btn:hover { 691 | background: var(--primaryColor); 692 | color: var(--mainWhite); 693 | } 694 | .page-btn-current { 695 | background: var(--primaryColor); 696 | color: var(--mainWhite); 697 | } 698 | .prev-page-btn, 699 | .next-page-btn { 700 | border: none; 701 | color: var(--primaryColor); 702 | font-size: 1.75rem; 703 | display: flex; 704 | align-items: center; 705 | transition: var(--mainTransition); 706 | } 707 | .prev-page-btn:hover, 708 | .next-page-btn:hover { 709 | background: var(--primaryColor); 710 | color: var(--mainWhite); 711 | } 712 | /* 713 | ====== 714 | Filters Section 715 | ====== 716 | */ 717 | .filters-section { 718 | width: var(--smallWidth); 719 | margin: 0 auto; 720 | max-width: 25rem; 721 | padding-top: 4rem; 722 | margin-bottom: -4rem; 723 | } 724 | .filters-form { 725 | display: grid; 726 | grid-template-columns: 1fr 1fr; 727 | column-gap: 1rem; 728 | } 729 | .filters-form .form-control { 730 | display: block; 731 | margin-bottom: 0.6rem; 732 | } 733 | .filters-form label { 734 | text-transform: capitalize; 735 | margin-bottom: 0.25rem; 736 | } 737 | .filters-form input[type="text"] { 738 | border: 0.5px solid var(--mainBlack); 739 | font-size: 0.8rem; 740 | padding: 0.2rem; 741 | background: transparent; 742 | border-radius: var(--mainBorderRadius); 743 | } 744 | .filters-form select { 745 | background: transparent; 746 | font-size: 0.8rem; 747 | border-color: var(--mainBlack); 748 | border-width: 0.5px; 749 | } 750 | .filters-form input[type="checkbox"] { 751 | margin-right: 0.5rem; 752 | } 753 | .price-group p { 754 | margin-bottom: 0.6rem; 755 | text-transform: capitalize; 756 | } 757 | .price-group label { 758 | display: block; 759 | } 760 | .price-group input { 761 | margin-right: 0.5rem; 762 | } 763 | .filters-section h6 { 764 | text-transform: capitalize; 765 | font-size: 1.3rem; 766 | margin-top: 1rem; 767 | margin-bottom: 0.5rem; 768 | } 769 | .filters-section hr { 770 | border: none; 771 | border-top: 0.5px solid var(--mainBlack); 772 | } 773 | .search-errors { 774 | margin-top: 8rem; 775 | font-size: 1.1rem; 776 | padding: 0 2rem; 777 | } 778 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import "./index.css"; 4 | import App from "./App"; 5 | 6 | ReactDOM.render(, document.getElementById("root")); 7 | -------------------------------------------------------------------------------- /src/pages/About.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function About() { 4 | return

hello from about page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/Cart.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Cart() { 4 | return

hello from cart page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/Checkout.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Checkout() { 4 | return

hello from checkout page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/Error.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Error() { 4 | return

hello form error page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/Home.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Home() { 4 | return

hello from home page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/Login.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Login() { 4 | return

hello from login page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/ProductDetails.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function ProductDetails() { 4 | return

hello from product details page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/Products.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default function Products() { 4 | return

hello from products page

; 5 | } 6 | -------------------------------------------------------------------------------- /src/strapi/loginUser.js: -------------------------------------------------------------------------------- 1 | //login user 2 | -------------------------------------------------------------------------------- /src/strapi/registerUser.js: -------------------------------------------------------------------------------- 1 | // register user 2 | -------------------------------------------------------------------------------- /src/strapi/submitOrder.js: -------------------------------------------------------------------------------- 1 | // submit order 2 | -------------------------------------------------------------------------------- /src/utils/URL.js: -------------------------------------------------------------------------------- 1 | // url 2 | -------------------------------------------------------------------------------- /src/utils/helpers.js: -------------------------------------------------------------------------------- 1 | // helper functions 2 | -------------------------------------------------------------------------------- /src/utils/localCart.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | id: 1, 4 | title: "mac vintage computer", 5 | price: 200.99, 6 | image: 7 | "https://res.cloudinary.com/diqqf3eq2/image/upload/v1574719863/iorxuhfensblqhn6jy5d.png", 8 | amount: 3 9 | }, 10 | { 11 | id: 2, 12 | title: "compaq vintage computer", 13 | price: 40.99, 14 | image: 15 | "https://res.cloudinary.com/diqqf3eq2/image/upload/v1574624417/vx64ovkpz9nu98tqdtzn.png", 16 | amount: 5 17 | }, 18 | { 19 | id: 3, 20 | title: "commodore 64 vintage computer", 21 | price: 129.99, 22 | image: 23 | "https://res.cloudinary.com/diqqf3eq2/image/upload/v1574720064/ousbxxs7ohhddd3wz18k.png", 24 | amount: 4 25 | } 26 | ]; 27 | --------------------------------------------------------------------------------