Add blue beta dot to the space panel create button

This commit is contained in:
Michael Telatynski 2021-08-10 16:45:56 +01:00
parent 1272b375d5
commit f98de18427
2 changed files with 19 additions and 1 deletions

View file

@ -100,6 +100,16 @@ $activeBorderColor: $secondary-fg-color;
} }
} }
.mx_SpaceItem_new {
position: relative;
.mx_BetaDot {
position: absolute;
left: 33px;
top: -5px;
}
}
.mx_SpaceItem:not(.hasSubSpaces) > .mx_SpaceButton { .mx_SpaceItem:not(.hasSubSpaces) > .mx_SpaceButton {
margin-left: $gutterSize; margin-left: $gutterSize;
min-width: 40px; min-width: 40px;

View file

@ -138,11 +138,18 @@ const CreateSpaceButton = ({
} }
const onNewClick = menuDisplayed ? closeMenu : () => { const onNewClick = menuDisplayed ? closeMenu : () => {
// persist that the user has interacted with this, use it to dismiss the beta dot
localStorage.setItem("mx_seenSpaces", "1");
if (!isPanelCollapsed) setPanelCollapsed(true); if (!isPanelCollapsed) setPanelCollapsed(true);
openMenu(); openMenu();
}; };
return <li className={classNames("mx_SpaceItem", { let betaDot: JSX.Element;
if (!localStorage.getItem("mx_seenSpaces")) {
betaDot = <div className="mx_BetaDot" />;
}
return <li className={classNames("mx_SpaceItem mx_SpaceItem_new", {
"collapsed": isPanelCollapsed, "collapsed": isPanelCollapsed,
})}> })}>
<SpaceButton <SpaceButton
@ -153,6 +160,7 @@ const CreateSpaceButton = ({
onClick={onNewClick} onClick={onNewClick}
isNarrow={isPanelCollapsed} isNarrow={isPanelCollapsed}
/> />
{ betaDot }
{ contextMenu } { contextMenu }
</li>; </li>;