From 2b289ddf77f45332790141f2774ab6f81a67b674 Mon Sep 17 00:00:00 2001 From: akhilmhdh Date: Sun, 12 Feb 2023 17:31:22 +0530 Subject: [PATCH] feat(ui): add new button style, improved select ui and linted app layout --- .../components/v2/Button/Button.stories.tsx | 7 ++ frontend/src/components/v2/Button/Button.tsx | 14 ++- frontend/src/components/v2/Select/Select.tsx | 3 +- frontend/src/layouts/AppLayout/AppLayout.tsx | 110 ++++++++++-------- 4 files changed, 85 insertions(+), 49 deletions(-) diff --git a/frontend/src/components/v2/Button/Button.stories.tsx b/frontend/src/components/v2/Button/Button.stories.tsx index 51e58d0da..c823b5531 100644 --- a/frontend/src/components/v2/Button/Button.stories.tsx +++ b/frontend/src/components/v2/Button/Button.stories.tsx @@ -38,6 +38,13 @@ export const Secondary: Story = { } }; +export const Star: Story = { + args: { + children: 'Hello Infisical', + variant: 'star' + } +}; + export const Danger: Story = { args: { children: 'Hello Infisical', diff --git a/frontend/src/components/v2/Button/Button.tsx b/frontend/src/components/v2/Button/Button.tsx index af59f3d51..8c6bf91b2 100644 --- a/frontend/src/components/v2/Button/Button.tsx +++ b/frontend/src/components/v2/Button/Button.tsx @@ -31,7 +31,9 @@ const buttonVariants = cva( variant: { solid: '', outline: ['bg-transparent', 'border-2', 'border-solid'], - plain: '' + plain: '', + // a constant color not in use on hover or click goes colorSchema color + star: 'text-bunker-200 bg-mineshaft-500' }, isDisabled: { true: 'bg-mineshaft opacity-40 cursor-not-allowed', @@ -53,6 +55,16 @@ const buttonVariants = cva( } }, compoundVariants: [ + { + colorSchema: 'primary', + variant: 'star', + className: 'hover:bg-primary hover:text-black' + }, + { + colorSchema: 'danger', + variant: 'star', + className: 'hover:bg-red hover:text-white' + }, { colorSchema: 'primary', variant: 'outline', diff --git a/frontend/src/components/v2/Select/Select.tsx b/frontend/src/components/v2/Select/Select.tsx index 5a1aa7a35..19885437d 100644 --- a/frontend/src/components/v2/Select/Select.tsx +++ b/frontend/src/components/v2/Select/Select.tsx @@ -42,7 +42,8 @@ export const Select = forwardRef( { // eslint-disable-next-line prefer-const let { workspaces, currentWorkspace } = useWorkspace(); const { currentOrg } = useOrganization(); - workspaces = workspaces.filter(ws => ws.organization === currentOrg?._id) + workspaces = workspaces.filter((ws) => ws.organization === currentOrg?._id); const { user } = useUser(); const createWs = useCreateWorkspace(); @@ -218,50 +218,58 @@ export const AppLayout = ({ children }: LayoutProps) => {