Fix tagger result styling (#4222)

* Fix tagger result styling
* Fix DEFAULT_SLIDESHOW_DELAY
This commit is contained in:
DingDongSoLong4
2023-10-18 04:14:11 +02:00
committed by GitHub
parent 939bb422d1
commit 06d8353f4f
4 changed files with 51 additions and 52 deletions

View File

@@ -208,10 +208,7 @@
.performer-disambiguation { .performer-disambiguation {
color: $text-muted; color: $text-muted;
/* stylelint-disable */
font-size: 0.875em; font-size: 0.875em;
/* stylelint-enable */
padding-right: 0.5rem;
} }
.performer-result .performer-details > span { .performer-result .performer-details > span {

View File

@@ -15,16 +15,14 @@ import { getStashboxBase } from "src/utils/stashbox";
interface IPerformerName { interface IPerformerName {
performer: GQL.ScrapedPerformer | Performer; performer: GQL.ScrapedPerformer | Performer;
className?: string;
baseURL: string | undefined;
id: string | undefined | null; id: string | undefined | null;
baseURL: string | undefined;
} }
const PerformerName: React.FC<IPerformerName> = ({ const PerformerName: React.FC<IPerformerName> = ({
performer, performer,
className,
baseURL,
id, id,
baseURL,
}) => { }) => {
const name = const name =
baseURL && id ? ( baseURL && id ? (
@@ -36,14 +34,14 @@ const PerformerName: React.FC<IPerformerName> = ({
); );
return ( return (
<span className={className}> <>
<span>{name}</span> <span>{name}</span>
{performer.disambiguation && ( {performer.disambiguation && (
<span className="performer-disambiguation"> <span className="performer-disambiguation">
{` (${performer.disambiguation})`} {` (${performer.disambiguation})`}
</span> </span>
)} )}
</span> </>
); );
}; };
@@ -117,12 +115,13 @@ const PerformerResult: React.FC<IPerformerResultProps> = ({
<div className="row no-gutters my-2"> <div className="row no-gutters my-2">
<div className="entity-name"> <div className="entity-name">
<FormattedMessage id="countables.performers" values={{ count: 1 }} />: <FormattedMessage id="countables.performers" values={{ count: 1 }} />:
<b className="ml-2">
<PerformerName <PerformerName
performer={performer} performer={performer}
className="ml-2"
id={performer.remote_site_id} id={performer.remote_site_id}
baseURL={stashboxPerformerPrefix} baseURL={stashboxPerformerPrefix}
/> />
</b>
</div> </div>
<span className="ml-auto"> <span className="ml-auto">
<OptionalField <OptionalField
@@ -135,12 +134,13 @@ const PerformerResult: React.FC<IPerformerResultProps> = ({
<span className="mr-2"> <span className="mr-2">
<FormattedMessage id="component_tagger.verb_matched" />: <FormattedMessage id="component_tagger.verb_matched" />:
</span> </span>
<b className="col-3 text-right">
<PerformerName <PerformerName
performer={matchedPerformer} performer={matchedPerformer}
className="ml-3 text-right"
id={matchedPerformer.id} id={matchedPerformer.id}
baseURL={performerURLPrefix} baseURL={performerURLPrefix}
/> />
</b>
</div> </div>
</OptionalField> </OptionalField>
</span> </span>
@@ -169,12 +169,13 @@ const PerformerResult: React.FC<IPerformerResultProps> = ({
<div className="row no-gutters align-items-center mt-2"> <div className="row no-gutters align-items-center mt-2">
<div className="entity-name"> <div className="entity-name">
<FormattedMessage id="countables.performers" values={{ count: 1 }} />: <FormattedMessage id="countables.performers" values={{ count: 1 }} />:
<b className="ml-2">
<PerformerName <PerformerName
performer={performer} performer={performer}
className="ml-2"
id={performer.remote_site_id} id={performer.remote_site_id}
baseURL={stashboxPerformerPrefix} baseURL={stashboxPerformerPrefix}
/> />
</b>
</div> </div>
<ButtonGroup> <ButtonGroup>
<Button variant="secondary" onClick={() => onCreate()}> <Button variant="secondary" onClick={() => onCreate()}>

View File

@@ -12,6 +12,25 @@ import { OptionalField } from "../IncludeButton";
import { faSave } from "@fortawesome/free-solid-svg-icons"; import { faSave } from "@fortawesome/free-solid-svg-icons";
import { getStashboxBase } from "src/utils/stashbox"; import { getStashboxBase } from "src/utils/stashbox";
interface IStudioName {
studio: GQL.ScrapedStudio | GQL.SlimStudioDataFragment;
id: string | undefined | null;
baseURL: string | undefined;
}
const StudioName: React.FC<IStudioName> = ({ studio, id, baseURL }) => {
const name =
baseURL && id ? (
<a href={`${baseURL}${id}`} target="_blank" rel="noreferrer">
{studio.name}
</a>
) : (
studio.name
);
return <span>{name}</span>;
};
interface IStudioResultProps { interface IStudioResultProps {
studio: GQL.ScrapedStudio; studio: GQL.ScrapedStudio;
selectedID: string | undefined; selectedID: string | undefined;
@@ -58,24 +77,6 @@ const StudioResult: React.FC<IStudioResultProps> = ({
if (stashLoading) return <div>Loading studio</div>; if (stashLoading) return <div>Loading studio</div>;
const StudioName = ({
name,
baseURL,
id,
}: {
name: string;
baseURL: string | undefined;
id: string | undefined | null;
}) => {
return baseURL && id ? (
<a href={`${baseURL}${id}`} target="_blank" rel="noreferrer">
{name}
</a>
) : (
<span>name</span>
);
};
if (matchedStudio && matchedStashID) { if (matchedStudio && matchedStashID) {
return ( return (
<div className="row no-gutters my-2"> <div className="row no-gutters my-2">
@@ -83,9 +84,9 @@ const StudioResult: React.FC<IStudioResultProps> = ({
<FormattedMessage id="countables.studios" values={{ count: 1 }} />: <FormattedMessage id="countables.studios" values={{ count: 1 }} />:
<b className="ml-2"> <b className="ml-2">
<StudioName <StudioName
name={studio.name} studio={studio}
baseURL={stashboxStudioPrefix}
id={studio.remote_site_id} id={studio.remote_site_id}
baseURL={stashboxStudioPrefix}
/> />
</b> </b>
</div> </div>
@@ -102,9 +103,9 @@ const StudioResult: React.FC<IStudioResultProps> = ({
</span> </span>
<b className="col-3 text-right"> <b className="col-3 text-right">
<StudioName <StudioName
name={matchedStudio.name} studio={matchedStudio}
baseURL={studioURLPrefix}
id={matchedStudio.id} id={matchedStudio.id}
baseURL={studioURLPrefix}
/> />
</b> </b>
</div> </div>
@@ -137,9 +138,9 @@ const StudioResult: React.FC<IStudioResultProps> = ({
<FormattedMessage id="countables.studios" values={{ count: 1 }} />: <FormattedMessage id="countables.studios" values={{ count: 1 }} />:
<b className="ml-2"> <b className="ml-2">
<StudioName <StudioName
name={studio.name} studio={studio}
baseURL={stashboxStudioPrefix}
id={studio.remote_site_id} id={studio.remote_site_id}
baseURL={stashboxStudioPrefix}
/> />
</b> </b>
</div> </div>

View File

@@ -70,7 +70,7 @@ const CLASSNAME_NAV = `${CLASSNAME}-nav`;
const CLASSNAME_NAVIMAGE = `${CLASSNAME_NAV}-image`; const CLASSNAME_NAVIMAGE = `${CLASSNAME_NAV}-image`;
const CLASSNAME_NAVSELECTED = `${CLASSNAME_NAV}-selected`; const CLASSNAME_NAVSELECTED = `${CLASSNAME_NAV}-selected`;
const DEFAULT_SLIDESHOW_DELAY = 5; const DEFAULT_SLIDESHOW_DELAY = 5000;
const SECONDS_TO_MS = 1000; const SECONDS_TO_MS = 1000;
const MIN_VALID_INTERVAL_SECONDS = 1; const MIN_VALID_INTERVAL_SECONDS = 1;
const MIN_ZOOM = 0.1; const MIN_ZOOM = 0.1;