Skip to content

Commit

Permalink
Update posters to use TwicPics
Browse files Browse the repository at this point in the history
  • Loading branch information
Strift committed Jan 27, 2025
1 parent a938b2d commit b2d1d3f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 55 deletions.
1 change: 1 addition & 0 deletions src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const Card = ({
src={getTwicpicsUrl('tmdb', poster_path)}
ratio={MOVIE_POSTER_ASPECT_RATIO}
className="w-full h-full object-cover"
alt={title}
/>
</div>
<Title variant="cardTitle" className="text-wrap">
Expand Down
11 changes: 7 additions & 4 deletions src/components/MovieContent/Desktop/DesktopMovieInfos.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react'
import styled from 'styled-components'
import { TwicImg } from '@twicpics/components/react'
import Typography from 'components/Typography'
import Rating from 'components/Rating'
import Poster from 'components/Poster'
import Crews from '../Crews'
import Socials from '../Socials'
import BackdropImage from '../BackdropImage'
import Tags from '../Tags'
import { getTwicpicsUrl } from '~/utils'
import { MOVIE_POSTER_ASPECT_RATIO } from '~/lib/constants'

const Descriptions = styled.div`
margin-left: 40px;
Expand Down Expand Up @@ -54,10 +56,11 @@ const DesktopMovieInfos = ({ movie }) => {
imageUrl={`https://image.tmdb.org/t/p/original/${movie.backdrop_path}`}
>
<Infos>
<Poster
src={poster_path}
<TwicImg
src={getTwicpicsUrl('tmdb', poster_path)}
alt={movie.title}
style={{ height: 360, flexShrink: 0 }}
ratio={MOVIE_POSTER_ASPECT_RATIO}
className="object-cover w-[240px] h-[360px] shrink-0 rounded-lg"
/>
<Descriptions>
<Typography variant="h1" style={{ textTransform: 'uppercase' }}>
Expand Down
11 changes: 7 additions & 4 deletions src/components/MovieContent/Mobile/MobileLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React, { useMemo } from 'react'
import { useTranslation } from 'next-i18next'
import styled from 'styled-components'
import { TwicImg } from '@twicpics/components/react'
import { useTabState } from 'reakit/Tab'
import { Tab, TabList, TabPanel } from 'components/Tab'
import Typography from 'components/Typography'
import Providers from '../Providers'
import MobileMovieInfos from './MobileMovieInfos'
import Cast from '../Cast'
import BackdropImage from '../BackdropImage'
import Poster from 'components/Poster'
import SectionHeading from './SectionHeading'
import Recommendations from '../Recommendations'
import { useSimilarMovies } from '~/hooks/useSimilarMovies'
import { getTwicpicsUrl } from '~/utils'
import { MOVIE_POSTER_ASPECT_RATIO } from '~/lib/constants'

const StyledTabList = styled(TabList)`
display: flex;
Expand All @@ -27,10 +29,11 @@ const Head = ({ tab, movie }) => {
<BackdropImage
imageUrl={`https://image.tmdb.org/t/p/w780/${backdrop_path}`}
>
<Poster
src={poster_path}
<TwicImg
src={getTwicpicsUrl('tmdb', poster_path)}
alt={movie.title}
style={{ height: 360, flexShrink: 0, marginTop: 120 }}
ratio={MOVIE_POSTER_ASPECT_RATIO}
className="object-cover w-[240px] h-[360px] shrink-0 rounded-lg mt-32"
/>
<StyledTabList {...tab} aria-label="movie tabs">
<Tab {...tab} id="overview">
Expand Down
47 changes: 0 additions & 47 deletions src/components/Poster.js

This file was deleted.

0 comments on commit b2d1d3f

Please sign in to comment.