From 0a6ca8a80c8330bac435d69039089ff00c7c682e Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Mon, 7 Jan 2019 16:42:28 -0600 Subject: [PATCH] Beginning of moving Settings logic into respective components --- src/App.js | 2 +- src/components/ButtonCell.js | 2 +- src/components/HeaderTitleView.js | 2 +- src/components/SectionHeader.js | 2 +- src/components/SectionedAccessoryTableCell.js | 2 +- src/components/SectionedOptionsTableCell.js | 2 +- src/components/SectionedTableCell.js | 2 +- src/components/TableSection.js | 2 +- src/containers/LockedView.js | 2 +- src/containers/account/CompanySection.js | 40 ----------- src/lib/componentManager.js | 2 +- src/lib/keysManager.js | 4 +- src/lib/sfjs/authManager.js | 8 +-- src/lib/sfjs/httpManager.js | 2 +- src/lib/sfjs/syncManager.js | 4 +- src/models/extend/item.js | 2 +- src/screens/Abstract.js | 4 +- src/screens/Compose.js | 12 ++-- .../Settings/Sections}/AuthSection.js | 12 ++-- .../Settings/Sections/CompanySection.js | 72 +++++++++++++++++++ .../Settings/Sections}/EncryptionSection.js | 16 ++--- .../Settings/Sections}/OptionsSection.js | 14 ++-- .../Settings/Sections}/PasscodeSection.js | 16 ++--- .../Sections}/RegistrationConfirmSection.js | 12 ++-- src/screens/{ => Settings}/Settings.js | 71 +++++------------- src/screens/Webview.js | 6 +- src/style/StyleKit.js | 12 ++-- 27 files changed, 163 insertions(+), 164 deletions(-) delete mode 100644 src/containers/account/CompanySection.js rename src/{containers/account => screens/Settings/Sections}/AuthSection.js (93%) create mode 100644 src/screens/Settings/Sections/CompanySection.js rename src/{containers/account => screens/Settings/Sections}/EncryptionSection.js (82%) rename src/{containers/account => screens/Settings/Sections}/OptionsSection.js (86%) rename src/{containers/account => screens/Settings/Sections}/PasscodeSection.js (88%) rename src/{containers/account => screens/Settings/Sections}/RegistrationConfirmSection.js (83%) rename src/screens/{ => Settings}/Settings.js (86%) diff --git a/src/App.js b/src/App.js index 0e549deb..f2766191 100644 --- a/src/App.js +++ b/src/App.js @@ -19,7 +19,7 @@ import Notes from "@Screens/Notes/Notes" import NotesTablet from "@Screens/Notes/NotesTablet" import MainSideMenu from "@SideMenu/MainSideMenu" import NoteSideMenu from "@SideMenu/NoteSideMenu" -import Settings from "@Screens/Settings" +import Settings from "@Screens/Settings/Settings" import InputModal from "@Screens/InputModal" import Authenticate from "@Screens/Authentication/Authenticate" diff --git a/src/components/ButtonCell.js b/src/components/ButtonCell.js index 52efc681..9f062998 100644 --- a/src/components/ButtonCell.js +++ b/src/components/ButtonCell.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import {TouchableHighlight, Text, View} from 'react-native'; import SectionedTableCell from './SectionedTableCell' -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" export default class ButtonCell extends SectionedTableCell { diff --git a/src/components/HeaderTitleView.js b/src/components/HeaderTitleView.js index b67c6f98..60caadc7 100644 --- a/src/components/HeaderTitleView.js +++ b/src/components/HeaderTitleView.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import {DeviceEventEmitter, Modal, View, Text} from 'react-native'; -import StyleKit from "../style/StyleKit"; +import StyleKit from "@Style/StyleKit"; import PlatformStyles from "../models/PlatformStyles"; export default class HeaderTitleView extends Component { diff --git a/src/components/SectionHeader.js b/src/components/SectionHeader.js index 40491389..57b9e331 100644 --- a/src/components/SectionHeader.js +++ b/src/components/SectionHeader.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import {Text, Platform, View, TouchableOpacity} from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" import ThemedComponent from "@Components/ThemedComponent" export default class SectionHeader extends ThemedComponent { diff --git a/src/components/SectionedAccessoryTableCell.js b/src/components/SectionedAccessoryTableCell.js index a67edf6c..b548deb4 100644 --- a/src/components/SectionedAccessoryTableCell.js +++ b/src/components/SectionedAccessoryTableCell.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import {View, Image, Text, TouchableHighlight, Platform} from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" import SectionedTableCell from "./SectionedTableCell" import Icon from 'react-native-vector-icons/Ionicons'; diff --git a/src/components/SectionedOptionsTableCell.js b/src/components/SectionedOptionsTableCell.js index a55950e5..e895a5da 100644 --- a/src/components/SectionedOptionsTableCell.js +++ b/src/components/SectionedOptionsTableCell.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import {View, Text, TouchableHighlight} from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" export default class SectionedOptionsTableCell extends Component { diff --git a/src/components/SectionedTableCell.js b/src/components/SectionedTableCell.js index c2a9831c..4b195edc 100644 --- a/src/components/SectionedTableCell.js +++ b/src/components/SectionedTableCell.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import {View} from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" export default class SectionedTableCell extends Component { diff --git a/src/components/TableSection.js b/src/components/TableSection.js index 82fc28ef..9146298f 100644 --- a/src/components/TableSection.js +++ b/src/components/TableSection.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import {View} from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" export default class TableSection extends Component { diff --git a/src/containers/LockedView.js b/src/containers/LockedView.js index 39322327..4d448e48 100644 --- a/src/containers/LockedView.js +++ b/src/containers/LockedView.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { StyleSheet, View, Text } from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" import Icon from 'react-native-vector-icons/Ionicons'; export default class LockedView extends Component { diff --git a/src/containers/account/CompanySection.js b/src/containers/account/CompanySection.js deleted file mode 100644 index 7f9ddd14..00000000 --- a/src/containers/account/CompanySection.js +++ /dev/null @@ -1,40 +0,0 @@ -import React, { Component } from 'react'; -import StyleKit from "../../style/StyleKit" -import ApplicationState from "@Lib/ApplicationState" -import {TextInput, View, Text, Platform} from 'react-native'; - -import SectionHeader from "../../components/SectionHeader"; -import ButtonCell from "../../components/ButtonCell"; -import TableSection from "../../components/TableSection"; -import SectionedTableCell from "../../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../../components/SectionedAccessoryTableCell"; - -export default class CompanySection extends Component { - render() { - let storeName = Platform.OS == 'android' ? "Play Store" : "App Store"; - return ( - - - - - this.props.onAction("help")} /> - - this.props.onAction("feedback")} /> - - this.props.onAction("friend")} /> - - this.props.onAction("learn_more")} /> - - this.props.onAction("privacy")} /> - - this.props.onAction("rate")} > - - Version {ApplicationState.version} - Help support us with a review on the {storeName}. - - - - - ); - } -} diff --git a/src/lib/componentManager.js b/src/lib/componentManager.js index a08700a7..b48051bd 100644 --- a/src/lib/componentManager.js +++ b/src/lib/componentManager.js @@ -3,7 +3,7 @@ let ClientDataDomain = "org.standardnotes.sn.components"; import { Platform } from 'react-native'; -import StyleKit from '../style/StyleKit' +import StyleKit from '@Style/StyleKit' import ModelManager from './sfjs/modelManager' import Sync from './sfjs/syncManager' import SF from "./sfjs/sfjs" diff --git a/src/lib/keysManager.js b/src/lib/keysManager.js index 27aab673..33156cf2 100644 --- a/src/lib/keysManager.js +++ b/src/lib/keysManager.js @@ -371,8 +371,8 @@ export default class KeysManager { static getDeviceBiometricsAvailability(callback) { let isAndroid = Platform.OS == "android"; - if(__DEV__ && isAndroid) { - callback(true, "touch", "Fingerprint"); + if(__DEV__) { + callback(true, "touch", "Fingerprint (Dev)"); return; } FingerprintScanner.isSensorAvailable().then((type) => { diff --git a/src/lib/sfjs/authManager.js b/src/lib/sfjs/authManager.js index 4143d001..d78fbc6b 100644 --- a/src/lib/sfjs/authManager.js +++ b/src/lib/sfjs/authManager.js @@ -1,8 +1,8 @@ import {Platform} from 'react-native'; -import KeysManager from "../keysManager" -import Storage from './storageManager' -import Server from './httpManager' -import AlertManager from './alertManager' +import KeysManager from "@Lib/keysManager" +import Storage from '@SFJS/storageManager' +import Server from '@SFJS/httpManager' +import AlertManager from '@SFJS/alertManager' export default class Auth extends SFAuthManager { diff --git a/src/lib/sfjs/httpManager.js b/src/lib/sfjs/httpManager.js index 3368f3c3..234dd38b 100644 --- a/src/lib/sfjs/httpManager.js +++ b/src/lib/sfjs/httpManager.js @@ -1,4 +1,4 @@ -import KeysManager from '../keysManager' +import KeysManager from '@Lib/keysManager' export default class Server extends SFHttpManager { diff --git a/src/lib/sfjs/syncManager.js b/src/lib/sfjs/syncManager.js index 9606eb41..89b1677d 100644 --- a/src/lib/sfjs/syncManager.js +++ b/src/lib/sfjs/syncManager.js @@ -4,8 +4,8 @@ import ModelManager from './modelManager' import Storage from './storageManager' import AlertManager from './alertManager' -import Auth from '../sfjs/authManager' -import KeysManager from '../keysManager' +import Auth from '@SFJS/authManager' +import KeysManager from '@Lib/keysManager' export default class Sync extends SFSyncManager { diff --git a/src/models/extend/item.js b/src/models/extend/item.js index 980e572c..46f45361 100644 --- a/src/models/extend/item.js +++ b/src/models/extend/item.js @@ -1,4 +1,4 @@ -import moment from "../../lib/moment"; +import moment from "@Lib/moment"; // Override Item instance methods without overriding actual class, since we'd then need // to override all individual classes, like Note and Tag. diff --git a/src/screens/Abstract.js b/src/screens/Abstract.js index c67506b1..66e4154f 100644 --- a/src/screens/Abstract.js +++ b/src/screens/Abstract.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import {DeviceEventEmitter, Modal, View, Text} from 'react-native'; -import StyleKit from "../style/StyleKit"; +import StyleKit from "@Style/StyleKit"; import ApplicationState from "@Lib/ApplicationState" -import HeaderTitleView from "../components/HeaderTitleView" +import HeaderTitleView from "@Components/HeaderTitleView" import HeaderButtons, { HeaderButton, Item } from 'react-navigation-header-buttons'; import Icon from 'react-native-vector-icons/Ionicons'; import ThemedComponent from "@Components/ThemedComponent"; diff --git a/src/screens/Compose.js b/src/screens/Compose.js index b5e26e06..766ff115 100644 --- a/src/screens/Compose.js +++ b/src/screens/Compose.js @@ -1,17 +1,17 @@ import React, { Component } from 'react'; -import Sync from '../lib/sfjs/syncManager' -import ModelManager from '../lib/sfjs/modelManager' -import Auth from '../lib/sfjs/authManager' +import Sync from '@Lib/sfjs/syncManager' +import ModelManager from '@Lib/sfjs/modelManager' +import Auth from '@Lib/sfjs/authManager' import OptionsState from "@Lib/OptionsState" import SideMenuManager from "@SideMenu/SideMenuManager" import Abstract from "./Abstract" import Webview from "./Webview" -import ComponentManager from '../lib/componentManager' +import ComponentManager from '@Lib/componentManager' import Icons from '@Style/Icons'; import ApplicationState from "@Lib/ApplicationState" -import LockedView from "../containers/LockedView"; +import LockedView from "@Containers/LockedView"; import Icon from 'react-native-vector-icons/Ionicons'; import TextView from "sn-textview"; @@ -28,7 +28,7 @@ import { Dimensions } from 'react-native'; -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" export default class Compose extends Abstract { diff --git a/src/containers/account/AuthSection.js b/src/screens/Settings/Sections/AuthSection.js similarity index 93% rename from src/containers/account/AuthSection.js rename to src/screens/Settings/Sections/AuthSection.js index 23d61589..31240fbd 100644 --- a/src/containers/account/AuthSection.js +++ b/src/screens/Settings/Sections/AuthSection.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; import {TextInput, View, Text} from 'react-native'; -import StyleKit from "../../style/StyleKit" +import StyleKit from "@Style/StyleKit" -import SectionHeader from "../../components/SectionHeader"; -import ButtonCell from "../../components/ButtonCell"; -import TableSection from "../../components/TableSection"; -import SectionedTableCell from "../../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../../components/SectionedAccessoryTableCell"; +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; const DEFAULT_SIGN_IN_TEXT = "Sign In"; const DEFAULT_REGISTER_TEXT = "Register"; diff --git a/src/screens/Settings/Sections/CompanySection.js b/src/screens/Settings/Sections/CompanySection.js new file mode 100644 index 00000000..c2d59b6c --- /dev/null +++ b/src/screens/Settings/Sections/CompanySection.js @@ -0,0 +1,72 @@ +import React, { Component } from 'react'; +import StyleKit from "@Style/StyleKit" +import ApplicationState from "@Lib/ApplicationState" +import {TextInput, View, Text, Platform, Share, Linking} from 'react-native'; + +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; + +export default class CompanySection extends Component { + + onAction = (action) => { + if(action == "feedback") { + var platformString = Platform.OS == "android" ? "Android" : "iOS"; + Linking.openURL(`mailto:hello@standardnotes.org?subject=${platformString} app feedback (v${ApplicationState.version})`); + } else if(action == "learn_more") { + Linking.openURL("https://standardnotes.org"); + } else if(action == "privacy") { + Linking.openURL("https://standardnotes.org/privacy"); + } else if(action == "help") { + Linking.openURL("https://standardnotes.org/help"); + } else if(action == "rate") { + if(ApplicationState.isIOS) { + Linking.openURL("https://itunes.apple.com/us/app/standard-notes/id1285392450?ls=1&mt=8"); + } else { + Linking.openURL("market://details?id=com.standardnotes"); + } + } else if(action == "friend") { + let title = "Standard Notes"; + var message = "Check out Standard Notes, a free, open-source, and completely encrypted notes app."; + let url = "https://standardnotes.org"; + // Android ignores url. iOS ignores title. + if(ApplicationState.isAndroid) { + message += "\n\nhttps://standardnotes.org"; + } + + ApplicationState.get().performActionWithoutStateChangeImpact(() => { + Share.share({title: title, message: message, url: url}) + }) + } + } + + render() { + let storeName = Platform.OS == 'android' ? "Play Store" : "App Store"; + return ( + + + + + this.onAction("help")} /> + + this.onAction("feedback")} /> + + this.onAction("friend")} /> + + this.onAction("learn_more")} /> + + this.onAction("privacy")} /> + + this.onAction("rate")} > + + Version {ApplicationState.version} + Help support us with a review on the {storeName}. + + + + + ); + } +} diff --git a/src/containers/account/EncryptionSection.js b/src/screens/Settings/Sections/EncryptionSection.js similarity index 82% rename from src/containers/account/EncryptionSection.js rename to src/screens/Settings/Sections/EncryptionSection.js index 3b3d7088..70e576a2 100644 --- a/src/containers/account/EncryptionSection.js +++ b/src/screens/Settings/Sections/EncryptionSection.js @@ -1,14 +1,14 @@ import React, { Component } from 'react'; -import StyleKit from "../../style/StyleKit" +import StyleKit from "@Style/StyleKit" import {Text, View} from 'react-native'; -import KeysManager from "../../lib/keysManager" -import ModelManager from "../../lib/sfjs/modelManager" +import KeysManager from "@Lib/keysManager" +import ModelManager from "@Lib/sfjs/modelManager" -import SectionHeader from "../../components/SectionHeader"; -import ButtonCell from "../../components/ButtonCell"; -import TableSection from "../../components/TableSection"; -import SectionedTableCell from "../../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../../components/SectionedAccessoryTableCell"; +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; export default class PasscodeSection extends Component { diff --git a/src/containers/account/OptionsSection.js b/src/screens/Settings/Sections/OptionsSection.js similarity index 86% rename from src/containers/account/OptionsSection.js rename to src/screens/Settings/Sections/OptionsSection.js index a7c7d7a0..437fee59 100644 --- a/src/containers/account/OptionsSection.js +++ b/src/screens/Settings/Sections/OptionsSection.js @@ -1,13 +1,13 @@ import React, { Component } from 'react'; import {Alert} from 'react-native'; -import StyleKit from "../../style/StyleKit" +import StyleKit from "@Style/StyleKit" import {TextInput, View, Text} from 'react-native'; -import SectionHeader from "../../components/SectionHeader"; -import ButtonCell from "../../components/ButtonCell"; -import TableSection from "../../components/TableSection"; -import SectionedTableCell from "../../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../../components/SectionedAccessoryTableCell"; -import SectionedOptionsTableCell from "../../components/SectionedOptionsTableCell"; +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; +import SectionedOptionsTableCell from "@Components/SectionedOptionsTableCell"; import moment from "@Lib/moment" diff --git a/src/containers/account/PasscodeSection.js b/src/screens/Settings/Sections/PasscodeSection.js similarity index 88% rename from src/containers/account/PasscodeSection.js rename to src/screens/Settings/Sections/PasscodeSection.js index 5783626d..87d01206 100644 --- a/src/containers/account/PasscodeSection.js +++ b/src/screens/Settings/Sections/PasscodeSection.js @@ -1,17 +1,17 @@ import React, { Component } from 'react'; -import StyleKit from "../../style/StyleKit" +import StyleKit from "@Style/StyleKit" import {TextInput, View, Alert, Text} from 'react-native'; -import SectionHeader from "../../components/SectionHeader"; -import ButtonCell from "../../components/ButtonCell"; -import TableSection from "../../components/TableSection"; -import SectionedTableCell from "../../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../../components/SectionedAccessoryTableCell"; -import SectionedOptionsTableCell from "../../components/SectionedOptionsTableCell"; +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; +import SectionedOptionsTableCell from "@Components/SectionedOptionsTableCell"; import ApplicationState from "@Lib/ApplicationState" import FingerprintScanner from 'react-native-fingerprint-scanner'; -import KeysManager from "../../lib/keysManager" +import KeysManager from "@Lib/keysManager" export default class PasscodeSection extends Component { diff --git a/src/containers/account/RegistrationConfirmSection.js b/src/screens/Settings/Sections/RegistrationConfirmSection.js similarity index 83% rename from src/containers/account/RegistrationConfirmSection.js rename to src/screens/Settings/Sections/RegistrationConfirmSection.js index ef7364bd..f96a2c2c 100644 --- a/src/containers/account/RegistrationConfirmSection.js +++ b/src/screens/Settings/Sections/RegistrationConfirmSection.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; -import StyleKit from "../../style/StyleKit" +import StyleKit from "@Style/StyleKit" import {TextInput, Text, View, Alert} from 'react-native'; -import SectionHeader from "../../components/SectionHeader"; -import ButtonCell from "../../components/ButtonCell"; -import TableSection from "../../components/TableSection"; -import SectionedTableCell from "../../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../../components/SectionedAccessoryTableCell"; +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; export default class RegistrationConfirmSection extends Component { constructor(props) { diff --git a/src/screens/Settings.js b/src/screens/Settings/Settings.js similarity index 86% rename from src/screens/Settings.js rename to src/screens/Settings/Settings.js index f24a8a55..e5b39b51 100644 --- a/src/screens/Settings.js +++ b/src/screens/Settings/Settings.js @@ -1,34 +1,35 @@ import React, { Component } from 'react'; import {ScrollView, View, Alert, Keyboard, Linking, Platform, Share, NativeModules} from 'react-native'; -import Sync from '../lib/sfjs/syncManager' +import Sync from '@SFJS/syncManager' import ModelManager from '@SFJS/modelManager' -import AlertManager from '../lib/sfjs/alertManager' +import AlertManager from '@SFJS/alertManager' import SF from '@SFJS/sfjs' import Storage from "@SFJS/storageManager" -import Auth from '../lib/sfjs/authManager' +import Auth from '@SFJS/authManager' import KeysManager from '@Lib/keysManager' -import UserPrefsManager from '../lib/userPrefsManager' +import UserPrefsManager from '@Lib/userPrefsManager' import OptionsState from "@Lib/OptionsState" import ApplicationState from "@Lib/ApplicationState" import StyleKit from "@Style/StyleKit" import BackupsManager from "@Lib/BackupsManager" -import SectionHeader from "../components/SectionHeader"; -import ButtonCell from "../components/ButtonCell"; -import TableSection from "../components/TableSection"; -import SectionedTableCell from "../components/SectionedTableCell"; -import SectionedAccessoryTableCell from "../components/SectionedAccessoryTableCell"; -import Abstract from "./Abstract" +import SectionHeader from "@Components/SectionHeader"; +import ButtonCell from "@Components/ButtonCell"; +import TableSection from "@Components/TableSection"; +import SectionedTableCell from "@Components/SectionedTableCell"; +import SectionedAccessoryTableCell from "@Components/SectionedAccessoryTableCell"; +import Abstract from "@Screens/Abstract" import Authenticate from "@Screens/Authentication/Authenticate" -import AuthSection from "../containers/account/AuthSection" -import RegistrationConfirmSection from "../containers/account/RegistrationConfirmSection" -import OptionsSection from "../containers/account/OptionsSection" -import PasscodeSection from "../containers/account/PasscodeSection" -import EncryptionSection from "../containers/account/EncryptionSection" -import CompanySection from "../containers/account/CompanySection" -import LockedView from "../containers/LockedView"; +import LockedView from "@Containers/LockedView"; + +import AuthSection from "@Screens/Settings/Sections/AuthSection" +import RegistrationConfirmSection from "@Screens/Settings/Sections/RegistrationConfirmSection" +import OptionsSection from "@Screens/Settings/Sections/OptionsSection" +import PasscodeSection from "@Screens/Settings/Sections/PasscodeSection" +import EncryptionSection from "@Screens/Settings/Sections/EncryptionSection" +import CompanySection from "@Screens/Settings/Sections/CompanySection" export default class Settings extends Abstract { @@ -386,37 +387,6 @@ export default class Settings extends Abstract { }); } - onCompanyAction = (action) => { - if(action == "feedback") { - var platformString = Platform.OS == "android" ? "Android" : "iOS"; - Linking.openURL(`mailto:hello@standardnotes.org?subject=${platformString} app feedback (v${ApplicationState.version})`); - } else if(action == "learn_more") { - Linking.openURL("https://standardnotes.org"); - } else if(action == "privacy") { - Linking.openURL("https://standardnotes.org/privacy"); - } else if(action == "help") { - Linking.openURL("https://standardnotes.org/help"); - } else if(action == "rate") { - if(ApplicationState.isIOS) { - Linking.openURL("https://itunes.apple.com/us/app/standard-notes/id1285392450?ls=1&mt=8"); - } else { - Linking.openURL("market://details?id=com.standardnotes"); - } - } else if(action == "friend") { - let title = "Standard Notes"; - var message = "Check out Standard Notes, a free, open-source, and completely encrypted notes app."; - let url = "https://standardnotes.org"; - // Android ignores url. iOS ignores title. - if(ApplicationState.isAndroid) { - message += "\n\nhttps://standardnotes.org"; - } - - ApplicationState.get().performActionWithoutStateChangeImpact(() => { - Share.share({title: title, message: message, url: url}) - }) - } - } - onSortChange = (key) => { this.options.setSortBy(key); this.forceUpdate(); @@ -534,10 +504,7 @@ export default class Settings extends Abstract { title={"Encryption Status"} /> - + diff --git a/src/screens/Webview.js b/src/screens/Webview.js index 144b4cd7..595b917a 100644 --- a/src/screens/Webview.js +++ b/src/screens/Webview.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import { Alert, View, WebView, Linking, Platform } from 'react-native'; -import ComponentManager from '../lib/componentManager' -import ModelManager from '../lib/sfjs/modelManager' +import ComponentManager from '@Lib/componentManager' +import ModelManager from '@Lib/sfjs/modelManager' -import StyleKit from "../style/StyleKit" +import StyleKit from "@Style/StyleKit" import ApplicationState from "@Lib/ApplicationState" diff --git a/src/style/StyleKit.js b/src/style/StyleKit.js index 725f8f53..949b08be 100644 --- a/src/style/StyleKit.js +++ b/src/style/StyleKit.js @@ -1,11 +1,11 @@ import { StyleSheet, StatusBar, Alert, Platform, Dimensions } from 'react-native'; -import ModelManager from "../lib/sfjs/modelManager" -import Server from "../lib/sfjs/httpManager" -import Sync from '../lib/sfjs/syncManager' +import ModelManager from "@Lib/sfjs/modelManager" +import Server from "@Lib/sfjs/httpManager" +import Sync from '@Lib/sfjs/syncManager' import { SFItemParams } from 'standard-file-js'; -import Storage from "../lib/sfjs/storageManager" -import Auth from "../lib/sfjs/authManager" -import KeysManager from '../lib/keysManager' +import Storage from "@Lib/sfjs/storageManager" +import Auth from "@Lib/sfjs/authManager" +import KeysManager from '@Lib/keysManager' import CSSParser from "@Style/Util/CSSParser"; import ThemeDownloader from "@Style/Util/ThemeDownloader" import Icons from '@Style/Icons';