From 7cf61570efc5f98c634286bf3d7257fa02216f10 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Sun, 16 Apr 2023 00:59:16 +0500 Subject: [PATCH] web: remove default-font component --- .../web/src/components/default-font/index.tsx | 103 ------------------ 1 file changed, 103 deletions(-) delete mode 100644 apps/web/src/components/default-font/index.tsx diff --git a/apps/web/src/components/default-font/index.tsx b/apps/web/src/components/default-font/index.tsx deleted file mode 100644 index 2b4afd1cf..000000000 --- a/apps/web/src/components/default-font/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -/* -This file is part of the Notesnook project (https://notesnook.com/) - -Copyright (C) 2023 Streetwriters (Private) Limited - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -import { Flex, Slider, Text } from "@theme-ui/components"; -import { useState } from "react"; -import { useStore as useEditorStore } from "../../stores/editor-store"; -import Config from "../../utils/config"; -import { toTitleCase } from "../../utils/string"; -import DropdownButton from "../dropdown-button"; - -export function DefaultFont() { - return null; - // const fontSize = useEditorStore((store) => store.session.fontSize); - //const fontFamily = useEditorStore((store) => store.session.fontFamily); - - // const fonts = ["sans-serif", "serif", "monospace"]; - // const getOptions = () => - // getFonts(Config.get("fontFamily", "sans-serif")).map((font) => ({ - // title: () => toTitleCase(font), - // onClick: () => { - // const newFonts = [font]; - // for (const item of fonts) { - // if (item !== font) { - // newFonts.push(item); - // } - // } - // Config.set("fontFamily", font); - // setFontFamily(font); - // setOptions(getOptions()); - // }, - // key: font - // })); - - // const [options, setOptions] = useState(getOptions()); - - // return ( - // - // - // { - // setFontSize(`${parseInt(e.target.value)}px`); - // Config.set("fontSize", `${e.target.value}px`); - // }} - // sx={{ width: "75%" }} - // /> - // - // {fontSize} - // - // - // - // - // ); -} - -function getFonts(font: string) { - const fonts = [font]; - const defaultFonts = ["sans-serif", "serif", "monospace"]; - for (const _font of defaultFonts) { - if (_font !== font) { - fonts.push(_font); - } - } - return fonts; -}