From 201c95f2e702ed19a1c36a477663c329bd45b2b5 Mon Sep 17 00:00:00 2001 From: Jin Lee <86632227+jinlee93@users.noreply.github.com> Date: Fri, 2 Jun 2023 09:24:32 -0700 Subject: [PATCH] refactor(projectcard): use menu component over buttondropdown (#1647) * refactor(projectcard): use menu component over buttondropdown * refactor(courseplanneredit): address pr comments --- .../CoursePlannerEdit.module.css | 9 ++ .../CoursePlannerEdit/CoursePlannerEdit.tsx | 92 +++++++------------ .../ProjectCard/ProjectCard.tsx | 56 +++++------ 3 files changed, 68 insertions(+), 89 deletions(-) diff --git a/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.module.css b/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.module.css index 8897e4216..a510da6c6 100644 --- a/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.module.css +++ b/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.module.css @@ -16,6 +16,15 @@ } } +/** + * Destructive variant of the Menu item. + * + * For indicating deletion of the project. + */ +.menu-item--destructive { + color: var(--eds-theme-color-text-utility-error); +} + /*------------------------------------*\ # TABLE CARD \*------------------------------------*/ diff --git a/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx b/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx index 74a7a8141..7a8041c93 100644 --- a/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx +++ b/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx @@ -5,35 +5,35 @@ import type { ReactNode } from 'react'; import ProjectCard from './ProjectCard'; import { - PageHeader, - Panel, - ButtonGroup, Button, - Heading, - LayoutContainer, - Layout, - LayoutSection, + ButtonGroup, + Card, + CardBody, + CardFooter, + DataBar, DragDrop, DragDropContainerHeader, - Icon, - HorizontalStepper, - DataBar, - Toolbar, - ToolbarItem, Grid, GridItem, - Text, - DropdownMenuItem, - Card, - CardBody, + Heading, + HorizontalStepper, + Icon, + Layout, + LayoutContainer, + LayoutSection, + Menu, NumberIcon, - TableHeader, - TableRow, + PageHeader, + Panel, Table, TableBody, TableCell, + TableHeader, TableHeaderCell, - CardFooter, + TableRow, + Text, + Toolbar, + ToolbarItem, } from '../../../src'; import type { NewState } from '../../../src/components/DragDrop/DragDrop'; @@ -403,22 +403,10 @@ export const CoursePlannerEdit = () => { const projectCardMenuItems = () => { return ( <> - - - Move to other section - - - - Move up - - - - Move down - - - - Move view details - + Move to other section + Move up + Move down + Move view details ); }; @@ -426,22 +414,12 @@ export const CoursePlannerEdit = () => { const projectCardMenuItemsWithDelete = () => { return ( <> - - - Move to other section - - - - Move up - - - - Move down - - - + Move to other section + Move up + Move down + Delete item - + ); }; @@ -497,7 +475,7 @@ export const CoursePlannerEdit = () => { children: ( { children: ( { children: ( { children: ( { children: ( { children: ( )} - {buttonDropdownItems && ( + {menuItems && ( - - - - } - position={buttonDropdownPosition} + - {buttonDropdownItems} - + + + + {menuItems} + )}