feat(ui-toolkit): announcement banner to highlight mainnet sims (#2800)

This commit is contained in:
Sam Keen 2023-01-31 16:12:44 +00:00 committed by GitHub
parent b40358a723
commit 8f8e9c1061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -0,0 +1,9 @@
import { render } from '@testing-library/react';
import { AnnouncementBanner } from './announcement-banner';
describe('Banner', () => {
it('should render successfully', () => {
const { baseElement } = render(<AnnouncementBanner>Hi</AnnouncementBanner>);
expect(baseElement).toBeTruthy();
});
});

View File

@ -0,0 +1,18 @@
import type { Story, ComponentMeta } from '@storybook/react';
import { AnnouncementBanner } from './announcement-banner';
export default {
component: AnnouncementBanner,
title: 'Announcement Banner',
} as ComponentMeta<typeof AnnouncementBanner>;
const Template: Story = (args) => (
<div className="mb-8">
<AnnouncementBanner {...args} />
</div>
);
export const Default = Template.bind({});
Default.args = {
children: <div className="text-center">Banner text</div>,
};

View File

@ -0,0 +1,15 @@
import classnames from 'classnames';
import type { ReactNode } from 'react';
export interface BannerProps {
children?: ReactNode;
}
export const AnnouncementBanner = ({ children }: BannerProps) => {
const bannerClasses = classnames(
"bg-[url('https://static.vega.xyz/assets/img/banner-bg.jpg')] bg-cover bg-center bg-no-repeat",
'p-4'
);
return <div className={bannerClasses}>{children}</div>;
};

View File

@ -0,0 +1 @@
export * from './announcement-banner';

View File

@ -3,6 +3,7 @@ export * from './ag-grid';
export * from './arrows'; export * from './arrows';
export * from './async-renderer'; export * from './async-renderer';
export * from './background-video'; export * from './background-video';
export * from './announcement-banner';
export * from './button'; export * from './button';
export * from './callout'; export * from './callout';
export * from './checkbox'; export * from './checkbox';