Skip to content

Commit cc94c33

Browse files
committed
feat: shot font name using the same font
1 parent fdd9b3b commit cc94c33

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

packages/keybr-textinput-ui/lib/TypingSettings.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function FontProp(): ReactNode {
181181
<OptionList
182182
options={Font.ALL.map((item) => ({
183183
value: item.id,
184-
name: item.name,
184+
name: <span style={item.cssProperties}>{item.name}</span>,
185185
}))}
186186
value={settings.get(textDisplayProps.font).id}
187187
onSelect={(id) => {

packages/keybr-widget/lib/components/optionlist/OptionList.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ export class OptionList
225225
className={styles.placeholder}
226226
onClick={this.handlePlaceholderClick}
227227
>
228-
<span className={styles.placeholderName} title={selectedOption.name}>
229-
{selectedOption.name}
230-
</span>
228+
<span className={styles.placeholderName}>{selectedOption.name}</span>
231229
<span className={styles.placeholderArrow}>
232230
{open ? "\u25BC" : "\u25BA"}
233231
</span>
@@ -244,7 +242,6 @@ export class OptionList
244242
option === selectedOption && styles.item_selected,
245243
index === highlightedIndex && styles.item_highlighted,
246244
)}
247-
title={option.name}
248245
onMouseOver={this.handleItemMouseOver(option)}
249246
onClick={this.handleItemClick(option)}
250247
>

packages/keybr-widget/lib/components/optionlist/OptionList.types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import { type ReactNode } from "react";
12
import { type FocusProps } from "../props.ts";
23
import { type ClassName } from "../types.ts";
34

45
export type OptionListOption = {
56
readonly value: string;
6-
readonly name: string;
7+
readonly name: ReactNode;
78
};
89

910
export type OptionListProps = {

0 commit comments

Comments
 (0)