Skip to content

Commit

Permalink
refactor: move message banner interface to common file
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Oct 18, 2023
1 parent 75b1311 commit 757c147
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useNavigate } from 'react-router-dom';
import { MessageBannerDialog } from './MessageBannerDialog/MessageBannerDialog';
import { useState } from 'react';
import ReactMarkdown from 'react-markdown';
import { BannerVariant, IMessageBanner } from 'interfaces/messageBanner';

const StyledBar = styled('aside', {
shouldForwardProp: (prop) => prop !== 'variant' && prop !== 'sticky',
Expand Down Expand Up @@ -42,20 +43,6 @@ const StyledIcon = styled('div', {
color: theme.palette[variant].main,
}));

type BannerVariant = 'warning' | 'info' | 'error' | 'success';

export interface IMessageBanner {
message: string;
variant?: BannerVariant;
sticky?: boolean;
icon?: string;
link?: string;
linkText?: string;
plausibleEvent?: string;
dialogTitle?: string;
dialog?: string;
}

interface IMessageBannerProps {
messageBanner: IMessageBanner;
}
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/interfaces/messageBanner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type BannerVariant = 'warning' | 'info' | 'error' | 'success';

export interface IMessageBanner {
message: string;
enabled?: boolean;
variant?: BannerVariant;
sticky?: boolean;
icon?: string;
link?: string;
linkText?: string;
plausibleEvent?: string;
dialogTitle?: string;
dialog?: string;
}

0 comments on commit 757c147

Please sign in to comment.