Update switcher icons, fix bug makeIconClass, add guid to new workspace name (#1444)

This commit is contained in:
Evan Simkowitz 2024-12-09 16:52:59 -08:00 committed by GitHub
parent edab90aa55
commit 34b73b8bea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 10 deletions

View File

@ -43,20 +43,20 @@ const colors = [
]; ];
const icons = [ const icons = [
"circle",
"triangle", "triangle",
"star", "star",
"cube",
"gem",
"chess-knight",
"heart", "heart",
"plane", "bolt",
"solid@cloud",
"moon",
"layer-group",
"rocket", "rocket",
"shield-cat", "flask",
"paw-simple", "paperclip",
"umbrella", "chart-line",
"graduation-cap", "graduation-cap",
"mug-hot", "mug-hot",
"circle",
]; ];
const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => { const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => {
@ -209,7 +209,12 @@ const WorkspaceSwitcher = () => {
const saveWorkspace = () => { const saveWorkspace = () => {
setObjectValue( setObjectValue(
{ ...activeWorkspace, name: "New Workspace", icon: "circle", color: colors[0] }, {
...activeWorkspace,
name: `New Workspace (${activeWorkspace.oid.slice(0, 5)})`,
icon: icons[0],
color: colors[0],
},
undefined, undefined,
true true
); );

View File

@ -91,7 +91,7 @@ function makeIconClass(icon: string, fw: boolean, opts?: { spin?: boolean; defau
if (icon.match(/^(solid@)?[a-z0-9-]+$/)) { if (icon.match(/^(solid@)?[a-z0-9-]+$/)) {
// strip off "solid@" prefix if it exists // strip off "solid@" prefix if it exists
icon = icon.replace(/^solid@/, ""); icon = icon.replace(/^solid@/, "");
return clsx(`fa fa-sharp fa-solid fa-${icon}`, fw ? "fa-fw" : null, opts?.spin ? "fa-spin" : null); return clsx(`fa fa-solid fa-${icon}`, fw ? "fa-fw" : null, opts?.spin ? "fa-spin" : null);
} }
if (icon.match(/^regular@[a-z0-9-]+$/)) { if (icon.match(/^regular@[a-z0-9-]+$/)) {
// strip off the "regular@" prefix if it exists // strip off the "regular@" prefix if it exists