Skip to content

Commit

Permalink
Fix generated icons
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvuerings committed Sep 21, 2021
1 parent f68b8b7 commit 71faa1d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/pages/icon.js
Expand Up @@ -65,7 +65,7 @@ export default function IconPage({ generatedDocGen }: {| generatedDocGen: DocGen
defaultCode={`
<Flex gap={2}>
<Icon icon="sound" accessibilityLabel="" color="darkGray" />
<Text size="ls" weight="bold">24 monthly views</Text>
<Text size="lg" weight="bold">24 monthly views</Text>
</Flex>`}
/>
<MainSection.Card
Expand Down Expand Up @@ -197,7 +197,14 @@ Use Button to allow users to take an action.
}

export async function getStaticProps(): Promise<{| props: {| generatedDocGen: DocGen |} |}> {
const generatedDocGen = await docgen('Icon');
if (generatedDocGen?.props?.icon?.flowType) {
generatedDocGen.props.icon.flowType = {
name: 'union',
raw: (Icon?.icons ?? []).map((icon) => `'${icon}'`).join(' | '),
};
}
return {
props: { generatedDocGen: await docgen('Icon') },
props: { generatedDocGen },
};
}

0 comments on commit 71faa1d

Please sign in to comment.