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

Genres list #10

Merged
merged 5 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

html,
body {
@apply h-full w-full bg-base-100;
@apply h-full w-full overflow-hidden bg-base-100;
}

.page {
Expand Down
34 changes: 34 additions & 0 deletions src/components/Home/GenresList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useState } from "react";

function GenresList() {
const menu = [
{ id: 1, name: "All" },
{ id: 2, name: "Action" },
{ id: 3, name: "Drama" },
{ id: 4, name: "Movie" },
{ id: 5, name: "Animation" },
{ id: 6, name: "Romance" },
{ id: 7, name: "Horror" },
{ id: 8, name: "Adventure" },
{ id: 9, name: "Fantasy" },
{ id: 10, name: "Thriller" },
];

const [active, setActive] = useState(menu[0].id);

return (
<div className="-ml-4 flex w-screen gap-2 overflow-y-hidden overflow-x-scroll px-4">
{menu.map(({ name, id }) => (
<p
key={id}
className={`m-0 flex cursor-pointer items-center border-l-primary px-1 leading-5 duration-300 ${active === id ? "scale-105 border-l-[3px]" : "text-gray-500"}`}
onClick={() => setActive(id)}
>
{name}
</p>
))}
</div>
);
}

export default GenresList;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ createRoot(document.getElementById("root")!).render(
<QueryClientProvider client={queryClient}>
<ThemeProvider value={theme}>{(<App />) as any}</ThemeProvider>

<ReactQueryDevtools buttonPosition="top-right" />
{/* <ReactQueryDevtools buttonPosition="top-right" /> */}
</QueryClientProvider>
</BrowserRouter>
</React.StrictMode>,
Expand Down
7 changes: 3 additions & 4 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Header from "../components/home/Header";
import GenresList from "../components/Home/GenresList";

export default function Home() {
return (
<div id="home">
<Header />

<div id="home" className="py-6">
<GenresList />
</div>
);
}