Skip to content

Commit

Permalink
core: add logo and github sponsor button
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Aug 16, 2024
1 parent 438ca9b commit 66c92d8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const config: StorybookConfig = {
"@storybook/addon-webpack5-compiler-babel",
"@chromatic-com/storybook",
],
staticDirs: ["../public"],
framework: {
name: "@storybook/react-webpack5",
options: {},
Expand Down
6 changes: 6 additions & 0 deletions .storybook/manager.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[src="mui-treasury-logo.png"] {
height: 32px;
}
.dark [src="mui-treasury-logo.png"] {
filter: invert(1);
}
26 changes: 25 additions & 1 deletion .storybook/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import {
STORY_MISSING,
} from "@storybook/core-events";
import { addons, types } from "@storybook/manager-api";
import { create } from "@storybook/theming";
import CarbonAds from "./carbon-ads/CarbonAds";
import { Tool } from "./decorators/Author";
import { BlockPicker } from "./decorators/BlockPicker";
import { BlockUsage } from "./decorators/BlockUsage";
import "./manager.css";

// https://storybook.js.org/docs/react/configure/features-and-behavior
addons.setConfig({
Expand All @@ -18,7 +20,13 @@ addons.setConfig({
panelPosition: "bottom",
enableShortcuts: true,
showToolbar: true,
theme: undefined,
theme: create({
base: "light",
brandUrl: "https://github.com/siriwatknp/mui-treasury",
brandTitle: "MUI Treasury Github",
brandImage: "mui-treasury-logo.png",
brandTarget: "_blank",
}),
selectedPanel: undefined,
initialActive: "sidebar",
});
Expand Down Expand Up @@ -47,6 +55,22 @@ addons.register("google-analytics", (api) => {
});
});

addons.register("github-sponsor", () => {
addons.add("github-sponsor/toolbar", {
title: "Github Sponsor",
type: types.TOOLEXTRA,
render: () => (
<iframe
src="https://github.com/sponsors/siriwatknp/button"
title="Sponsor siriwatknp"
height="32"
width="108"
style={{ border: 0, borderRadius: 6 }}
></iframe>
),
});
});

addons.register("block-usage", () => {
addons.add("block-usage/toolbar", {
title: "Block Usage",
Expand Down
Binary file added public/mui-treasury-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 66c92d8

Please sign in to comment.