Skip to content

Commit

Permalink
Genres list (#10)
Browse files Browse the repository at this point in the history
* profile-page

* GenresList Complete

* rework GenresList

* fix(home): genre list

---------

Co-authored-by: shifinmalik <[email protected]>
Co-authored-by: Muhammed-Rahif <[email protected]>
  • Loading branch information
3 people authored Jul 27, 2024
1 parent ec94159 commit 6c4ea5e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 12 deletions.
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>
);
}

0 comments on commit 6c4ea5e

Please sign in to comment.