Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded sample app #596

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions example/.editorconfig

This file was deleted.

4 changes: 2 additions & 2 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
root: true,
extends: ['@react-native-community', 'eslint-config-prettier'],
};
4 changes: 4 additions & 0 deletions example/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}
2 changes: 0 additions & 2 deletions example/.gitattributes

This file was deleted.

40 changes: 27 additions & 13 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
node_modules/
.expo/
dist/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store

# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
# The following patterns were generated by expo-cli

# OSX
#
.DS_Store
Expand All @@ -20,6 +38,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -42,20 +61,15 @@ buck-out/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
# Bundle artifacts
*.jsbundle

# CocoaPods
/ios/Pods/
/ios/Podfile.lock

# Expo
.expo/
web-build/
dist/

# @end expo-cli
1 change: 0 additions & 1 deletion example/.watchmanconfig

This file was deleted.

109 changes: 0 additions & 109 deletions example/App.js

This file was deleted.

60 changes: 60 additions & 0 deletions example/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import 'react-native-gesture-handler';

import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {SafeAreaProvider} from 'react-native-safe-area-context';

import * as FileSystem from 'expo-file-system';

import Browser from './components/Browser';
import PDFViewer from './components/PDFViewer';

if (typeof Intl === 'undefined') {
require('intl');
require('intl/locale-data/jsonp/en');
}

type StackParams = {
Browser: {currDir: string; path: string};
PDFViewer: {currDir: string; path: string};
MiscFileViewer: {currDir: string; path: string};
};

const Stack = createStackNavigator<StackParams>();

export default function App() {
const root: string = FileSystem.documentDirectory || '';
const path = root.endsWith('/') ? root.substring(0, root.length - 1) : root;

return (
<SafeAreaProvider>
<NavigationContainer>
<Stack.Navigator
initialRouteName="Browser"
screenOptions={{
headerShown: false,
}}>
<Stack.Screen
name="Browser"
component={Browser}
initialParams={{
path: path,
currDir: 'Browser',
}}
options={({route}) => ({
title: route?.params?.currDir || 'Browser',
})}
/>
<Stack.Screen
name="PDFViewer"
component={PDFViewer}
options={({route}) => ({
title: route?.params?.currDir || 'PDFViewer',
})}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaProvider>
);
}
21 changes: 21 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# OSX
#
.DS_Store

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# Bundle artifacts
*.jsbundle
File renamed without changes.
Loading