-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pin config save/reset/actions to top of dialog, resizable canvas draw…
…ers (#217)
- Loading branch information
Showing
21 changed files
with
718 additions
and
310 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 |
---|---|---|
|
@@ -157,6 +157,7 @@ | |
"devcontainers", | ||
"devtunnel", | ||
"dotenv", | ||
"dppx", | ||
"echosql", | ||
"endregion", | ||
"epivision", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
import { ButtonProps, MenuItem, Tooltip } from '@fluentui/react-components'; | ||
import React from 'react'; | ||
|
||
type MenuItemControlProps = ButtonProps & { | ||
label?: string; | ||
description?: string; | ||
onClick?: () => void; | ||
iconOnly?: boolean; | ||
}; | ||
|
||
export const MenuItemControl: React.FC<MenuItemControlProps> = (props) => { | ||
const { disabled, icon, label, description, onClick, iconOnly } = props; | ||
|
||
let menuItem = null; | ||
|
||
if (iconOnly) { | ||
if (description) { | ||
menuItem = ( | ||
<Tooltip content={description} relationship="label"> | ||
<MenuItem disabled={disabled} icon={icon} onClick={onClick} /> | ||
</Tooltip> | ||
); | ||
} else { | ||
menuItem = <MenuItem disabled={disabled} icon={icon} onClick={onClick} />; | ||
} | ||
} else { | ||
menuItem = ( | ||
<MenuItem disabled={disabled} icon={icon} onClick={onClick}> | ||
{label} | ||
</MenuItem> | ||
); | ||
if (description) { | ||
menuItem = ( | ||
<Tooltip content={description} relationship="label"> | ||
{menuItem} | ||
</Tooltip> | ||
); | ||
} | ||
} | ||
return menuItem; | ||
}; |
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
Oops, something went wrong.