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

Menu on Main #161

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
21 changes: 19 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import { useAsync } from "react-async-hook";
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
import AddSongPage from "./components/AddSongPage";
import CurrentSongView from "./components/CurrentSongView";
import ViewAllSongbooks from "./components/ViewAllSongbooks";
import WelcomePage from "./components/WelcomePage";
import { getUserDetails } from "./services/songs";
import WishlistForm from "./components/WishlistForm";
import { getAllSongbooks, getUserDetails } from "./services/songs";

function App() {
const asyncUser = useAsync(getUserDetails, [], {
setLoading: (state) => ({ ...state, loading: true }),
});
const asyncSongbooks = useAsync(async () => getAllSongbooks(), []);
const songbooks = asyncSongbooks.result?.data.results;

return (
<BrowserRouter>
Expand All @@ -18,7 +22,20 @@ function App() {
element={<CurrentSongView asyncUser={asyncUser} />}
/>
<Route path="/live/:sessionKey/add-song" element={<AddSongPage />} />
<Route path="/live" element={<WelcomePage asyncUser={asyncUser} />} />
<Route
path="/live/"
element={<WelcomePage asyncUser={asyncUser} songbooks={songbooks} />}
>
<Route path="/live/" element={<WishlistForm />} />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes the path for wishlist /live/live... though maybe not since you're using an absolute path. For readability I would remove the path and instead just use index (no value needed, it'll default to true)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

<Route
path="songbooks"
element={<ViewAllSongbooks is_noodle={true} />}
/>
<Route
path="sing-alongs"
element={<ViewAllSongbooks is_noodle={false} />}
/>
</Route>
<Route path="/" element={<Navigate to="/live" />} />
</Routes>
</BrowserRouter>
Expand Down
195 changes: 0 additions & 195 deletions frontend/src/components/SongbookIndexTable.tsx

This file was deleted.

Loading
Loading