Skip to content

Commit

Permalink
added github
Browse files Browse the repository at this point in the history
  • Loading branch information
domshyra committed Apr 22, 2023
1 parent 9a12d8a commit 3fa83e9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Web/src/components/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useGetRatingsQuery } from "../redux/services/playlistRatingApi";
const Index = () => {
const { data, isLoading } = useGetPlaylistsQuery();
const [cards, setCards] = useState([]);

useGetRatingsQuery();

useEffect(() => {
Expand All @@ -17,7 +17,6 @@ const Index = () => {
}
}, [data, isLoading]);


const renderCards = (data) => {
return data.map((item) => (
<React.Fragment key={item.playlistId}>
Expand All @@ -29,7 +28,9 @@ const Index = () => {
};

return (
<Grid container>{!isLoading ? cards : null}</Grid>
<Grid container>
{!isLoading ? cards : null}
</Grid>
);
};

Expand Down
2 changes: 1 addition & 1 deletion Web/src/main/App.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.App {
text-align: center;
background-color: rgb(26, 32, 39);
padding: 30px 5px 250px 5px;
padding: 30px 5px 0px 5px;
}
.App-logo {
height: 40vmin;
Expand Down
22 changes: 19 additions & 3 deletions Web/src/main/App.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
import "./App.css";

import { BrowserRouter, Route, Routes } from "react-router-dom";
import { BrowserRouter, Link, Route, Routes } from "react-router-dom";
import { Grid, IconButton, Typography } from "@mui/material";

import { Grid } from "@mui/material";
import GitHubIcon from "@mui/icons-material/GitHub";
import Index from "../components/Index";
import PlaylistDetails from "../components/PlaylistDetails";

function App() {
return (
<BrowserRouter>
<div className="App">
<Grid mt={4}>
<Grid mt={2}>
<Routes>
<Route path="/" element={<Index />} />
<Route path="/playlist/:playlistId" element={<PlaylistDetails />} />
</Routes>
</Grid>
<Grid container justifyContent="center" pb={2}>
<Grid item xs={12}>
<IconButton title="view code on github" href="https://github.com/domshyra/domshyra" target="_blank">
<GitHubIcon />
</IconButton>
</Grid>
<Grid item xs={12}>
<Typography component="div" variant="caption" color="text.secondary" align="center">
View this code on{" "}
<Link href="https://github.com/domshyra/domshyra" underline="none">
GitHub
</Link>
</Typography>
</Grid>
</Grid>
</div>
</BrowserRouter>
);
Expand Down

0 comments on commit 3fa83e9

Please sign in to comment.