From c3ee1889db8a904731366bb147b2b94f3497a544 Mon Sep 17 00:00:00 2001 From: Agata Date: Thu, 31 Oct 2024 15:54:03 +0100 Subject: [PATCH] New dropdown menu --- .../components/site-manager/sidebar/index.tsx | 58 ++++++++++++++++--- .../site-manager/sidebar/style.module.css | 6 ++ .../site-manager/site-info-panel/index.tsx | 31 ++-------- .../github-export-menu-item.tsx | 2 +- .../toolbar-buttons/restore-from-zip.tsx | 6 +- 5 files changed, 65 insertions(+), 38 deletions(-) diff --git a/packages/playground/website/src/components/site-manager/sidebar/index.tsx b/packages/playground/website/src/components/site-manager/sidebar/index.tsx index 34521309fe..1d9a141f3d 100644 --- a/packages/playground/website/src/components/site-manager/sidebar/index.tsx +++ b/packages/playground/website/src/components/site-manager/sidebar/index.tsx @@ -10,9 +10,9 @@ import { Icon, __experimentalItemGroup as ItemGroup, __experimentalItem as Item, - Flex, + Flex, DropdownMenu, } from '@wordpress/components'; -import { page } from '@wordpress/icons'; +import { moreVertical, page } from '@wordpress/icons'; import { ClockIcon, WordPressIcon } from '@wp-playground/components'; import { setActiveSite, @@ -27,6 +27,10 @@ import { } from '../../../lib/state/redux/slice-sites'; import { PlaygroundRoute, redirectTo } from '../../../lib/state/url/router'; import { setSiteManagerSection } from '../../../lib/state/redux/slice-ui'; +import { WordPressPRMenuItem } from '../../toolbar-buttons/wordpress-pr-menu-item'; +import { GutenbergPRMenuItem } from '../../toolbar-buttons/gutenberg-pr-menu-item'; +import { RestoreFromZipMenuItem } from '../../toolbar-buttons/restore-from-zip'; +import { GithubImportMenuItem } from '../../toolbar-buttons/github-import-menu-item'; export function Sidebar({ className, @@ -35,6 +39,7 @@ export function Sidebar({ className?: string; afterSiteClick?: (slug: string) => void; }) { + const offline = useAppSelector((state) => state.ui.offline); const storedSites = useAppSelector(selectSortedSites).filter( (site) => site.metadata.storage !== 'none' ); @@ -86,11 +91,50 @@ export function Sidebar({ role="" aria-orientation={undefined} > -

WordPress Playground

-
- {/* Remove Playground logo because branding isn't finalized. */} - {/* */} -
+ {/* Padding 3px is because of focus on dropdown button */} + +

WordPress Playground

+
+ {/* Remove Playground logo because branding isn't finalized. */} + {/* */} +
+ + {({ onClose }) => ( + <> + + + + + + )} + +