Organize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import { RealmProvider } from '@realm/react';
|
|||||||
import { lightTheme, darkTheme } from './theme';
|
import { lightTheme, darkTheme } from './theme';
|
||||||
import { Meme, Tag } from './database';
|
import { Meme, Tag } from './database';
|
||||||
import NavigationContainer from './navigation';
|
import NavigationContainer from './navigation';
|
||||||
import { SettingsProvider } from './contexts/settings';
|
import { SettingsProvider } from './contexts';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const colorScheme = useColorScheme();
|
const colorScheme = useColorScheme();
|
||||||
|
@@ -7,8 +7,6 @@ import React, {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import { Settings } from '../types';
|
import { Settings } from '../types';
|
||||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||||
import { LoadingView } from '../components';
|
|
||||||
import WelcomeScreen from '../screens/welcome';
|
|
||||||
import { AndroidScoped, FileSystem } from 'react-native-file-access';
|
import { AndroidScoped, FileSystem } from 'react-native-file-access';
|
||||||
import {
|
import {
|
||||||
getPersistedUriPermissions,
|
getPersistedUriPermissions,
|
||||||
@@ -16,10 +14,10 @@ import {
|
|||||||
createFile,
|
createFile,
|
||||||
deleteFile,
|
deleteFile,
|
||||||
} from 'react-native-scoped-storage';
|
} from 'react-native-scoped-storage';
|
||||||
import {
|
import { Settings } from '../types';
|
||||||
clearPermissions,
|
import { LoadingView } from '../components';
|
||||||
isPermissionForPath,
|
import { Welcome } from '../screens';
|
||||||
} from '../utilities/permissions';
|
import { clearPermissions, isPermissionForPath } from '../utilities';
|
||||||
|
|
||||||
interface SettingsContextType {
|
interface SettingsContextType {
|
||||||
settings: Settings;
|
settings: Settings;
|
||||||
@@ -115,7 +113,7 @@ function SettingsProvider({ children }: { children: ReactNode }) {
|
|||||||
<SettingsContext.Provider value={{ settings, setSettings: updateSettings }}>
|
<SettingsContext.Provider value={{ settings, setSettings: updateSettings }}>
|
||||||
{hasLoaded ? (
|
{hasLoaded ? (
|
||||||
settings.storageUri === '' ? (
|
settings.storageUri === '' ? (
|
||||||
<WelcomeScreen
|
<Welcome
|
||||||
selectStorageLocation={() => {
|
selectStorageLocation={() => {
|
||||||
void openDocumentTree(true).then(uri => {
|
void openDocumentTree(true).then(uri => {
|
||||||
updateSettings({ storageUri: uri.uri });
|
updateSettings({ storageUri: uri.uri });
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
export { default as AddItem } from './addItem';
|
export { default as AddItem } from './addItem';
|
||||||
export { default as Home } from './home';
|
export { default as Home } from './home';
|
||||||
export { default as Search } from './search';
|
export { default as Search } from './search';
|
||||||
export { default as Tags } from './tags';
|
|
||||||
export { default as Settings } from './settings';
|
export { default as Settings } from './settings';
|
||||||
|
export { default as Tags } from './tags';
|
||||||
|
export { default as Welcome } from './welcome';
|
||||||
|
@@ -3,7 +3,7 @@ import { Button, Text } from 'react-native-paper';
|
|||||||
import { PaddedView } from '../components';
|
import { PaddedView } from '../components';
|
||||||
import styles from '../styles';
|
import styles from '../styles';
|
||||||
|
|
||||||
const WelcomeScreen = (properties: { selectStorageLocation: () => void }) => {
|
const Welcome = (properties: { selectStorageLocation: () => void }) => {
|
||||||
return (
|
return (
|
||||||
<PaddedView centered>
|
<PaddedView centered>
|
||||||
<Text
|
<Text
|
||||||
@@ -18,4 +18,4 @@ const WelcomeScreen = (properties: { selectStorageLocation: () => void }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default WelcomeScreen;
|
export default Welcome;
|
||||||
|
Reference in New Issue
Block a user