Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #129 from GovConnex/feat/banner-addition-for-radar
Browse files Browse the repository at this point in the history
Feat/banner addition for radar
  • Loading branch information
beanpuppy authored Jan 31, 2024
2 parents fb506ce + 54729c5 commit 63e834d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govconnex/ui",
"version": "0.0.163",
"version": "0.0.164",
"description": "GovConnex UI - React Component Library",
"scripts": {
"build:tokens": "./tokens-build.sh",
Expand Down
13 changes: 11 additions & 2 deletions src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
faInfoCircle,
} from "@fortawesome/pro-regular-svg-icons";
import {useTheme} from "styled-components";
import {TypographySize} from "../../theming/global-theme.interface";

export interface BannerProps {
/**
Expand All @@ -28,11 +29,17 @@ export interface BannerProps {
* description of the banner
*/
description?: string;
/**
* text size of description
*/
descriptionSize?: keyof TypographySize;
/**
* variant of the banner
*/
variant?: "info" | "warning" | "error" | "success";

icon?: IconProp;

primaryButton?: {
label: string;
onClick: () => void;
Expand Down Expand Up @@ -63,7 +70,9 @@ const variantMap = {
const Banner = (props: BannerProps) => {
const {
title,
icon,
description,
descriptionSize = "sm",
variant = "info",
primaryButton,
secondaryButton,
Expand All @@ -73,15 +82,15 @@ const Banner = (props: BannerProps) => {
return (
<StyledBanner variant={variant} data-cy={props["data-cy"]}>
<Icon
icon={variantMap[variant] as IconProp}
icon={icon || (variantMap[variant] as IconProp)}
color={theme.extended.support[`${variant}Dark`]}
/>
<MainContentContainer>
<StyledTextWrapper variant={variant}>
<Typography noMargin variant="label">
{title}
</Typography>
<Typography noMargin variant="body" size="sm">
<Typography noMargin variant="body" size={descriptionSize}>
{description}
</Typography>
</StyledTextWrapper>
Expand Down

0 comments on commit 63e834d

Please sign in to comment.