Changeset b612ab1 for frontend/src


Ignore:
Timestamp:
08/27/22 14:36:14 (2 years ago)
Author:
Nace Gjorgjievski <nace.gorgievski123@…>
Branches:
master
Children:
717ceae
Parents:
3c90661
Message:

Basic functions added

Location:
frontend/src
Files:
49 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/App.css

    r3c90661 rb612ab1  
    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 }
  • frontend/src/App.js

    r3c90661 rb612ab1  
    1 import logo from './logo.svg';
    2 import './App.css';
     1import "./App.css";
     2import Home from "./screens/HomeWithJumbo";
     3import ProductScreen from "./screens/ProductScreen";
     4import Test from "./screens/ProductScreenBootstrap";
     5import { BrowserRouter, Route, Routes } from "react-router-dom";
     6import { useContext } from "react";
     7import { Store } from "./Store";
     8import Header from "./components/Header";
     9import Footer from "./components/Footer";
     10import CartScreen from "./screens/CartScreen";
     11import CategoryScreen from "./screens/CategoryScreen";
     12import SigninScreen from "./screens/SigninScreen";
    313
    414function App() {
     15  const { state } = useContext(Store);
     16  const { cart } = state;
    517  return (
    6     <div className="App">
    7       <header className="App-header">
    8         <img src={logo} className="App-logo" alt="logo" />
    9         <p>
    10           Edit <code>src/App.js</code> and save to reload.
    11         </p>
    12         <a
    13           className="App-link"
    14           href="https://reactjs.org"
    15           target="_blank"
    16           rel="noopener noreferrer"
    17         >
    18           Learn React
    19         </a>
    20       </header>
    21     </div>
     18    <BrowserRouter>
     19      <Header />
     20
     21      <Routes>
     22        <Route path="/product/:slug" element={<Test />} />
     23        <Route path="/" element={<Home />} />
     24        <Route path="/cart" element={<CartScreen />} />
     25        <Route path="/signin" element={<SigninScreen />} />
     26        <Route path="/products" element={<CategoryScreen />} />
     27      </Routes>
     28
     29      <Footer />
     30    </BrowserRouter>
    2231  );
    2332}
  • frontend/src/index.css

    r3c90661 rb612ab1  
    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 }
  • frontend/src/index.js

    r3c90661 rb612ab1  
    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';
     1import React from "react";
     2import ReactDOM from "react-dom/client";
     3import { HelmetProvider } from "react-helmet-async";
     4import "./index.css";
     5import App from "./App";
     6import reportWebVitals from "./reportWebVitals";
     7import { StoreProvider } from "./Store";
    68
    7 const root = ReactDOM.createRoot(document.getElementById('root'));
     9const root = ReactDOM.createRoot(document.getElementById("root"));
    810root.render(
    911  <React.StrictMode>
    10     <App />
     12    <StoreProvider>
     13      <HelmetProvider>
     14        <App />
     15      </HelmetProvider>
     16    </StoreProvider>
    1117  </React.StrictMode>
    1218);
Note: See TracChangeset for help on using the changeset viewer.