Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/kind-goats-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@lg-chat/rich-links': patch
'@lg-chat/message': patch
---

[LG-5684](https://jira.mongodb.org/browse/LG-5684): update colors used for `RichLinkBadge` component which is used in `Message.Links`
15 changes: 15 additions & 0 deletions chat/rich-links/src/RichLink/RichLink.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import React from 'react';
import { storybookArgTypes } from '@lg-tools/storybook-utils';
import { StoryFn } from '@storybook/react';

import LeafyGreenProvider from '@leafygreen-ui/leafygreen-provider';

import { RichLink } from '.';

export default {
title: 'Composition/Chat/RichLink',
component: RichLink,
argTypes: {
darkMode: storybookArgTypes.darkMode,
},
decorators: [
(Story: StoryFn, context) => {
return (
<LeafyGreenProvider darkMode={context?.args.darkMode}>
<Story />
</LeafyGreenProvider>
);
},
],
};

const Template: StoryFn<typeof RichLink> = props => (
Expand Down
42 changes: 22 additions & 20 deletions chat/rich-links/src/RichLink/RichLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React, { forwardRef } from 'react';

import { Card } from '@leafygreen-ui/card';
import { cx } from '@leafygreen-ui/emotion';
import { useDarkMode } from '@leafygreen-ui/leafygreen-provider';
import LeafyGreenProvider, {
useDarkMode,
} from '@leafygreen-ui/leafygreen-provider';
import { PolymorphicAs } from '@leafygreen-ui/polymorphic';
import { Body } from '@leafygreen-ui/typography';

Expand Down Expand Up @@ -52,25 +54,25 @@ export const RichLink = forwardRef<HTMLAnchorElement, RichLinkProps>(
: {};

return (
<Card
darkMode={darkMode}
className={cx(baseStyles, themeStyles[theme])}
title={children}
{...conditionalProps}
onClick={() => onLinkClick?.(props)}
>
<Body as="span" className={richLinkTextClassName} darkMode={darkMode}>
{children}
</Body>
{showBadge ? (
<RichLinkBadge
darkMode={darkMode}
color={badgeColor}
label={badgeLabel}
glyph={badgeGlyph}
/>
) : null}
</Card>
<LeafyGreenProvider darkMode={darkMode}>
<Card
className={cx(baseStyles, themeStyles[theme])}
title={children}
{...conditionalProps}
onClick={() => onLinkClick?.(props)}
>
<Body as="span" className={richLinkTextClassName}>
{children}
</Body>
{showBadge ? (
<RichLinkBadge
color={badgeColor}
label={badgeLabel}
glyph={badgeGlyph}
/>
) : null}
</Card>
</LeafyGreenProvider>
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export const badgeVariants: Record<
> = {
[Theme.Dark]: {
[RichLinkBadgeColors.Gray]: css`
background-color: ${palette.gray.dark1};
background-color: ${palette.gray.dark2};
& svg {
color: ${palette.gray.light3};
color: ${palette.gray.light1};
}
& p {
color: ${palette.gray.light3};
color: ${palette.gray.light2};
}
`,
[RichLinkBadgeColors.Blue]: css`
Expand Down Expand Up @@ -92,7 +92,7 @@ export const badgeVariants: Record<
color: ${palette.blue.dark2};
}
& p {
color: ${palette.blue.dark1};
color: ${palette.blue.dark3};
}
`,
[RichLinkBadgeColors.Green]: css`
Expand Down
Loading