Skip to content

Commit

Permalink
update slug
Browse files Browse the repository at this point in the history
  • Loading branch information
nesmon committed Mar 20, 2023
1 parent 3291984 commit 5e9df0c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/App.jsx → src/Route/Index/Index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Link } from 'react-router-dom';
import './App.css';
import charts from './charts.json';
import Chart from './Components/chart/chart';
import './Index.css';
import charts from './../../charts.json';
import Chart from './../../Components/chart/chart';

function App() {
return (
<div className="App">
<div className="songList">
{charts.map((item, index) => {
return (
<Link to={`/ls/${item.name}`} key={index}>
<Link to={`/score/${item.name}`} key={index}>
<Chart key={index} data={item} />
</Link>
)
Expand Down
Empty file added src/Route/Score/Score.css
Empty file.
16 changes: 16 additions & 0 deletions src/Route/Score/Score.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Link } from 'react-router-dom';
import { useParams } from 'react-router-dom';
import './Score.css';

function Score() {
const { chartId } = useParams();


return (
<div className="App">
{chartId}
</div>
);
}

export default Score;
4 changes: 3 additions & 1 deletion src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import App from './Route/Index/Index';
import Score from './Route/Score/Score';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';


Expand All @@ -10,6 +11,7 @@ const Routing = () => {
<Router>
<Routes>
<Route path="/" element={<App />} />
<Route path="/score/:chartId" element={<Score />} />
</Routes>
</Router>
)
Expand Down

0 comments on commit 5e9df0c

Please sign in to comment.