forked from stashapp/stash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from cj12312021/fit-cards-plugin
Fit cards plugin improvements
- Loading branch information
Showing
10 changed files
with
189 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useRef } from "react"; | ||
import * as GQL from "src/core/generated-graphql"; | ||
import { MovieCard } from "./MovieCard"; | ||
import { useContainerDimensions } from "../Shared/GridCard"; | ||
|
||
interface IMovieCardGrid { | ||
movies: GQL.MovieDataFragment[]; | ||
selectedIds: Set<string>; | ||
onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; | ||
} | ||
|
||
export const MovieCardGrid: React.FC<IMovieCardGrid> = ({ | ||
movies, | ||
selectedIds, | ||
onSelectChange, | ||
}) => { | ||
const componentRef = useRef<HTMLDivElement>(null); | ||
const { width } = useContainerDimensions(componentRef); | ||
return ( | ||
<div className="row justify-content-center" ref={componentRef}> | ||
{movies.map((p) => ( | ||
<MovieCard | ||
key={p.id} | ||
containerWidth={width} | ||
movie={p} | ||
selecting={selectedIds.size > 0} | ||
selected={selectedIds.has(p.id)} | ||
onSelectedChanged={(selected: boolean, shiftKey: boolean) => | ||
onSelectChange(p.id, selected, shiftKey) | ||
} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useRef } from "react"; | ||
import * as GQL from "src/core/generated-graphql"; | ||
import { IPerformerCardExtraCriteria, PerformerCard } from "./PerformerCard"; | ||
import { useContainerDimensions } from "../Shared/GridCard"; | ||
|
||
interface IPerformerCardGrid { | ||
performers: GQL.PerformerDataFragment[]; | ||
selectedIds: Set<string>; | ||
zoomIndex: number; | ||
onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; | ||
extraCriteria?: IPerformerCardExtraCriteria; | ||
} | ||
|
||
export const PerformerCardGrid: React.FC<IPerformerCardGrid> = ({ | ||
performers, | ||
selectedIds, | ||
onSelectChange, | ||
extraCriteria, | ||
}) => { | ||
const componentRef = useRef<HTMLDivElement>(null); | ||
const { width } = useContainerDimensions(componentRef); | ||
return ( | ||
<div className="row justify-content-center" ref={componentRef}> | ||
{performers.map((p) => ( | ||
<PerformerCard | ||
key={p.id} | ||
containerWidth={width} | ||
performer={p} | ||
selecting={selectedIds.size > 0} | ||
selected={selectedIds.has(p.id)} | ||
onSelectedChanged={(selected: boolean, shiftKey: boolean) => | ||
onSelectChange(p.id, selected, shiftKey) | ||
} | ||
extraCriteria={extraCriteria} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useRef } from "react"; | ||
import * as GQL from "src/core/generated-graphql"; | ||
import { useContainerDimensions } from "../Shared/GridCard"; | ||
import { StudioCard } from "./StudioCard"; | ||
|
||
interface IStudioCardGrid { | ||
studios: GQL.StudioDataFragment[]; | ||
fromParent: boolean | undefined; | ||
selectedIds: Set<string>; | ||
onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; | ||
} | ||
|
||
export const StudioCardGrid: React.FC<IStudioCardGrid> = ({ | ||
studios, | ||
fromParent, | ||
selectedIds, | ||
onSelectChange, | ||
}) => { | ||
const componentRef = useRef<HTMLDivElement>(null); | ||
const { width } = useContainerDimensions(componentRef); | ||
return ( | ||
<div className="row justify-content-center" ref={componentRef}> | ||
{studios.map((studio) => ( | ||
<StudioCard | ||
key={studio.id} | ||
containerWidth={width} | ||
studio={studio} | ||
hideParent={fromParent} | ||
selecting={selectedIds.size > 0} | ||
selected={selectedIds.has(studio.id)} | ||
onSelectedChanged={(selected: boolean, shiftKey: boolean) => | ||
onSelectChange(studio.id, selected, shiftKey) | ||
} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useRef } from "react"; | ||
import * as GQL from "src/core/generated-graphql"; | ||
import { useContainerDimensions } from "../Shared/GridCard"; | ||
import { TagCard } from "./TagCard"; | ||
|
||
interface ITagCardGrid { | ||
tags: GQL.TagDataFragment[]; | ||
selectedIds: Set<string>; | ||
zoomIndex: number; | ||
onSelectChange: (id: string, selected: boolean, shiftKey: boolean) => void; | ||
} | ||
|
||
export const TagCardGrid: React.FC<ITagCardGrid> = ({ | ||
tags, | ||
selectedIds, | ||
zoomIndex, | ||
onSelectChange, | ||
}) => { | ||
const componentRef = useRef<HTMLDivElement>(null); | ||
const { width } = useContainerDimensions(componentRef); | ||
return ( | ||
<div className="row justify-content-center" ref={componentRef}> | ||
{tags.map((tag) => ( | ||
<TagCard | ||
key={tag.id} | ||
containerWidth={width} | ||
tag={tag} | ||
zoomIndex={zoomIndex} | ||
selecting={selectedIds.size > 0} | ||
selected={selectedIds.has(tag.id)} | ||
onSelectedChanged={(selected: boolean, shiftKey: boolean) => | ||
onSelectChange(tag.id, selected, shiftKey) | ||
} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.