-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readonly version when model is not editable
- Loading branch information
Showing
5 changed files
with
63 additions
and
28 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
1 change: 1 addition & 0 deletions
1
packages/ui/src/components/Dropdown/DropdownMenuModalActionItem.tsx
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
34 changes: 34 additions & 0 deletions
34
packages/versioned-playground/src/SquiggleVersionShower.tsx
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,34 @@ | ||
"use client"; | ||
import { FC } from "react"; | ||
import { SquiggleVersion, checkSquiggleVersion } from "./versions.js"; | ||
import { CodeBracketIcon, WrenchIcon } from "@quri/ui"; | ||
|
||
export function versionTitle(version: SquiggleVersion) { | ||
return version === "dev" ? "Next" : version; | ||
} | ||
|
||
export function uncheckedVersionTitle(version: string) { | ||
const versionIsValid = checkSquiggleVersion(version); | ||
if (versionIsValid) { | ||
return versionTitle(version); | ||
} else { | ||
return `${version} (unknown)`; | ||
} | ||
} | ||
|
||
export function versionIcon(version: string) { | ||
return version === "dev" ? WrenchIcon : CodeBracketIcon; | ||
} | ||
|
||
export const SquiggleVersionShower: FC<{ version: string }> = ({ version }) => { | ||
const CurrentIcon = versionIcon(version); | ||
|
||
return ( | ||
<div className="flex items-center gap-2"> | ||
<CurrentIcon size={14} className="text-slate-500" /> | ||
<div className="text-slate-600 text-sm"> | ||
{uncheckedVersionTitle(version)} | ||
</div> | ||
</div> | ||
); | ||
}; |
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