diff --git a/ui/v2.5/src/components/Galleries/GalleryCard.tsx b/ui/v2.5/src/components/Galleries/GalleryCard.tsx index 423693eff..26b488a86 100644 --- a/ui/v2.5/src/components/Galleries/GalleryCard.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryCard.tsx @@ -79,7 +79,7 @@ export const GalleryCard: React.FC = (props) => { let preferredCardWidth: number; switch (zoomValue) { case 0: - preferredCardWidth = 240; + preferredCardWidth = 280; break; case 1: preferredCardWidth = 340; @@ -95,7 +95,7 @@ export const GalleryCard: React.FC = (props) => { preferredCardWidth! ); setCardWidth(fittedCardWidth); - }, [props, props.containerWidth, props.zoomIndex]); + }, [props.containerWidth, props.zoomIndex]); function maybeRenderScenePopoverButton() { if (props.gallery.scenes.length === 0) return; diff --git a/ui/v2.5/src/components/Groups/GroupCard.tsx b/ui/v2.5/src/components/Groups/GroupCard.tsx index 85fa9ed07..7e61a9a31 100644 --- a/ui/v2.5/src/components/Groups/GroupCard.tsx +++ b/ui/v2.5/src/components/Groups/GroupCard.tsx @@ -41,6 +41,7 @@ interface IProps { sceneNumber?: number; selecting?: boolean; selected?: boolean; + zoomIndex?: number; onSelectedChanged?: (selected: boolean, shiftKey: boolean) => void; fromGroupId?: string; onMove?: (srcIds: string[], targetId: string, after: boolean) => void; @@ -52,6 +53,7 @@ export const GroupCard: React.FC = ({ containerWidth, selecting, selected, + zoomIndex, onSelectedChanged, fromGroupId, onMove, @@ -71,15 +73,30 @@ export const GroupCard: React.FC = ({ }, [fromGroupId, group.containing_groups]); useEffect(() => { - if (!containerWidth || ScreenUtils.isMobile()) return; + if (!containerWidth || zoomIndex === undefined || ScreenUtils.isMobile()) + return; - let preferredCardWidth = 250; + let zoomValue = zoomIndex; + let preferredCardWidth: number; + switch (zoomValue) { + case 0: + preferredCardWidth = 210; + break; + case 1: + preferredCardWidth = 250; + break; + case 2: + preferredCardWidth = 300; + break; + case 3: + preferredCardWidth = 375; + } let fittedCardWidth = calculateCardWidth( containerWidth, preferredCardWidth! ); setCardWidth(fittedCardWidth); - }, [containerWidth]); + }, [containerWidth, zoomIndex]); function maybeRenderScenesPopoverButton() { if (group.scenes.length === 0) return; @@ -150,7 +167,7 @@ export const GroupCard: React.FC = ({ return ( ; + zoomIndex: number; onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; fromGroupId?: string; onMove?: (srcIds: string[], targetId: string, after: boolean) => void; @@ -14,6 +15,7 @@ interface IGroupCardGrid { export const GroupCardGrid: React.FC = ({ groups, selectedIds, + zoomIndex, onSelectChange, fromGroupId, onMove, @@ -26,6 +28,7 @@ export const GroupCardGrid: React.FC = ({ key={p.id} containerWidth={width} group={p} + zoomIndex={zoomIndex} selecting={selectedIds.size > 0} selected={selectedIds.has(p.id)} onSelectedChanged={(selected: boolean, shiftKey: boolean) => diff --git a/ui/v2.5/src/components/Groups/GroupList.tsx b/ui/v2.5/src/components/Groups/GroupList.tsx index d3f395037..707b6fa4b 100644 --- a/ui/v2.5/src/components/Groups/GroupList.tsx +++ b/ui/v2.5/src/components/Groups/GroupList.tsx @@ -184,6 +184,7 @@ export const GroupList: React.FC = ({ {filter.displayMode === DisplayMode.Grid && ( = ({ selectable={selectable} > = ( let preferredCardWidth: number; switch (zoomValue) { case 0: - preferredCardWidth = 240; + preferredCardWidth = 280; break; case 1: preferredCardWidth = 340; @@ -66,7 +66,7 @@ export const ImageCard: React.FC = ( preferredCardWidth! ); setCardWidth(fittedCardWidth); - }, [props, props.containerWidth, props.zoomIndex]); + }, [props.containerWidth, props.zoomIndex]); const file = useMemo( () => diff --git a/ui/v2.5/src/components/Performers/PerformerCard.tsx b/ui/v2.5/src/components/Performers/PerformerCard.tsx index d6ab20440..a5579d73e 100644 --- a/ui/v2.5/src/components/Performers/PerformerCard.tsx +++ b/ui/v2.5/src/components/Performers/PerformerCard.tsx @@ -38,6 +38,7 @@ interface IPerformerCardProps { ageFromDate?: string; selecting?: boolean; selected?: boolean; + zoomIndex?: number; onSelectedChanged?: (selected: boolean, shiftKey: boolean) => void; extraCriteria?: IPerformerCardExtraCriteria; } @@ -48,6 +49,7 @@ export const PerformerCard: React.FC = ({ ageFromDate, selecting, selected, + zoomIndex, onSelectedChanged, extraCriteria, }) => { @@ -72,15 +74,30 @@ export const PerformerCard: React.FC = ({ const [cardWidth, setCardWidth] = useState(); useEffect(() => { - if (!containerWidth || ScreenUtils.isMobile()) return; + if (!containerWidth || zoomIndex === undefined || ScreenUtils.isMobile()) + return; - let preferredCardWidth = 300; + let zoomValue = zoomIndex; + let preferredCardWidth: number; + switch (zoomValue) { + case 0: + preferredCardWidth = 240; + break; + case 1: + preferredCardWidth = 300; + break; + case 2: + preferredCardWidth = 375; + break; + case 3: + preferredCardWidth = 470; + } let fittedCardWidth = calculateCardWidth( containerWidth, preferredCardWidth! ); setCardWidth(fittedCardWidth); - }, [containerWidth]); + }, [containerWidth, zoomIndex]); function onToggleFavorite(v: boolean) { if (performer.id) { @@ -246,7 +263,7 @@ export const PerformerCard: React.FC = ({ return ( = ({ performers, selectedIds, + zoomIndex, onSelectChange, extraCriteria, }) => { @@ -25,6 +26,7 @@ export const PerformerCardGrid: React.FC = ({ key={p.id} containerWidth={width} performer={p} + zoomIndex={zoomIndex} selecting={selectedIds.size > 0} selected={selectedIds.has(p.id)} onSelectedChanged={(selected: boolean, shiftKey: boolean) => diff --git a/ui/v2.5/src/components/Performers/PerformerList.tsx b/ui/v2.5/src/components/Performers/PerformerList.tsx index 68733d3b8..d11de6d96 100644 --- a/ui/v2.5/src/components/Performers/PerformerList.tsx +++ b/ui/v2.5/src/components/Performers/PerformerList.tsx @@ -329,6 +329,7 @@ export const PerformerList: React.FC = ({ selectable > void; } @@ -78,21 +79,38 @@ export const StudioCard: React.FC = ({ hideParent, selecting, selected, + zoomIndex, onSelectedChanged, }) => { const [updateStudio] = useStudioUpdate(); const [cardWidth, setCardWidth] = useState(); useEffect(() => { - if (!containerWidth || ScreenUtils.isMobile()) return; + if (!containerWidth || zoomIndex === undefined || ScreenUtils.isMobile()) + return; - let preferredCardWidth = 340; + let zoomValue = zoomIndex; + console.log(zoomValue); + let preferredCardWidth: number; + switch (zoomValue) { + case 0: + preferredCardWidth = 280; + break; + case 1: + preferredCardWidth = 340; + break; + case 2: + preferredCardWidth = 420; + break; + case 3: + preferredCardWidth = 560; + } let fittedCardWidth = calculateCardWidth( containerWidth, preferredCardWidth! ); setCardWidth(fittedCardWidth); - }, [containerWidth]); + }, [containerWidth, zoomIndex]); function onToggleFavorite(v: boolean) { if (studio.id) { @@ -216,7 +234,7 @@ export const StudioCard: React.FC = ({ return ( ; + zoomIndex: number; onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; } @@ -14,6 +15,7 @@ export const StudioCardGrid: React.FC = ({ studios, fromParent, selectedIds, + zoomIndex, onSelectChange, }) => { const [componentRef, { width }] = useContainerDimensions(); @@ -24,6 +26,7 @@ export const StudioCardGrid: React.FC = ({ key={studio.id} containerWidth={width} studio={studio} + zoomIndex={zoomIndex} hideParent={fromParent} selecting={selectedIds.size > 0} selected={selectedIds.has(studio.id)} diff --git a/ui/v2.5/src/components/Studios/StudioList.tsx b/ui/v2.5/src/components/Studios/StudioList.tsx index ecdbadd85..dd67f560b 100644 --- a/ui/v2.5/src/components/Studios/StudioList.tsx +++ b/ui/v2.5/src/components/Studios/StudioList.tsx @@ -135,6 +135,7 @@ export const StudioList: React.FC = ({ return ( = ({ selectable > = ({ let preferredCardWidth: number; switch (zoomValue) { case 0: - preferredCardWidth = 240; + preferredCardWidth = 280; break; case 1: preferredCardWidth = 340;