Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update App.js "Switch has been replaced with Routes" #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 13 additions & 22 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Switch, Route, Link } from 'react-router-dom';
import { Layout, Typography, Space } from 'antd';
import { BrowserRouter as Router,Routes, Route, Link } from "react-router-dom";
import { layout, Typography, Space, Divider } from 'antd';

import { Exchanges, Homepage, News, Cryptocurrencies, CryptoDetails, Navbar } from './components';
import './App.css';
Expand All @@ -12,26 +12,17 @@ const App = () => (
</div>
<div className="main">
<Layout>
<div className="routes">
<Switch>
<Route exact path="/">
<Homepage />
</Route>
<Route exact path="/exchanges">
<Exchanges />
</Route>
<Route exact path="/cryptocurrencies">
<Cryptocurrencies />
</Route>
<Route exact path="/crypto/:coinId">
<CryptoDetails />
</Route>
<Route exact path="/news">
<News />
</Route>
</Switch>
</div>
</Layout>
<div className='routes'>

<Routes>
<Route path="/" element={<Homepage />} />
<Route path="/exchanges" element={<Exchanges />}/>
<Route path="/cryptocurrencies" element={<Cryptocurrencies />} />
<Route path="/crypto/:coinId" element={<CryptoDetails />} />
<Route path="/news" element={<News />} />
</Routes>
</div>
</Layout>
<div className="footer">
<Typography.Title level={5} style={{ color: 'white', textAlign: 'center' }}>Copyright © 2021
<Link to="/">
Expand Down