deniz-9 / e-commerce

0 stars 0 forks source link

recreate main.jsx #29

Open gokhanozdemir opened 14 hours ago

gokhanozdemir commented 14 hours ago

it seems the dom nesting is jumbled. Please find attached the fixed main.jsx, app.jsx and update.

https://github.com/deniz-9/e-commerce/blob/c97651a438819eb5b26673242f2d7622f84133c6/src/main.jsx

gokhanozdemir commented 14 hours ago

App.jsx

import React from "react";
import Homepage from "./components/Homepage";
import ProductPage from "./ProductPage/ProductPage";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Products from "./components/Products";
import Contact from "./components/Contact";
import Team from "./components/Team";
import About from "./components/About";
import Loginpage from "./LoginPage/LoginPage";
import SignUpPage2 from "./LoginPage/SignUpPage2";
//import Order from "./components/AddAddress";
import Order from "./components/Order";
import { useDispatch } from "react-redux";
import { useEffect } from "react";
import { verifyToken } from "./store/action/userAction";

function App() {
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(verifyToken());
  }, [dispatch]);
  return (
    <Router>
      <Switch>
        <Route path="/" exact component={Homepage} />
        <Route path="/products" component={ProductPage} />
        <Route path="/product" component={Products} />
        <Route path="/contact" component={Contact} />
        <Route path="/team" component={Team} />
        <Route path="/about" component={About} />
        <Route path="/signup" component={SignUpPage2} />
        <Route path="/login" component={Loginpage} />
      </Switch>
    </Router>
  );
}

export default App;
gokhanozdemir commented 14 hours ago

main.jsx

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import { BrowserRouter } from "react-router-dom";
import { Provider } from 'react-redux'
import store from './store/store'

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <Provider store={store}>
      <BrowserRouter>
        <App />
      </BrowserRouter>
    </Provider>
  </React.StrictMode>,
)
gokhanozdemir commented 14 hours ago

be careful "SignUpPage2" vs "SingUpPage2"

Image