mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Add PerformerSelect as loadable component (#5528)
* Add PerformerSelect to loadable components * Add PerformerSelect to example plugin
This commit is contained in:
parent
8c8be22fe4
commit
cacfe5a268
2 changed files with 10 additions and 1 deletions
|
|
@ -145,11 +145,16 @@ interface IPluginApi {
|
||||||
});
|
});
|
||||||
|
|
||||||
const TestPage: React.FC = () => {
|
const TestPage: React.FC = () => {
|
||||||
const componentsLoading = PluginApi.hooks.useLoadComponents([PluginApi.loadableComponents.SceneCard]);
|
const componentsToLoad = [
|
||||||
|
PluginApi.loadableComponents.SceneCard,
|
||||||
|
PluginApi.loadableComponents.PerformerSelect,
|
||||||
|
];
|
||||||
|
const componentsLoading = PluginApi.hooks.useLoadComponents(componentsToLoad);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
SceneCard,
|
SceneCard,
|
||||||
LoadingIndicator,
|
LoadingIndicator,
|
||||||
|
PerformerSelect,
|
||||||
} = PluginApi.components;
|
} = PluginApi.components;
|
||||||
|
|
||||||
// read a random scene and show a scene card for it
|
// read a random scene and show a scene card for it
|
||||||
|
|
@ -172,6 +177,9 @@ interface IPluginApi {
|
||||||
<div>
|
<div>
|
||||||
<div>This is a test page.</div>
|
<div>This is a test page.</div>
|
||||||
{!!scene && <SceneCard scene={data.findScenes.scenes[0]} />}
|
{!!scene && <SceneCard scene={data.findScenes.scenes[0]} />}
|
||||||
|
<div>
|
||||||
|
<PerformerSelect isMulti onSelect={() => {}} values={[]} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ export const PluginApi = {
|
||||||
loadableComponents: {
|
loadableComponents: {
|
||||||
// add components as needed for plugins that provide pages
|
// add components as needed for plugins that provide pages
|
||||||
SceneCard: () => import("./components/Scenes/SceneCard"),
|
SceneCard: () => import("./components/Scenes/SceneCard"),
|
||||||
|
PerformerSelect: () => import("./components/Performers/PerformerSelect"),
|
||||||
},
|
},
|
||||||
components,
|
components,
|
||||||
utils: {
|
utils: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue