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

Fix/glitched watchlist card #38

Merged
merged 2 commits into from
Sep 26, 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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TMDB_API_TOKEN=
VITE_TMDB_API_TOKEN=
98 changes: 49 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
![vilm banner](./public/vilm-banner.jpg)

# Vilm

## Guide Instalation

### Requirments

1. Node.js >= 18
2. Typescript
3. PNPM

### Steps

1. Clone the repository

```bash
git clone https://github.com/nnivxix/vilm.git
```

```bash
cd vilm
```

```bash
pnpm install
```

2. Copy the `.env` file

```bash
cp .env.example .env
```

3. Change value the `.env` file

Go to `.env` file and fill the value `TMDB_API_TOKEN=` with key from [TMDB API](https://developer.themoviedb.org/docs/getting-started)

4. Run the Application

```bash
pnpm dev
```

Happy Coding

## Contributions 🎉👋

All contributions and suggestions are welcome.
![vilm banner](./public/vilm-banner.jpg)
# Vilm
## Guide Instalation
### Requirments
1. Node.js >= 18
2. Typescript
3. PNPM
### Steps
1. Clone the repository
```bash
git clone https://github.com/nnivxix/vilm.git
```
```bash
cd vilm
```
```bash
pnpm install
```
2. Copy the `.env` file
```bash
cp .env.example .env
```
3. Change value the `.env` file
Go to `.env` file and fill the value `VITE_TMDB_API_TOKEN=` with key from [TMDB API](https://developer.themoviedb.org/docs/getting-started)
4. Run the Application
```bash
pnpm dev
```
Happy Coding
## Contributions 🎉👋
All contributions and suggestions are welcome.
54 changes: 27 additions & 27 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import "./App.css";

function App() {
return (
<ThemeProvider defaultTheme="dark" storageKey="vilm-theme">
<AccountProvider>
<Router>
<Navbar />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/show/tv/:id" element={<Tv />} />
<Route path="/show/movie/:id" element={<Movie />} />
<Route path="/search" element={<Search />} />
<Route path="/setting" element={<Setting />} />
<Route path="/watchlist/movie" element={<Movies />} />
<Route path="/watchlist/tv" element={<TvShows />} />
<Route path="*" element={<NotFound />} />
</Routes>
<Toaster />
<Footer />
</Router>
</AccountProvider>
</ThemeProvider>
);
}

export default App;
import "./App.css";
function App() {
return (
<ThemeProvider defaultTheme="dark" storageKey="vilm-theme">
<AccountProvider>
<Router>
<Navbar />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/show/tv/:id" element={<Tv />} />
<Route path="/show/movie/:id" element={<Movie />} />
<Route path="/search" element={<Search />} />
<Route path="/setting" element={<Setting />} />
<Route path="/watchlist/movie" element={<Movies />} />
<Route path="/watchlist/tv" element={<TvShows />} />
<Route path="*" element={<NotFound />} />
</Routes>
<Toaster />
<Footer />
</Router>
</AccountProvider>
</ThemeProvider>
);
}
export default App;
28 changes: 16 additions & 12 deletions src/components/BackdropCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ export default function BackdropCard<T extends SimpleBaseMedia>({ media, title,
const isMovieType = Object.prototype.hasOwnProperty.call(media, 'video');

return (
<div {...props} className={`${props.className} rounded-md group transition-transform overflow-clip hover:scale-110`}>
<RImage src={imageUrl({
path: media.backdrop_path,
size: 'w300',
type: 'backdrop'
})}
type="backdrop"
alt={media.overview}
/>
<div className="block lg:hidden group-hover:block">
<Link to={`/show/${isMovieType ? 'movie' : 'tv'}/${media.id}`}>{title}</Link>
</div>
<div title={title} {...props} className={`${props.className} rounded-md group transition-transform overflow-clip hover:scale-110`}
>
<Link to={`/show/${isMovieType ? 'movie' : 'tv'}/${media.id}`}>
<RImage src={imageUrl({
path: media.backdrop_path,
size: 'w300',
type: 'backdrop'

})}
type="backdrop"
alt={media.overview}
/>
<div className="lg:opacity-0 group-hover:opacity-100 line-clamp-2">
{title}
</div>
</Link>
</div>
)
}
16 changes: 8 additions & 8 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const tokenStorage = localStorage.getItem("token");

const config = {
apiUrl: "https://api.themoviedb.org/3",
token: tokenStorage ?? import.meta.env.VITE_TMDB_API_TOKEN,
};

export default config;
const tokenStorage = localStorage.getItem("token");
const config = {
apiUrl: "https://api.themoviedb.org/3",
token: tokenStorage ?? import.meta.env.VITE_TMDB_API_TOKEN,
};
export default config;