Skip to content

Commit 7666162

Browse files
authored
Merge pull request #388 from mongodb/LG-4420-avatar-and-chat
LG-4420: Adds `Avatar` component and `Chat` to side nav
2 parents b6b4b8b + 8582726 commit 7666162

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

package-lock.json

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@emotion/css": "^11.11.2",
1414
"@emotion/react": "^11.11.4",
1515
"@faker-js/faker": "^8.4.1",
16+
"@leafygreen-ui/avatar": "^1.0.2",
1617
"@leafygreen-ui/badge": "^8.1.3",
1718
"@leafygreen-ui/banner": "^8.0.1",
1819
"@leafygreen-ui/button": "^21.2.1",

src/components/global/SideNavigation/SideNavigation.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ export function SideNavigation() {
5656
}
5757
/>
5858
<SideNavList key="foundation-list">
59+
<SideNavItem
60+
key="grid"
61+
active={pathname === '/foundations/chat/'}
62+
href={'/foundations/chat'}
63+
>
64+
Chat
65+
</SideNavItem>
5966
<SideNavItem
6067
key="grid"
6168
active={pathname === '/foundations/forms/'}

src/utils/components.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type Group = (typeof Group)[keyof typeof Group];
1414
export { Group };
1515

1616
const Component = {
17+
Avatar: 'avatar',
1718
Badge: 'badge',
1819
Banner: 'banner',
1920
Button: 'button',
@@ -81,6 +82,11 @@ export interface ComponentMeta {
8182
}
8283

8384
export const components: Array<ComponentMeta> = [
85+
{
86+
name: titlecase(Component.Avatar),
87+
navPath: generateComponentNavPath(Component.Avatar),
88+
group: Group.Display,
89+
},
8490
{
8591
name: titlecase(Component.Badge),
8692
navPath: generateComponentNavPath(Component.Badge),

0 commit comments

Comments
 (0)