Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #104 from ito-org/screen-upload
Browse files Browse the repository at this point in the history
added screen upload
  • Loading branch information
haveyaseen authored Apr 20, 2020
2 parents 6e8a90e + 36a2c25 commit a3b1874
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 70 deletions.
9 changes: 6 additions & 3 deletions App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import {Endangerment} from './screens/Endangerment';
import {BluetoothNotification} from './screens/BluetoothNotification';
import {SymptomInfo} from './screens/SymptomInfo';
import {DataUpload} from './screens/DataUpload';
import {ConfirmationCode} from './screens/ConfirmationCode';
import {AlphaPositiveResult} from './screens/AlphaPositiveResult';
import {IDMatch} from './screens/IDMatch';
import AsyncStorage from '@react-native-community/async-storage'; // eslint-disable-line @typescript-eslint/no-unused-vars
import {PositiveResult} from './screens/PositiveResult';
import {Upload} from './screens/Upload';
import {Home} from './screens/Home';

const Stack = createStackNavigator();

Expand All @@ -39,11 +40,12 @@ export type RootStackParamList = {
Endangerment: undefined;
BluetoothNotification: undefined;
SymptomInfo: undefined;
ConfirmationCode: undefined;
DataUpload: undefined;
AlphaPositiveResult: undefined;
IDMatch: undefined;
PositiveResult: undefined;
Upload: undefined;
Home: undefined;
};

declare const global: {HermesInternal: null | {}};
Expand All @@ -66,6 +68,8 @@ export const App: React.FC<void> = () => {
<Stack.Screen name="HomeBluetooth" component={HomeBluetooth} />
<Stack.Screen name="Endangerment" component={Endangerment} />
<Stack.Screen name="PositiveResult" component={PositiveResult} />
<Stack.Screen name="Upload" component={Upload} />
<Stack.Screen name="Home" component={Home} />
<Stack.Screen
name="BluetoothNotification"
component={BluetoothNotification}
Expand All @@ -77,7 +81,6 @@ export const App: React.FC<void> = () => {
name="AlphaPositiveResult"
component={AlphaPositiveResult}
/>
<Stack.Screen name="ConfirmationCode" component={ConfirmationCode} />
<Stack.Screen name="DataUpload" component={DataUpload} />
</Stack.Navigator>
</NavigationContainer>
Expand Down
15 changes: 2 additions & 13 deletions App/screens/AlphaPositiveResult.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Text, View, StyleSheet, NativeModules} from 'react-native';
import {Text, View, StyleSheet} from 'react-native';
import {StackNavigationProp} from '@react-navigation/stack';
import {RootStackParamList} from 'App/App';
import {BasicButton} from '../components/BasicButton';
Expand Down Expand Up @@ -70,18 +70,7 @@ export const AlphaPositiveResult: React.FC<{
<View style={styles.buttonContainer}>
<BasicButton
title={t('alphaPositiveResult.buttonTitleReleaseResult')}
onPress={(): void => {
const now = Date.now() / 1000;
const sevenDaysAgo = now - 7 * 24 * 60 * 60;
NativeModules.ItoBluetooth.publishBeaconUUIDs(
sevenDaysAgo,
now,
(success: boolean) => {
console.log('upload ' + success ? 'succeeded' : 'failed');
},
);
navigation.navigate('PositiveResult');
}}
onPress={(): void => navigation.navigate('PositiveResult')}
/>
</View>
</View>
Expand Down
43 changes: 0 additions & 43 deletions App/screens/ConfirmationCode.tsx

This file was deleted.

Loading

0 comments on commit a3b1874

Please sign in to comment.