mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(core): selector for editorSetting hooks (#8108)
This commit is contained in:
@@ -13,7 +13,9 @@ import { RowLayout } from '../row.layout';
|
||||
export const FontStyleSetting = () => {
|
||||
const t = useI18n();
|
||||
const editorSetting = useService(EditorSettingService).editorSetting;
|
||||
const settings = useLiveData(editorSetting.settings$);
|
||||
const fontFamily = useLiveData(
|
||||
editorSetting.settings$.selector(s => s.fontFamily)
|
||||
);
|
||||
|
||||
const options = useMemo(() => getBaseFontStyleOptions(t), [t]);
|
||||
const handleEdit = useCallback(
|
||||
@@ -27,7 +29,7 @@ export const FontStyleSetting = () => {
|
||||
<RowLayout label={t['com.affine.mobile.setting.appearance.font']()}>
|
||||
<SettingDropdownSelect<FontFamily>
|
||||
options={options}
|
||||
value={settings.fontFamily}
|
||||
value={fontFamily}
|
||||
onChange={handleEdit}
|
||||
/>
|
||||
</RowLayout>
|
||||
|
||||
Reference in New Issue
Block a user