mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
31 lines
860 B
TypeScript
31 lines
860 B
TypeScript
import React from "react";
|
|
import { Link } from "react-router-dom";
|
|
import * as GQL from "src/core/generated-graphql";
|
|
|
|
export class SceneHelpers {
|
|
public static maybeRenderStudio(
|
|
scene: GQL.SceneDataFragment | GQL.SlimSceneDataFragment,
|
|
height: number
|
|
) {
|
|
if (!scene.studio) return;
|
|
const style: React.CSSProperties = {
|
|
backgroundImage: `url('${scene.studio.image_path}')`,
|
|
width: "100%",
|
|
height: `${height}px`,
|
|
lineHeight: 5,
|
|
backgroundSize: "contain",
|
|
display: "inline-block",
|
|
backgroundPosition: "center",
|
|
backgroundRepeat: "no-repeat"
|
|
};
|
|
return <Link to={`/studios/${scene.studio.id}`} style={style} />;
|
|
}
|
|
|
|
public static getJWPlayerId(): string {
|
|
return "main-jwplayer";
|
|
}
|
|
public static getPlayer(): any {
|
|
return (window as any).jwplayer("main-jwplayer");
|
|
}
|
|
}
|