A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: add missing telegram icon in settings (#9507)
Ammar Ahmed81e6101fb5dd
diff --git a/apps/mobile/app/components/ui/AppIcon/index.tsx b/apps/mobile/app/components/ui/AppIcon/index.tsxindex e07f1e50e..3d2a1a32c 100644--- a/apps/mobile/app/components/ui/AppIcon/index.tsx+++ b/apps/mobile/app/components/ui/AppIcon/index.tsx@@ -20,6 +20,7 @@ import { useThemeColors } from "@notesnook/theme";import React from "react";import { ColorValue, TextProps } from "react-native";import Icon from "react-native-vector-icons/MaterialCommunityIcons";+import EvilIcon from "react-native-vector-icons/EvilIcons";import { AppFontSize } from "../../../utils/size";export interface IconProps extends TextProps {@@ -43,11 +44,22 @@ export interface IconProps extends TextProps {**/color?: ColorValue | number | undefined;++ iconFamily?: "evilicons" | "material";}-export default function AppIcon(props: IconProps) {+export default function AppIcon({+ iconFamily = "material",+ ...props+}: IconProps) {const { colors } = useThemeColors();- return (+ return iconFamily === "evilicons" ? (+ <EvilIcon+ size={AppFontSize.md}+ color={colors.primary.icon}+ {...(props as any)}+ />+ ) : (<Iconsize={AppFontSize.md}color={colors.primary.icon}diff --git a/apps/mobile/app/screens/settings/section-item.tsx b/apps/mobile/app/screens/settings/section-item.tsxindex 9cd55c18e..4ed5f8461 100644--- a/apps/mobile/app/screens/settings/section-item.tsx+++ b/apps/mobile/app/screens/settings/section-item.tsx@@ -25,7 +25,6 @@ import {} from "@react-navigation/native";import React, { useEffect, useRef, useState } from "react";import { ActivityIndicator, TextInput, View } from "react-native";-import Icon from "react-native-vector-icons/MaterialCommunityIcons";import { FeatureResult, useIsFeatureAvailable } from "@notesnook/common";//@ts-ignoreimport ToggleSwitch from "toggle-switch-react-native";@@ -218,14 +217,15 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {}}>{!!item.icon && (- <Icon+ <AppIconcolor={item.type === "danger"? colors.error.icon: colors.secondary.icon}+ iconFamily={item.iconFamily}name={item.icon}- size={30}+ size={item.iconSize || 30}/>)}</View>diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsxindex 278090b7d..3430af6ea 100644--- a/apps/mobile/app/screens/settings/settings-data.tsx+++ b/apps/mobile/app/screens/settings/settings-data.tsx@@ -92,6 +92,7 @@ export const settingsGroups: SettingSection[] = [{id: "delete-data",name: strings.deleteData(),+ icon: "delete",description: strings.deleteAccountDesc(),modifer: () => {presentDialog({@@ -1243,7 +1244,7 @@ export const settingsGroups: SettingSection[] = [}},{- id: "backup-now",+ id: "backup-now-with-attachments",name: strings.backupNowWithAttachments(),description: strings.backupNowWithAttachmentsDesc(),hidden: () => !useUserStore.getState().user,@@ -1545,6 +1546,9 @@ export const settingsGroups: SettingSection[] = [id: "join-telegram",name: strings.joinTelegram(),description: strings.joinTelegramDesc(),+ icon: "sc-telegram",+ iconFamily: "evilicons",+ iconSize: 35,modifer: () => {Linking.openURL("https://t.me/notesnook").catch(() => {/* empty */diff --git a/apps/mobile/app/screens/settings/types.ts b/apps/mobile/app/screens/settings/types.tsindex e638dd937..4af28534e 100644--- a/apps/mobile/app/screens/settings/types.ts+++ b/apps/mobile/app/screens/settings/types.ts@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import { TextInput } from "react-native";import { Settings } from "../../stores/use-setting-store";import { FeatureId } from "@notesnook/common";+import { IconProps } from "../../components/ui/AppIcon";export type SettingSection = {id: string;@@ -34,6 +35,8 @@ export type SettingSection = {name?: string | ((current?: unknown) => string);description?: string | ((current: unknown) => string);icon?: string;+ iconFamily?: IconProps["iconFamily"];+ iconSize?: number;property?: keyof Settings;sections?: SettingSection[];component?: string;diff --git a/apps/mobile/fonts/EvilIcons.ttf b/apps/mobile/fonts/EvilIcons.ttfnew file mode 100644index 000000000..6868f7bb6Binary files /dev/null and b/apps/mobile/fonts/EvilIcons.ttf differdiff --git a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxprojindex 10036c329..4ace5afcb 100644--- a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj+++ b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj@@ -34,6 +34,8 @@65AA857E25E6DDEC00772A01 /* NotesWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65AA857D25E6DDEC00772A01 /* NotesWidget.swift */; };65AA858025E6DDEE00772A01 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 65AA857F25E6DDEE00772A01 /* Assets.xcassets */; };65AA858425E6DDEE00772A01 /* NotesWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 65AA857725E6DDEC00772A01 /* NotesWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };+ 65AD1F4A2F6289110033176F /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65AD1F492F6289110033176F /* EvilIcons.ttf */; };+ 65AD1F4B2F6289110033176F /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65AD1F492F6289110033176F /* EvilIcons.ttf */; };65B5014425A672B200E2D264 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 65B5014325A672B200E2D264 /* ShareViewController.m */; };65B5014725A672B200E2D264 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65B5014525A672B200E2D264 /* MainInterface.storyboard */; };65B5014B25A672B200E2D264 /* Make Note.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 65B5014025A672B200E2D264 /* Make Note.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };@@ -129,6 +131,7 @@65AA857D25E6DDEC00772A01 /* NotesWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotesWidget.swift; sourceTree = "<group>"; };65AA857F25E6DDEE00772A01 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };65AA858125E6DDEE00772A01 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };+ 65AD1F492F6289110033176F /* EvilIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = EvilIcons.ttf; path = ../fonts/EvilIcons.ttf; sourceTree = SOURCE_ROOT; };65B5014025A672B200E2D264 /* Make Note.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Make Note.appex"; sourceTree = BUILT_PRODUCTS_DIR; };65B5014325A672B200E2D264 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = "<group>"; };65B5014625A672B200E2D264 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };@@ -291,6 +294,7 @@83CBB9F61A601CBA00E9B192 = {isa = PBXGroup;children = (+ 65AD1F492F6289110033176F /* EvilIcons.ttf */,653F4E042EA3887C009A42A2 /* Inter-Bold.ttf */,653F4E052EA3887C009A42A2 /* Inter-Italic.ttf */,653F4E062EA3887C009A42A2 /* Inter-Regular.ttf */,@@ -536,6 +540,7 @@buildActionMask = 2147483647;files = (659201D82EA78265006B16DB /* Inter-Bold.ttf in Resources */,+ 65AD1F4B2F6289110033176F /* EvilIcons.ttf in Resources */,659201D92EA78265006B16DB /* Inter-Italic.ttf in Resources */,659201DA2EA78265006B16DB /* Inter-Regular.ttf in Resources */,659201DB2EA78265006B16DB /* Inter-SemiBold.ttf in Resources */,@@ -581,6 +586,7 @@659201DE2EA7826D006B16DB /* Inter-Regular.ttf in Resources */,659201DF2EA7826D006B16DB /* Inter-SemiBold.ttf in Resources */,65C400DF2A80B6B600AA3DF5 /* MaterialCommunityIcons.ttf in Resources */,+ 65AD1F4A2F6289110033176F /* EvilIcons.ttf in Resources */,65C149872A61151B005C40F1 /* extension.bundle in Resources */,65B5014725A672B200E2D264 /* MainInterface.storyboard in Resources */,);@@ -1724,10 +1730,7 @@ONLY_ACTIVE_ARCH = YES;OTHER_CFLAGS = "$(inherited)";OTHER_CPLUSPLUSFLAGS = "$(inherited)";- OTHER_LDFLAGS = (- "$(inherited)",- " ",- );+ OTHER_LDFLAGS = "$(inherited) ";REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";SDKROOT = iphoneos;SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";@@ -1792,10 +1795,7 @@ONLY_ACTIVE_ARCH = NO;OTHER_CFLAGS = "$(inherited)";OTHER_CPLUSPLUSFLAGS = "$(inherited)";- OTHER_LDFLAGS = (- "$(inherited)",- " ",- );+ OTHER_LDFLAGS = "$(inherited) ";REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";SDKROOT = iphoneos;USE_HERMES = true;diff --git a/apps/mobile/ios/Notesnook/Info.plist b/apps/mobile/ios/Notesnook/Info.plistindex baeaa1347..8ec6fb96e 100644--- a/apps/mobile/ios/Notesnook/Info.plist+++ b/apps/mobile/ios/Notesnook/Info.plist@@ -97,6 +97,7 @@<string>Inter-Regular.ttf</string><string>Inter-Bold.ttf</string><string>MaterialCommunityIcons.ttf</string>+ <string>EvilIcons.ttf</string></array><key>UIApplicationSceneManifest</key><dict>