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:
WithoutPants
2023-11-28 13:06:44 +11:00
committed by GitHub
parent 11be56cc42
commit b915428f06
17 changed files with 2418 additions and 384 deletions

View File

@@ -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}
/>
)
);