Skip to content

Commit

Permalink
feat: display internal message banners (#5079)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-1511/adapt-internalmessagebanners-to-use-the-new-hooks-and-display-the

Adapts the `InternalMessageBanners` component to use the new hook and
display the internal message banners.
  • Loading branch information
nunogois authored Oct 18, 2023
1 parent 5456d1d commit 4a49cd5
Showing 1 changed file with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
import { MessageBanner } from 'component/messageBanners/MessageBanner/MessageBanner';
import { useUiFlag } from 'hooks/useUiFlag';
import { useMessageBanners } from 'hooks/api/getters/useMessageBanners/useMessageBanners';

export const InternalMessageBanners = () => {
const internalMessageBanners = useUiFlag('internalMessageBanners');

if (!internalMessageBanners) return null;

// TODO: Implement. `messageBanners` should come from a `useMessageBanners()` hook.

const mockMessageBanners = [
{
message: 'Test 1',
},
{
message: 'Test 2',
},
{
message: 'Test 3',
},
];
const { messageBanners } = useMessageBanners();

return (
<>
{mockMessageBanners.map((messageBanner) => (
{messageBanners.map((messageBanner) => (
<MessageBanner
key={messageBanner.message}
key={messageBanner.id}
messageBanner={messageBanner}
/>
))}
Expand Down

0 comments on commit 4a49cd5

Please sign in to comment.