Skip to content

Commit

Permalink
refactor: update dependency and make environment not mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
massao committed Sep 9, 2024
1 parent 7c95de9 commit dbee7ba
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 10 deletions.
57 changes: 55 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/navbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@contentful/f36-skeleton": "^4.68.1",
"@contentful/f36-tokens": "^4.0.1",
"@contentful/f36-tooltip": "^4.68.1",
"@contentful/f36-typography": "5.0.0-alpha.1",
"@contentful/f36-typography": "^4.68.1",
"@contentful/f36-utils": "^4.23.2",
"emotion": "^10.0.17"
},
Expand Down
18 changes: 11 additions & 7 deletions packages/components/navbar/src/NavbarSwitcher/NavbarSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,17 @@ function _NavbarSwitcher(
) : (
<>
<SwitcherLabel type="space" value={space} styles={styles} />
<CaretRightIcon size="tiny" color={tokens.gray500} />
<SwitcherLabel
envVariant={envVariant}
type="environment"
value={environment}
styles={styles}
/>
{environment && (
<>
<CaretRightIcon size="tiny" color={tokens.gray500} />
<SwitcherLabel
envVariant={envVariant}
type="environment"
value={environment}
styles={styles}
/>
</>
)}
</>
)}
</Flex>
Expand Down
21 changes: 21 additions & 0 deletions packages/components/navbar/stories/Navbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ Basic.args = {
'https://images.ctfassets.net/iq4lnigp6fgt/2EEEk92Kiz6KxREsjBLPAN/810d5a21650d91abad12e95da4cd3beb/2021-06_Everyone_is_Welcome_here_1_.png?fit=fill&f=top_left&w=100&h=100',
};

export const BasicNoEnvironment: Story<{
initials?: string;
avatar?: string;
}> = (args) => {
return (
<div style={{ minWidth: '900px' }}>
<Navbar
mainNavigation={<MainItems />}
switcher={<Navbar.Switcher space="Our super long space name" />}
account={<Account {...args} />}
/>
</div>
);
};

BasicNoEnvironment.args = {
initials: 'AB',
avatar:
'https://images.ctfassets.net/iq4lnigp6fgt/2EEEk92Kiz6KxREsjBLPAN/810d5a21650d91abad12e95da4cd3beb/2021-06_Everyone_is_Welcome_here_1_.png?fit=fill&f=top_left&w=100&h=100',
};

export const SizeVariants: Story<NavbarProps> = () => {
return (
<Flex gap="spacingL" style={{ width: '97vw' }} flexDirection="column">
Expand Down

0 comments on commit dbee7ba

Please sign in to comment.