Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
feat: make main page card smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYanZh committed Feb 21, 2024
1 parent 0b0c595 commit e7b93a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ export class Api<
limit?: number
/** search by title */
search?: string
/** the moive is running or not */
/** the movie is running or not */
running?: boolean
},
params: RequestParams = {}
Expand Down
17 changes: 7 additions & 10 deletions src/pages/Main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ const Movie: React.FC<{ movie: SchemaMovie }> = ({ movie }) => {
const handleClose = () => setShow(false)
const handleShow = () => setShow(true)
return (
<Card style={{ width: '18rem' }} className='mb-3'>
<Card className='mb-3'>
<Card.Img variant='top' src={movie.trailer_picture} />
<Card.Body>
<Card.Title>{movie.title}</Card.Title>
<Card.Text>
<div>Director: {movie.director}</div>
<div>Cast: {movie.cast}</div>
<div>Category: {movie.category}</div>
<Card.Link href='#' onClick={handleShow}>
Watch Trailer
</Card.Link>
</Card.Text>
<Button variant='secondary' onClick={handleShow}>
Watch Trailer
</Button>{' '}
<Link to={`/moive/${movie.id}/book`}>
<Link to={`/movie/${movie.id}/book`}>
<Button variant='primary'>Book Movie</Button>
</Link>
</Card.Body>
Expand Down Expand Up @@ -60,7 +57,7 @@ const Movie: React.FC<{ movie: SchemaMovie }> = ({ movie }) => {
const MovieList: React.FC<{ movies: SchemaMovie[] }> = ({ movies }) => (
<Row>
{movies.map(movie => (
<Col key={movie.id}>
<Col key={movie.id} xs={12} sm={6} xl={4}>
<Movie movie={movie} />
</Col>
))}
Expand Down Expand Up @@ -92,7 +89,7 @@ const Index: React.FC = () => {
return (
<PageContainer>
<div className='text-center mb-3'>
<h1>All Moives</h1>
<h1>All movies</h1>
<p>
Visit backend swagger: <a href='/swagger'>here</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MovieCreate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Index: React.FC = () => {
reviews: 'reviews',
show_time: '2016-01-02T15:04:05Z',
synopsis: 'synopsis',
trailer_picture: 'https://placehold.co/600x400',
trailer_picture: 'https://placehold.co/400x592',
trailer_video:
'https://www.youtube.com/embed/NpEaa2P7qZI?si=Ev2ybUCHzVxQPIO1&amp;controls=0'
}),
Expand Down

0 comments on commit e7b93a3

Please sign in to comment.