-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hide less used functions in overflow dropdown (#876)
* feat: hide less used functions in overflow dropdown * chore: add story to show Tiptap editor
- Loading branch information
Showing
9 changed files
with
180 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1766,6 +1766,10 @@ video { | |
flex-shrink: 0; | ||
} | ||
|
||
.flex-grow { | ||
flex-grow: 1; | ||
} | ||
|
||
.grow { | ||
flex-grow: 1; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
apps/studio/src/components/PageEditor/MenuBar/MenubarItem/OverflowList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { | ||
HStack, | ||
Icon, | ||
Popover, | ||
PopoverBody, | ||
PopoverContent, | ||
PopoverTrigger, | ||
} from "@chakra-ui/react" | ||
import { IconButton } from "@opengovsg/design-system-react" | ||
import { BiDotsHorizontalRounded } from "react-icons/bi" | ||
|
||
import type { MenubarNestedItem } from "./types" | ||
import { MenuItem } from "../../MenuItem" | ||
|
||
export interface MenubarOverflowListProps { | ||
type: "overflow-list" | ||
items: MenubarNestedItem[] | ||
} | ||
|
||
export const MenubarOverflowList = ({ | ||
items, | ||
}: MenubarOverflowListProps): JSX.Element => { | ||
return ( | ||
<Popover placement="bottom"> | ||
{({ isOpen }) => ( | ||
<> | ||
<PopoverTrigger> | ||
<IconButton | ||
variant="clear" | ||
colorScheme="neutral" | ||
isActive={isOpen} | ||
_active={{ | ||
bg: "interaction.muted.main.active", | ||
}} | ||
h="1.75rem" | ||
w="1.75rem" | ||
minH="1.75rem" | ||
minW="1.75rem" | ||
p="0.25rem" | ||
aria-label="More options" | ||
> | ||
<Icon | ||
as={BiDotsHorizontalRounded} | ||
fontSize="1.25rem" | ||
color="base.content.medium" | ||
/> | ||
</IconButton> | ||
</PopoverTrigger> | ||
<PopoverContent w="fit-content"> | ||
<PopoverBody> | ||
<HStack> | ||
{items.map((subItem, index) => ( | ||
<MenuItem | ||
key={index} | ||
icon={subItem.icon} | ||
title={subItem.title} | ||
action={subItem.action} | ||
isActive={subItem.isActive} | ||
/> | ||
))} | ||
</HStack> | ||
</PopoverBody> | ||
</PopoverContent> | ||
</> | ||
)} | ||
</Popover> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters