From 65c25929b403a0bb0afafd7636489e6b3606cda7 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Thu, 28 Oct 2021 16:57:15 +0300 Subject: [PATCH 1/2] feat: type main-info for plateNote --- .../PlateNote/PlateNote.stories.tsx | 9 ++++++- src/components/PlateNote/PlateNote.tsx | 6 ++--- src/components/PlateNote/helpers.ts | 25 ++++++++++++++++--- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/components/PlateNote/PlateNote.stories.tsx b/src/components/PlateNote/PlateNote.stories.tsx index b59c1b9..40ca14f 100644 --- a/src/components/PlateNote/PlateNote.stories.tsx +++ b/src/components/PlateNote/PlateNote.stories.tsx @@ -27,7 +27,14 @@ stories.add('simple', () => ( + + Type 'primary-info' + + Type 'warning' diff --git a/src/components/PlateNote/PlateNote.tsx b/src/components/PlateNote/PlateNote.tsx index 7820e66..8beff6f 100644 --- a/src/components/PlateNote/PlateNote.tsx +++ b/src/components/PlateNote/PlateNote.tsx @@ -3,7 +3,7 @@ import { getMainColor } from './helpers'; import { Flex, TFlexProps } from '../Flex/Flex'; import { Text, TTextProps } from '../Text/Text'; -export type TPlateNoteType = 'info' | 'warning' | 'error'; +export type TPlateNoteType = 'info' | 'warning' | 'error' | 'primary-info'; export type TPlateNote = TFlexProps & { type?: TPlateNoteType; @@ -18,7 +18,7 @@ export const PlateNote: React.FC = ({ children, ...rest }) => { - const mainColor = getMainColor(type); + const { mainColor, textColor } = getMainColor(type); return ( = ({ {text} diff --git a/src/components/PlateNote/helpers.ts b/src/components/PlateNote/helpers.ts index 6471a92..fc51597 100644 --- a/src/components/PlateNote/helpers.ts +++ b/src/components/PlateNote/helpers.ts @@ -1,15 +1,32 @@ import { TPlateNoteType } from './PlateNote'; -export const getMainColor = (type: TPlateNoteType): string => { +export const getMainColor = ( + type: TPlateNoteType +): { mainColor: string; textColor: string } => { switch (type) { case 'error': { - return 'danger.$300'; + return { + mainColor: 'danger.$300', + textColor: 'danger.$300', + }; } case 'warning': { - return 'warning.$500'; + return { + mainColor: 'warning.$500', + textColor: 'warning.$500', + }; + } + case 'primary-info': { + return { + mainColor: 'primary.$300', + textColor: 'standard.$0', + }; } default: { - return 'main.$500'; + return { + mainColor: 'main.$500', + textColor: 'main.$500', + }; } } }; From 9a349a3fa549b032ecfc3b15b1ad8539394553b5 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Thu, 28 Oct 2021 17:16:55 +0300 Subject: [PATCH 2/2] 0.8.5 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67e2b9c..7f529bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@waves.exchange/react-uikit", - "version": "0.8.1", + "version": "0.8.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8cff981..bd40076 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves.exchange/react-uikit", - "version": "0.8.4", + "version": "0.8.5", "description": "", "license": "MIT", "main": "dist/cjs/index.js",