Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gallery icon in "scene card" and "scene list table" #799

Merged
merged 5 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion ui/v2.5/src/components/Scenes/SceneCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,28 @@ export const SceneCard: React.FC<ISceneCardProps> = (
}
}

function maybeRenderGallery() {
if (props.scene.gallery) {
return (
<div>
<Link to={`/galleries/${props.scene.gallery.id}`}>
<Button className="minimal">
<Icon icon="image" />
</Button>
</Link>
</div>
);
}
}

function maybeRenderPopoverButtonGroup() {
if (
props.scene.tags.length > 0 ||
props.scene.performers.length > 0 ||
props.scene.movies.length > 0 ||
props.scene.scene_markers.length > 0 ||
props.scene?.o_counter
props.scene?.o_counter ||
props.scene.gallery
) {
return (
<>
Expand All @@ -258,6 +273,7 @@ export const SceneCard: React.FC<ISceneCardProps> = (
{maybeRenderMoviePopoverButton()}
{maybeRenderSceneMarkerPopoverButton()}
{maybeRenderOCounter()}
{maybeRenderGallery()}
</ButtonGroup>
</>
);
Expand Down
14 changes: 13 additions & 1 deletion ui/v2.5/src/components/Scenes/SceneListTable.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// @ts-nocheck
/* eslint-disable jsx-a11y/control-has-associated-label */
import React from "react";
import { Table } from "react-bootstrap";
import { Table, Button } from "react-bootstrap";
import { Link } from "react-router-dom";
import * as GQL from "src/core/generated-graphql";
import { NavUtils, TextUtils } from "src/utils";
import { Icon } from "src/components/Shared";

interface ISceneListTableProps {
scenes: GQL.SlimSceneDataFragment[];
Expand Down Expand Up @@ -68,6 +70,15 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
)}
</td>
<td>{renderMovies(scene)}</td>
<td>
{scene.gallery && (
<Button className="minimal">
<Link to={`/galleries/${scene.gallery.id}`}>
<Icon icon="image" />
</Link>
</Button>
)}
</td>
</tr>
);

Expand All @@ -84,6 +95,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
<th>Performers</th>
<th>Studio</th>
<th>Movies</th>
<th>Gallery</th>
</tr>
</thead>
<tbody>{props.scenes.map(renderSceneRow)}</tbody>
Expand Down