feat(title): preset card preview shows user-selected font family
This commit is contained in:
@@ -13,9 +13,15 @@ interface TitlePresetsGridProps {
|
||||
presets: TitlePresetItem[]
|
||||
activePreset: string | null
|
||||
onApply: (presetKey: string) => void
|
||||
fontFamily?: string
|
||||
}
|
||||
|
||||
const TitlePresetsGrid: React.FC<TitlePresetsGridProps> = ({ presets, activePreset, onApply }) => {
|
||||
const TitlePresetsGrid: React.FC<TitlePresetsGridProps> = ({
|
||||
presets,
|
||||
activePreset,
|
||||
onApply,
|
||||
fontFamily,
|
||||
}) => {
|
||||
return (
|
||||
<div className="xx-title-presets-grid">
|
||||
{presets.map((p) => {
|
||||
@@ -27,7 +33,10 @@ const TitlePresetsGrid: React.FC<TitlePresetsGridProps> = ({ presets, activePres
|
||||
onClick={() => onApply(p.key)}
|
||||
title={p.label}
|
||||
>
|
||||
<span className="xx-title-preset-preview-text" style={p.previewStyle}>
|
||||
<span
|
||||
className="xx-title-preset-preview-text"
|
||||
style={{ ...p.previewStyle, ...(fontFamily ? { fontFamily } : {}) }}
|
||||
>
|
||||
标题
|
||||
</span>
|
||||
<span className="xx-title-preset-card-label">{p.label}</span>
|
||||
|
||||
Reference in New Issue
Block a user