From c1016b9330f03fb748c9b921078ae9deac971979 Mon Sep 17 00:00:00 2001 From: ifrost1 Date: Mon, 13 Jun 2022 18:04:27 -0400 Subject: [PATCH] fix: variablize project card menu items --- .storybook/pages/Cad/Cad.tsx | 172 +++++++++++------------------------ 1 file changed, 52 insertions(+), 120 deletions(-) diff --git a/.storybook/pages/Cad/Cad.tsx b/.storybook/pages/Cad/Cad.tsx index 618939224..6598ce89d 100644 --- a/.storybook/pages/Cad/Cad.tsx +++ b/.storybook/pages/Cad/Cad.tsx @@ -263,6 +263,52 @@ const StandardsRows = [ ]; export const Cad = () => { + const projectCardMenuItems = () => { + return ( + <> + + + Move to other section + + + + Move up + + + + Move down + + + + Move view details + + + ); + }; + + const projectCardMenuItemsWithDelete = () => { + return ( + <> + + + Move to other section + + + + Move up + + + + Move down + + + + Delete item + + + ); + }; + const [indexState, setIndexState] = useState(2); const [containers, setContainers] = useState({ 'container-1': { @@ -330,26 +376,7 @@ export const Cad = () => { children: ( - - - Move to other section - - - - Move up - - - - Move down - - - - Delete item - - - } + buttonDropdownItems={projectCardMenuItemsWithDelete()} meta="12 days" number={1} numberAriaLabel="Project 1" @@ -362,26 +389,7 @@ export const Cad = () => { children: ( - - - Move to other section - - - - Move up - - - - Move down - - - - Move view details - - - } + buttonDropdownItems={projectCardMenuItems()} meta="12 days" number={indexState} numberAriaLabel="Project 2" @@ -394,26 +402,7 @@ export const Cad = () => { children: ( - - - Move to other section - - - - Move up - - - - Move down - - - - Move view details - - - } + buttonDropdownItems={projectCardMenuItems()} meta="12 days" number={3} numberAriaLabel="Project 3" @@ -426,26 +415,7 @@ export const Cad = () => { children: ( - - - Move to other section - - - - Move up - - - - Move down - - - - Move view details - - - } + buttonDropdownItems={projectCardMenuItems()} meta="12 days" number={4} numberAriaLabel="Project 4" @@ -458,26 +428,7 @@ export const Cad = () => { children: ( - - - Move to other section - - - - Move up - - - - Move down - - - - Move view details - - - } + buttonDropdownItems={projectCardMenuItems()} buttonDropdownPosition="top-left" meta="12 days" number={5} @@ -491,26 +442,7 @@ export const Cad = () => { children: ( - - - Move to other section - - - - Move up - - - - Move down - - - - Move view details - - - } + buttonDropdownItems={projectCardMenuItems()} buttonDropdownPosition="top-left" meta="12 days" number={6}