Skip to content

Commit

Permalink
Merge pull request #38 from nnivxix/fix/glitched-watchlist-card
Browse files Browse the repository at this point in the history
Fix/glitched watchlist card
  • Loading branch information
nnivxix authored Sep 26, 2024
2 parents 91a24d5 + cde0c50 commit dc7f3e0
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 97 deletions.
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;

0 comments on commit dc7f3e0

Please sign in to comment.