Skip to content

Commit

Permalink
feat: Show current theme and font family on Command dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
munshkr committed May 19, 2024
1 parent 6babb95 commit c077acd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/web/src/components/session-command-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { Link } from "react-router-dom";
import { useState } from "react";

interface SessionCommandDialogProps extends CommandDialogProps {
fontFamily: string;
theme: string;
vimMode: boolean;
lineNumbers: boolean;
wrapText: boolean;
Expand All @@ -51,6 +53,8 @@ interface SessionCommandDialogProps extends CommandDialogProps {
}

export default function SessionCommandDialog({
fontFamily,
theme,
vimMode,
lineNumbers,
wrapText,
Expand Down Expand Up @@ -142,11 +146,15 @@ export default function SessionCommandDialog({
<CommandList className="ml-2">
<CommandItem onSelect={() => setPages([...pages, "fonts"])}>
<Type className="mr-2 h-4 w-4 inline" />
<span>Font Family</span>
<span>
Change Font Family: <b>{fontFamily}</b>
</span>
</CommandItem>
<CommandItem onSelect={() => setPages([...pages, "themes"])}>
<Palette className="mr-2 h-4 w-4" />
<span>Theme</span>
<span>
Change Theme: <b>{themes[theme]?.name}</b>
</span>
</CommandItem>
<CommandItem onSelect={wrapHandler(props.onLineNumbers)}>
<FileDigit className="mr-2 h-4 w-4" />
Expand Down
2 changes: 2 additions & 0 deletions packages/web/src/routes/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ export function Component() {
</Helmet>
<SessionCommandDialog
open={commandsDialogOpen}
fontFamily={fontFamily}
theme={theme}
vimMode={vimMode}
lineNumbers={lineNumbers}
wrapText={wrapText}
Expand Down

0 comments on commit c077acd

Please sign in to comment.