mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
UI Plugin API (#4256)
* Add page registration * Add example plugin * First version of proper react plugins * Make reference react plugin * Add patching functions * Add tools link poc * NavItem poc * Add loading hook for lazily loaded components * Add documentation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { IconDefinition, SizeProp } from "@fortawesome/fontawesome-svg-core";
|
||||
import { PatchComponent } from "src/pluginApi";
|
||||
|
||||
interface IIcon {
|
||||
icon: IconDefinition;
|
||||
@@ -9,11 +10,14 @@ interface IIcon {
|
||||
size?: SizeProp;
|
||||
}
|
||||
|
||||
export const Icon: React.FC<IIcon> = ({ icon, className, color, size }) => (
|
||||
<FontAwesomeIcon
|
||||
icon={icon}
|
||||
className={`fa-icon ${className ?? ""}`}
|
||||
color={color}
|
||||
size={size}
|
||||
/>
|
||||
export const Icon: React.FC<IIcon> = PatchComponent(
|
||||
"Icon",
|
||||
({ icon, className, color, size }) => (
|
||||
<FontAwesomeIcon
|
||||
icon={icon}
|
||||
className={`fa-icon ${className ?? ""}`}
|
||||
color={color}
|
||||
size={size}
|
||||
/>
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user