diff --git a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx index 5df0980ce..9b800bebb 100644 --- a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx +++ b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx @@ -65,7 +65,13 @@ function NoteTypeWidget({ note }: { note?: FNote | null }) { ); } -export function NoteTypeDropdownContent({ currentNoteType, currentNoteMime, note, setModalShown }: { currentNoteType?: NoteType, currentNoteMime?: string | null, note?: FNote | null, setModalShown: Dispatch> }) { +export function NoteTypeDropdownContent({ currentNoteType, currentNoteMime, note, setModalShown, noCodeNotes }: { + currentNoteType?: NoteType; + currentNoteMime?: string | null; + note?: FNote | null; + setModalShown: Dispatch>; + noCodeNotes?: boolean; +}) { const mimeTypes = useMimeTypes(); const noteTypes = useMemo(() => NOTE_TYPES.filter((nt) => !nt.reserved && !nt.static), []); const changeNoteType = useCallback(async (type: NoteType, mime?: string) => { @@ -103,7 +109,7 @@ export function NoteTypeDropdownContent({ currentNoteType, currentNoteMime, note } const checked = (type === currentNoteType); - if (type !== "code") { + if (noCodeNotes || type !== "code") { return ( + {!noCodeNotes && } ); } diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsx index 3d1f8b4cc..1710a27dd 100644 --- a/apps/client/src/widgets/ribbon/NoteActions.tsx +++ b/apps/client/src/widgets/ribbon/NoteActions.tsx @@ -184,11 +184,16 @@ function EditabilityDropdown({ note }: { note: FNote }) { function NoteTypeDropdown({ note }: { note: FNote }) { const currentNoteType = useNoteProperty(note, "type") ?? undefined; const currentNoteMime = useNoteProperty(note, "mime"); - const [ modalShown, setModalShown ] = useState(false); return ( - + { /* no-op since no code notes are displayed here */ }} + noCodeNotes + /> ); }