From 6435b1172daf8f27e3dccf07403b31dadd53dbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Mi=C5=9Bta?= Date: Tue, 23 Nov 2021 15:58:05 +0100 Subject: [PATCH 1/3] Make title optional --- src/Alert/Alert.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Alert/Alert.tsx b/src/Alert/Alert.tsx index be6f27a3..cb333f56 100644 --- a/src/Alert/Alert.tsx +++ b/src/Alert/Alert.tsx @@ -14,7 +14,7 @@ export interface AlertProps { className?: string; close?: boolean; variant: AlertVariant; - title: string; + title?: string; } function getIcon(variant: AlertVariant): React.ReactElement { @@ -58,7 +58,8 @@ export const Alert: React.FC = ({
{getIcon(variant)}
- {title} + {title && {title}} + {close && ( Date: Thu, 25 Nov 2021 10:03:10 +0100 Subject: [PATCH 2/3] Without title story --- src/Alert/Alert.stories.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Alert/Alert.stories.tsx b/src/Alert/Alert.stories.tsx index db5e2927..37932c78 100644 --- a/src/Alert/Alert.stories.tsx +++ b/src/Alert/Alert.stories.tsx @@ -1,3 +1,4 @@ +import { Link, Typography } from "@material-ui/core"; import { Meta, Story } from "@storybook/react"; import React from "react"; @@ -25,6 +26,17 @@ export const WithContentAndClose: Story = () => ( ); +export const WithoutTitle: Story = () => ( + + + + Gift cards will appear after their order is fullfilled.{" "} + View Orders with Gift Cards + + + +); + export default { title: "Alert", } as Meta; From 8522e7daf269286f6d296152d89865a212f4efee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Mi=C5=9Bta?= Date: Thu, 25 Nov 2021 10:45:20 +0100 Subject: [PATCH 3/3] Fix link --- src/Alert/Alert.stories.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Alert/Alert.stories.tsx b/src/Alert/Alert.stories.tsx index 37932c78..6ea97c09 100644 --- a/src/Alert/Alert.stories.tsx +++ b/src/Alert/Alert.stories.tsx @@ -28,12 +28,10 @@ export const WithContentAndClose: Story = () => ( export const WithoutTitle: Story = () => ( - - - Gift cards will appear after their order is fullfilled.{" "} - View Orders with Gift Cards - - + + Gift cards will appear after their order is fullfilled.{" "} + View Orders with Gift Cards + );