mirror of
https://github.com/stashapp/stash.git
synced 2026-01-03 06:03:17 +01:00
Parent studio link in studio page (#835)
This commit is contained in:
parent
c3a7d30a33
commit
d55177c170
2 changed files with 25 additions and 12 deletions
|
|
@ -3,6 +3,7 @@
|
|||
* Add selective scene export.
|
||||
|
||||
### 🎨 Improvements
|
||||
* Add link to parent studio in studio page.
|
||||
* Add missing scenes movie filter.
|
||||
* Add gallery icon to scene cards.
|
||||
* Add country query link to performer flag.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Table, Tabs, Tab } from "react-bootstrap";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useParams, useHistory } from "react-router-dom";
|
||||
import { useParams, useHistory, Link } from "react-router-dom";
|
||||
import cx from "classnames";
|
||||
|
||||
import * as GQL from "src/core/generated-graphql";
|
||||
|
|
@ -203,6 +203,28 @@ export const Studio: React.FC = () => {
|
|||
}
|
||||
};
|
||||
|
||||
function renderStudio() {
|
||||
if (isEditing || !parentStudioId) {
|
||||
return (
|
||||
<StudioSelect
|
||||
onSelect={(items) =>
|
||||
setParentStudioId(items.length > 0 ? items[0]?.id : undefined)
|
||||
}
|
||||
ids={parentStudioId ? [parentStudioId] : []}
|
||||
isDisabled={!isEditing}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (studio.parent_studio) {
|
||||
return (
|
||||
<Link to={`/studios/${studio.parent_studio.id}`}>
|
||||
{studio.parent_studio.name}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="row">
|
||||
<div
|
||||
|
|
@ -237,17 +259,7 @@ export const Studio: React.FC = () => {
|
|||
})}
|
||||
<tr>
|
||||
<td>Parent Studio</td>
|
||||
<td>
|
||||
<StudioSelect
|
||||
onSelect={(items) =>
|
||||
setParentStudioId(
|
||||
items.length > 0 ? items[0]?.id : undefined
|
||||
)
|
||||
}
|
||||
ids={parentStudioId ? [parentStudioId] : []}
|
||||
isDisabled={!isEditing}
|
||||
/>
|
||||
</td>
|
||||
<td>{renderStudio()}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</Table>
|
||||
|
|
|
|||
Loading…
Reference in a new issue