File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
apps/frontend/src/app/(preview)/p/[id]
libraries/react-shared-libraries/src/helpers Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -146,9 +146,9 @@ export default async function Auth({
146146 { JSON . parse ( p ?. image || '[]' ) . map ( ( p : any ) => (
147147 < div
148148 key = { p . name }
149- className = "flex-1 rounded-[10px] overflow-hidden"
149+ className = "flex-1 rounded-[10px] max-h-[500px] overflow-hidden"
150150 >
151- < VideoOrImage src = { p . path } autoplay = { true } />
151+ < VideoOrImage isContain = { true } src = { p . path } autoplay = { true } />
152152 </ div >
153153 ) ) }
154154 </ div >
Original file line number Diff line number Diff line change 11import { FC } from 'react' ;
2+ import { clsx } from 'clsx' ;
23
3- export const VideoOrImage : FC < { src : string ; autoplay : boolean } > = ( props ) => {
4- const { src, autoplay } = props ;
4+ export const VideoOrImage : FC < {
5+ src : string ;
6+ autoplay : boolean ;
7+ isContain ?: boolean ;
8+ } > = ( props ) => {
9+ const { src, autoplay, isContain } = props ;
510 if ( src . indexOf ( 'mp4' ) > - 1 ) {
6- return < video src = { src } autoPlay = { autoplay } className = "w-full h-full" muted = { true } loop = { true } /> ;
11+ return (
12+ < video
13+ src = { src }
14+ autoPlay = { autoplay }
15+ className = "w-full h-full"
16+ muted = { true }
17+ loop = { true }
18+ />
19+ ) ;
720 }
821
922 return (
1023 < img
11- className = "w-full h-full object-cover"
24+ className = { clsx (
25+ isContain ? 'object-contain' : 'object-cover' ,
26+ 'w-full h-full object-cover'
27+ ) }
1228 src = { src }
1329 />
1430 ) ;
You can’t perform that action at this time.
0 commit comments