Skip to content

Commit

Permalink
Display Scene/Studio link if available (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashy78 committed Feb 26, 2024
1 parent 2ab8da6 commit 54bd1d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions frontend/src/pages/scenes/Scene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,13 @@ const SceneComponent: FC<Props> = ({ scene }) => {
<>
<hr />
<div>
<b className="me-2">Studio URL:</b>
<a href={studioURL} target="_blank" rel="noopener noreferrer">
{studioURL}
<b className="me-2">{studioURL.site.name}:</b>
<a
href={studioURL.url}
target="_blank"
rel="noopener noreferrer"
>
{studioURL.url}
</a>
</div>
</>
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/pages/studios/Studio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ const StudioComponent: FC<Props> = ({ studio }) => {
</h3>
{homeURL && (
<h6>
<a href={homeURL} target="_blank" rel="noreferrer noopener">
{homeURL}
{homeURL.site.name !== "Home" && (
<b className="me-2">{homeURL.site.name}:</b>
)}
<a href={homeURL.url} target="_blank" rel="noreferrer noopener">
{homeURL.url}
</a>
</h6>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const imageType = (image?: ImageFragment) => {
};

export const getUrlBySite = (urls: UrlFragment[], name: string) =>
(urls && (urls.find((url) => url.site.name === name) || {}).url) || "";
urls.find((url) => url.site.name === name) ?? urls[0];

export const formatBodyModification = (
bodyMod?: { location: string; description?: string | null } | null
Expand Down

0 comments on commit 54bd1d8

Please sign in to comment.