diff options
Diffstat (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/components/side-icon.jsx')
| -rwxr-xr-x | users/ryan/modules/simple-bar/simple-bar-source/lib/components/side-icon.jsx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/components/side-icon.jsx b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/side-icon.jsx new file mode 100755 index 0000000..893241d --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/side-icon.jsx | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | import * as Uebersicht from "uebersicht"; | ||
| 2 | import * as Icons from "./icons/icons.jsx"; | ||
| 3 | import { SuspenseIcon } from "./icons/icon.jsx"; | ||
| 4 | import { useSimpleBarContext } from "./simple-bar-context.jsx"; | ||
| 5 | |||
| 6 | const { React } = Uebersicht; | ||
| 7 | |||
| 8 | export { sideIconStyles as styles } from "../../lib/styles/components/side-icon"; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * Component to render the side icon based on the settings. | ||
| 12 | * | ||
| 13 | * @returns {JSX.Element|null} The side icon component or null if sideDecoration is disabled. | ||
| 14 | */ | ||
| 15 | export function Component() { | ||
| 16 | // Using context to get settings | ||
| 17 | const { settings } = useSimpleBarContext(); | ||
| 18 | // Destructuring sideDecoration from global settings | ||
| 19 | const { sideDecoration } = settings.global; | ||
| 20 | |||
| 21 | // If sideDecoration is disabled, return null | ||
| 22 | if (!sideDecoration) return null; | ||
| 23 | |||
| 24 | // Render the side icon component | ||
| 25 | return ( | ||
| 26 | <div className="side-icon"> | ||
| 27 | <SuspenseIcon> | ||
| 28 | <Icons.Apple className="side-icon__svg" /> | ||
| 29 | </SuspenseIcon> | ||
| 30 | </div> | ||
| 31 | ); | ||
| 32 | } | ||
