From eff2e475ff55edb1cb5fcd0505ddfff75a3271cf Mon Sep 17 00:00:00 2001 From: Ammar Ahmed <40239442+ammarahm-ed@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:05:47 +0500 Subject: [PATCH] mobile: add oss licenses (#2018) --- .../app/screens/settings/components.tsx | 4 +- .../app/screens/settings/license-data.js | 466 ++++++++++++++++++ apps/mobile/app/screens/settings/licenses.tsx | 71 +++ .../app/screens/settings/settings-data.tsx | 8 + 4 files changed, 548 insertions(+), 1 deletion(-) create mode 100644 apps/mobile/app/screens/settings/license-data.js create mode 100644 apps/mobile/app/screens/settings/licenses.tsx diff --git a/apps/mobile/app/screens/settings/components.tsx b/apps/mobile/app/screens/settings/components.tsx index b8559d26b..4e8071a7a 100644 --- a/apps/mobile/app/screens/settings/components.tsx +++ b/apps/mobile/app/screens/settings/components.tsx @@ -22,6 +22,7 @@ import { AccentColorPicker, HomagePageSelector } from "./appearance"; import { AutomaticBackupsSelector } from "./backup-restore"; import DebugLogs from "./debug"; import { ConfigureToolbar } from "./editor/configure-toolbar"; +import { Licenses } from "./licenses"; import SoundPicker from "./sound-picker"; import { Subscription } from "./subscription"; export const components: { [name: string]: ReactElement } = { @@ -31,5 +32,6 @@ export const components: { [name: string]: ReactElement } = { subscription: , configuretoolbar: , "debug-logs": , - "sound-picker": + "sound-picker": , + licenses: }; diff --git a/apps/mobile/app/screens/settings/license-data.js b/apps/mobile/app/screens/settings/license-data.js new file mode 100644 index 000000000..9ad9ff277 --- /dev/null +++ b/apps/mobile/app/screens/settings/license-data.js @@ -0,0 +1,466 @@ +/* eslint-disable header/header */ +export const LICENSES = [ + { + name: "@callstack/repack", + licenseType: "MIT", + author: "zamotany ", + link: "https://github.com/callstack/repack" + }, + { + name: "@react-native-clipboard/clipboard", + licenseType: "MIT", + author: "M.Haris Baig ", + link: "https://github.com/react-native-clipboard/clipboard" + }, + { + name: "@react-native-community/checkbox", + licenseType: "MIT", + author: "Nicholas Lee ", + link: "https://github.com/react-native-community/react-native-checkbox" + }, + { + name: "@react-native-community/netinfo", + licenseType: "MIT", + author: "Matt Oakes ", + link: "https://github.com/react-native-netinfo/react-native-netinfo" + }, + { + name: "@react-native-community/toolbar-android", + licenseType: "MIT", + author: "Connectdotz ", + link: "https://github.com/react-native-community/toolbar-android" + }, + { + name: "@react-native-masked-view/masked-view", + licenseType: "MIT", + author: "Mike Nedosekin ", + link: "https://github.com/react-native-masked-view/masked-view" + }, + { + name: "@react-navigation/elements", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/react-navigation/react-navigation" + }, + { + name: "@react-navigation/native", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/react-navigation/react-navigation" + }, + { + name: "@react-navigation/native-stack", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/react-navigation/react-navigation" + }, + { + name: "@sayem314/react-native-keep-awake", + licenseType: "MIT", + author: "Sayem Chowdhury", + link: "https://github.com/sayem314/react-native-keep-awake" + }, + { + name: "deprecated-react-native-prop-types", + licenseType: "MIT", + author: "n/a", + link: "git@github.com:facebookarchive/react-native-deprecated-modules" + }, + { + name: "react", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/facebook/react" + }, + { + name: "react-native", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/facebook/react-native" + }, + { + name: "react-native-background-actions", + licenseType: "MIT", + author: "Rapsssito contact@rodrigomartin.dev", + link: "https://github.com/Rapsssito/react-native-background-actions" + }, + { + name: "react-native-begin-background-task", + licenseType: "MIT", + author: "Ivan Zotov ", + link: "n/a" + }, + { + name: "react-native-bootsplash", + licenseType: "MIT", + author: "Mathieu Acthernoene ", + link: "https://github.com/zoontek/react-native-bootsplash" + }, + { + name: "react-native-config", + licenseType: "MIT", + author: "Pedro Belo", + link: "https://github.com/luggit/react-native-config" + }, + { + name: "react-native-device-info", + licenseType: "MIT", + author: + "Rebecca Hughes (https://github.com/rebeccahughes)", + link: "https://github.com/react-native-device-info/react-native-device-info" + }, + { + name: "react-native-document-picker", + licenseType: "MIT", + author: + "Elyx0 (https://github.com/rnmods), Vojtech Novak (hello@react-native-training.eu)", + link: "https://github.com/rnmods/react-native-document-picker" + }, + { + name: "react-native-eventsource", + licenseType: "MIT", + author: "João Ribeiro jonnybgod@gmail.com", + link: "n/a" + }, + { + name: "react-native-exit-app", + licenseType: "MIT", + author: "Wumke", + link: "n/a" + }, + { + name: "react-native-file-viewer", + licenseType: "MIT", + author: "Vincenzo Scamporlino", + link: "git://github.com/vinzscam/react-native-file-viewer" + }, + { + name: "react-native-fingerprint-scanner", + licenseType: "MIT", + author: "Hieu Van (https://github.com/hieuvp)", + link: "n/a" + }, + { + name: "react-native-gesture-handler", + licenseType: "MIT", + author: "Krzysztof Magiera krzys.magiera@gmail.com", + link: "https://github.com/software-mansion/react-native-gesture-handler" + }, + { + name: "react-native-get-random-values", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/LinusU/react-native-get-random-values" + }, + { + name: "react-native-html-to-pdf-lite", + licenseType: "MIT", + author: "Oni Benjamin ", + link: "https://github.com/Onibenjo/react-native-html-to-pdf" + }, + { + name: "react-native-iap", + licenseType: "MIT", + author: "dooboolab", + link: "https://github.com/dooboolab/react-native-iap" + }, + { + name: "react-native-image-picker", + licenseType: "MIT", + author: "Johan du Toit (Johan-dutoit)", + link: "https://github.com/react-native-image-picker/react-native-image-picker" + }, + { + name: "react-native-keychain", + licenseType: "MIT", + author: "Joel Arvidsson joel@oblador.se", + link: "git://github.com/oblador/react-native-keychain" + }, + { + name: "react-native-mmkv-storage", + licenseType: "MIT", + author: "Ammar Ahmed for @ammarahm-ed", + link: "https://github.com/ammarahm-ed/react-native-mmkv-storage" + }, + { + name: "react-native-orientation", + licenseType: "ISC", + author: "Yamill Vallecillo (github.com/yamill)", + link: "n/a" + }, + { + name: "react-native-privacy-snapshot", + licenseType: "MIT", + author: "Roger Chapman", + link: "n/a" + }, + { + name: "react-native-reanimated", + licenseType: "MIT", + author: "Krzysztof Magiera krzys.magiera@gmail.com", + link: "https://github.com/software-mansion/react-native-reanimated" + }, + { + name: "react-native-safe-area-context", + licenseType: "MIT", + author: "Janic Duplessis ", + link: "https://github.com/th3rdwave/react-native-safe-area-context" + }, + { + name: "react-native-scoped-storage", + licenseType: "MIT", + author: "Ammar Ahmed @ammarahm-ed", + link: "https://github.com/ammarahm-ed/react-native-scoped-storage" + }, + { + name: "react-native-screens", + licenseType: "MIT", + author: "Krzysztof Magiera krzys.magiera@gmail.com", + link: "https://github.com/software-mansion/react-native-screens" + }, + { + name: "react-native-securerandom", + licenseType: "MIT", + author: "Rob Hogan npm@rhogan.net https://github.com/robhogan", + link: "https://github.com/robhogan/react-native-securerandom" + }, + { + name: "react-native-share", + licenseType: "MIT", + author: "Esteban Fuentealba efuentealba@json.cl", + link: "https://github.com/react-native-community/react-native-share" + }, + { + name: "@ammarahmed/react-native-sodium", + licenseType: "n/a", + author: "n/a", + link: "https://github.com/lyubo/react-native-sodium" + }, + { + name: "react-native-svg", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/react-native-community/react-native-svg" + }, + { + name: "react-native-tooltips", + licenseType: "Apache License", + author: "Pranav Raj Singh Chauhan", + link: "https://github.com/prscX/react-native-tooltips" + }, + { + name: "react-native-vector-icons", + licenseType: "MIT", + author: "Joel Arvidsson joel@oblador.se", + link: "git://github.com/oblador/react-native-vector-icons" + }, + { + name: "react-native-webview", + licenseType: "MIT", + author: "Jamon Holmgren ", + link: "https://github.com/react-native-webview/react-native-webview" + }, + { + name: "rn-extensions-share", + licenseType: "MIT", + author: + "Djorkaeff Alexandre djorkaeffalexandre@gmail.com http://github.com/djorkaeffalexandre", + link: "https://github.com/RocketChat/rn-extensions-share" + }, + { + name: "rn-fetch-blob", + licenseType: "MIT", + author: "Joltup", + link: "https://github.com/joltup/rn-fetch-blob" + }, + { + name: "react-native-gzip", + licenseType: "MIT", + author: + "ammarahm-ed (https://github.com/ammarahm-ed)", + link: "https://github.com/ammarahm-ed/react-native-gzip" + }, + { + name: "@shopify/flash-list", + licenseType: "MIT", + author: "shopify", + link: "https://github.com/Shopify/flash-list" + }, + { + name: "@notifee/react-native", + licenseType: "Apache-2.0", + author: "Invertase (http://invertase.io)", + link: "https://github.com/invertase/notifee" + }, + { + name: "react-native-modal-datetime-picker", + licenseType: "MIT", + author: "Mazzarolo Matteo", + link: "https://github.com/mmazzarolo/react-native-modal-datetime-picker" + }, + { + name: "@react-native-community/datetimepicker", + licenseType: "MIT", + author: + "Martijn Swaagman (https://github.com/swaagie)", + link: "https://github.com/react-native-community/datetimepicker" + }, + { + name: "react-native-date-picker", + licenseType: "MIT", + author: "henninghall", + link: "ssh://git@github.com/henninghall/react-native-date-picker" + }, + { + name: "react-native-notification-sounds", + licenseType: "MIT", + author: "Asad Iqbal asad.dsoft@gmail.com", + link: "https://github.com/saadqbal/react-native-notification-sounds" + }, + { + name: "@flyerhq/react-native-link-preview", + licenseType: "MIT", + author: "Oleksandr Demchenko ", + link: "https://github.com/flyerhq/react-native-link-preview#readme" + }, + { + name: "@mdi/js", + licenseType: "Apache-2.0", + author: "Austin Andrews", + link: "https://github.com/Templarian/MaterialDesign-JS" + }, + { + name: "absolutify", + licenseType: "MIT", + author: + "Beau Sorensen (http://github.com/sorensen)", + link: "git://github.com/sorensen/absolutify" + }, + { + name: "buffer", + licenseType: "MIT", + author: "Feross Aboukhadijeh feross@feross.org https://feross.org", + link: "git://github.com/feross/buffer" + }, + { + name: "dayjs", + licenseType: "MIT", + author: "iamkun", + link: "https://github.com/iamkun/dayjs" + }, + { + name: "entities", + licenseType: "BSD-2-Clause", + author: "Felix Boehm ", + link: "git://github.com/fb55/entities" + }, + { + name: "html-to-text", + licenseType: "MIT", + author: "Malte Legenhausen legenhausen@werk85.de", + link: "git://github.com/html-to-text/node-html-to-text" + }, + { + name: "phone", + licenseType: "MIT", + author: "AfterShip", + link: "https://github.com/aftership/phone" + }, + { + name: "qclone", + licenseType: "MIT", + author: "Yuriy Khomenko", + link: "https://github.com/Yuriy-Khomenko/qclone" + }, + { + name: "react-native-actions-sheet", + licenseType: "MIT", + author: "ammarahm-ed", + link: "https://github.com/ammarahm-ed/react-native-actions-sheet" + }, + { + name: "react-native-check-version", + licenseType: "MIT", + author: "Flexible Agency ", + link: "n/a" + }, + { + name: "react-native-drax", + licenseType: "MIT", + author: "Joe Lafiosca ", + link: "ssh://git@github.com/nuclearpasta/react-native-drax" + }, + { + name: "react-native-image-zoom-viewer", + licenseType: "MIT", + author: "ascoders", + link: "https://github.com/ascoders/react-native-image-viewer" + }, + { + name: "react-native-progress", + licenseType: "MIT", + author: "Joel Arvidsson joel@oblador.se", + link: "git://github.com/oblador/react-native-progress" + }, + { + name: "react-native-qrcode-svg", + licenseType: "MIT", + author: "awesomejerry", + link: "ssh://git@github.com/awesomejerry/react-native-qrcode-svg" + }, + { + name: "react-native-reanimated-material-menu", + licenseType: "MIT", + author: + "Maksim Milyutin (https://github.com/mxck) & Ammar Ahmed (https://github.com/ammarahm-ed/)", + link: "n/a" + }, + { + name: "react-native-reanimated-progress-bar", + licenseType: "MIT", + author: "Serhii Tanskiy", + link: "https://github.com/serzmerz/react-native-progress-bar" + }, + { + name: "@streetwriters/showdown", + licenseType: "MIT", + author: "Estevão Santos", + link: "https://github.com/showdownjs/showdown" + }, + { + name: "toggle-switch-react-native", + licenseType: "MIT", + author: "aminebenkeroum", + link: "https://github.com/aminebenkeroum/toggle-switch-react-native" + }, + { + name: "url", + licenseType: "MIT", + author: "n/a", + link: "https://github.com/defunctzombie/node-url" + }, + { + name: "validator", + licenseType: "MIT", + author: "Chris O'Hara ", + link: "https://github.com/validatorjs/validator.js" + }, + { + name: "zustand", + licenseType: "MIT", + author: "Paul Henschel", + link: "https://github.com/pmndrs/zustand" + }, + { + name: "fflate", + licenseType: "MIT", + author: "Arjun Barrett ", + link: "https://github.com/101arrowz/fflate" + }, + { + name: "timeago.js", + licenseType: "MIT", + author: "hustcc https://timeago.org", + link: "https://github.com/hustcc/timeago.js" + } +]; diff --git a/apps/mobile/app/screens/settings/licenses.tsx b/apps/mobile/app/screens/settings/licenses.tsx new file mode 100644 index 000000000..df3025dfa --- /dev/null +++ b/apps/mobile/app/screens/settings/licenses.tsx @@ -0,0 +1,71 @@ +/* +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 React from "react"; +import { LICENSES } from "./license-data"; +import { FlatList, Linking } from "react-native"; +import { PressableButton } from "../../components/ui/pressable"; +import Heading from "../../components/ui/typography/heading"; +import { SIZE } from "../../utils/size"; +import { useThemeStore } from "../../stores/use-theme-store"; +import Paragraph from "../../components/ui/typography/paragraph"; + +type LicenseEntry = { + name: string; + licenseType: string; + author: string; + link: string; +}; + +export const Licenses = () => { + const colors = useThemeStore((state) => state.colors); + const renderItem = React.useCallback( + ({ item }: { item: LicenseEntry }) => ( + { + Linking.openURL(item.link).catch(console.log); + }} + > + {item.name} + + {item.licenseType} | {item.author?.split("<")[0]} + + + ), + [colors.nav] + ); + return ( + + ); +}; diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx index 6134f0eb5..e9224c05e 100644 --- a/apps/mobile/app/screens/settings/settings-data.tsx +++ b/apps/mobile/app/screens/settings/settings-data.tsx @@ -1088,6 +1088,14 @@ export const settingsGroups: SettingSection[] = [ } }, description: "Read our privacy policy" + }, + { + id: "licenses", + name: "Open source Licenses", + type: "screen", + component: "licenses", + description: "Open source libraries used in Notesnook", + icon: "open-source-initiative" } ] },