mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add gallery icon in "scene card" and "scene list table" (#799)
This commit is contained in:
@@ -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() {
|
function maybeRenderPopoverButtonGroup() {
|
||||||
if (
|
if (
|
||||||
props.scene.tags.length > 0 ||
|
props.scene.tags.length > 0 ||
|
||||||
props.scene.performers.length > 0 ||
|
props.scene.performers.length > 0 ||
|
||||||
props.scene.movies.length > 0 ||
|
props.scene.movies.length > 0 ||
|
||||||
props.scene.scene_markers.length > 0 ||
|
props.scene.scene_markers.length > 0 ||
|
||||||
props.scene?.o_counter
|
props.scene?.o_counter ||
|
||||||
|
props.scene.gallery
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -258,6 +273,7 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
{maybeRenderMoviePopoverButton()}
|
{maybeRenderMoviePopoverButton()}
|
||||||
{maybeRenderSceneMarkerPopoverButton()}
|
{maybeRenderSceneMarkerPopoverButton()}
|
||||||
{maybeRenderOCounter()}
|
{maybeRenderOCounter()}
|
||||||
|
{maybeRenderGallery()}
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/* eslint-disable jsx-a11y/control-has-associated-label */
|
/* eslint-disable jsx-a11y/control-has-associated-label */
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Table } from "react-bootstrap";
|
import { Table, Button } from "react-bootstrap";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import * as GQL from "src/core/generated-graphql";
|
import * as GQL from "src/core/generated-graphql";
|
||||||
import { NavUtils, TextUtils } from "src/utils";
|
import { NavUtils, TextUtils } from "src/utils";
|
||||||
|
import { Icon } from "src/components/Shared";
|
||||||
|
|
||||||
interface ISceneListTableProps {
|
interface ISceneListTableProps {
|
||||||
scenes: GQL.SlimSceneDataFragment[];
|
scenes: GQL.SlimSceneDataFragment[];
|
||||||
@@ -68,6 +70,15 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
|||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td>{renderMovies(scene)}</td>
|
<td>{renderMovies(scene)}</td>
|
||||||
|
<td>
|
||||||
|
{scene.gallery && (
|
||||||
|
<Button className="minimal">
|
||||||
|
<Link to={`/galleries/${scene.gallery.id}`}>
|
||||||
|
<Icon icon="image" />
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -84,6 +95,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
|||||||
<th>Performers</th>
|
<th>Performers</th>
|
||||||
<th>Studio</th>
|
<th>Studio</th>
|
||||||
<th>Movies</th>
|
<th>Movies</th>
|
||||||
|
<th>Gallery</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>{props.scenes.map(renderSceneRow)}</tbody>
|
<tbody>{props.scenes.map(renderSceneRow)}</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user