Skip to content

Commit

Permalink
Update to use Gutemberg popover
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcaires committed Jan 22, 2025
1 parent eee3690 commit 5dd81ff
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
1 change: 0 additions & 1 deletion client/components/add-new-site/content/a4a/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import AddNewSiteA4AMenuItems from 'calypso/components/add-new-site/menu-items/a
import AddNewSitesA4AModals from 'calypso/components/add-new-site/modals/a4a';
import AddNewSitePopover from 'calypso/components/add-new-site/popover';
import type { AddNewSiteContentProps } from 'calypso/components/add-new-site/types';
import './style.scss';

const AddNewSiteA4A = ( {
isMenuVisible,
Expand Down
5 changes: 0 additions & 5 deletions client/components/add-new-site/content/a4a/style.scss

This file was deleted.

1 change: 0 additions & 1 deletion client/components/add-new-site/content/site-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import AddNewSiteSiteListMenuItems from 'calypso/components/add-new-site/menu-items/site-list';
import AddNewSitePopover from 'calypso/components/add-new-site/popover';
import type { AddNewSiteContentProps } from 'calypso/components/add-new-site/types';
import './style.scss';

const AddNewSiteSiteList = ( {
isMenuVisible,
Expand Down
5 changes: 0 additions & 5 deletions client/components/add-new-site/content/site-list/style.scss

This file was deleted.

18 changes: 5 additions & 13 deletions client/components/add-new-site/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,20 @@ import { Popover } from '@wordpress/components';
type Props = {
isMenuVisible: boolean;
toggleMenu: () => void;
popoverMenuContext: React.RefObject< HTMLButtonElement >;
children: React.ReactNode;
popoverClassName?: string;
};

const AddNewSitePopover: React.FC< Props > = ( {
isMenuVisible,
toggleMenu,
popoverMenuContext,
children,
popoverClassName,
} ) => {
const AddNewSitePopover: React.FC< Props > = ( { isMenuVisible, toggleMenu, children } ) => {
if ( ! isMenuVisible ) {
return null;
}

return (
<Popover
// className={ clsx( 'add-new-site__popover', popoverClassName ) }
// context={ popoverMenuContext?.current }
isVisible={ isMenuVisible }
onClose={ toggleMenu }
noArrow={ false }
offset={ 10 }
closeOnEsc
autoPosition={ false }
placement="bottom-end"
>
<div className="add-new-site__popover-content">{ children }</div>
Expand Down

0 comments on commit 5dd81ff

Please sign in to comment.