Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PerformerSelect as loadable component #5528

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/plugin/examples/react-component/src/testReact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,16 @@ interface IPluginApi {
});

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 {
SceneCard,
LoadingIndicator,
PerformerSelect,
} = PluginApi.components;

// read a random scene and show a scene card for it
Expand All @@ -172,6 +177,9 @@ interface IPluginApi {
<div>
<div>This is a test page.</div>
{!!scene && <SceneCard scene={data.findScenes.scenes[0]} />}
<div>
<PerformerSelect isMulti onSelect={() => {}} values={[]} />
</div>
</div>
);
};
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/pluginApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const PluginApi = {
loadableComponents: {
// add components as needed for plugins that provide pages
SceneCard: () => import("./components/Scenes/SceneCard"),
PerformerSelect: () => import("./components/Performers/PerformerSelect"),
},
components,
utils: {
Expand Down
Loading