Skip to content

Commit

Permalink
fix storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
dovalid committed Jul 11, 2024
1 parent 74e865b commit 5c0c5c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StorybookConfig } from "@storybook/nextjs"
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
Expand All @@ -14,11 +14,11 @@ const config: StorybookConfig = {
name: "@storybook/nextjs",
options: {},
},
staticDirs: ["../public", "../static"],
staticDirs: ["../public"],
refs: {
"@chakra-ui/react": {
disable: true,
},
},
}
export default config
};
export default config;
7 changes: 6 additions & 1 deletion src/v2/components/GuildAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ interface Props extends React.HTMLAttributes<HTMLDivElement> {
}

const GuildAvatar = memo(({ address, className }: Props) => {
const addressEnding = address
?.toLowerCase()
?.slice(-2) as keyof typeof addressAvatarPairs

const Avatar = dynamic(
() =>
// webpack can't resolve the dynamic import path when running storybook, so we just pass the first svg manually there
import(
`static/avatars/${addressAvatarPairs[address?.toLowerCase()?.slice(-2)]}.svg`
`static/avatars/${process.env.STORYBOOK ? 1 : addressAvatarPairs[addressEnding]}.svg`
)
)

Expand Down

0 comments on commit 5c0c5c0

Please sign in to comment.