feat: add account switcher menu (#941)

This commit is contained in:
Aman Harwara
2022-03-22 21:59:06 +05:30
committed by GitHub
parent 57469d6b2d
commit a764987b20
11 changed files with 273 additions and 225 deletions

View File

@@ -73,8 +73,12 @@ export const Menu: FunctionComponent<MenuProps> = ({
child: ComponentChild,
index: number,
array: ComponentChild[]
) => {
if (!child) return;
): ComponentChild => {
if (!child || (Array.isArray(child) && child.length < 1)) return;
if (Array.isArray(child)) {
return child.map(mapMenuItems);
}
const _child = child as VNode<unknown>;
const isFirstMenuItem =

View File

@@ -79,7 +79,7 @@ export const MenuItem: FunctionComponent<MenuItemProps> = forwardRef(
<div
className={`pseudo-radio-btn ${
checked ? 'pseudo-radio-btn--checked' : ''
} mr-2`}
} mr-2 flex-shrink-0`}
></div>
) : null}
{children}