This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial setup - exposure history (#1513)
* initial setup * add icon
- Loading branch information
Showing
9 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React, {useCallback} from 'react'; | ||
import {StyleSheet} from 'react-native'; | ||
import {useI18n} from 'locale'; | ||
import {ExposureHistoryData} from 'shared/qr'; | ||
import {useNavigation} from '@react-navigation/native'; | ||
import {Box, Text, Icon, Toolbar} from 'components'; | ||
import {SafeAreaView} from 'react-native-safe-area-context'; | ||
import {ScrollView} from 'react-native-gesture-handler'; | ||
|
||
const ExposureList = ({exposureHistoryData}: {exposureHistoryData: ExposureHistoryData[]}) => { | ||
return ( | ||
<> | ||
{Object.keys(exposureHistoryData).map(item => { | ||
return <Box key={item} />; | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
const NoExposureHistoryScreen = () => { | ||
const i18n = useI18n(); | ||
|
||
return ( | ||
<Box style={styles.noExposureHistoryScreen} marginTop="xl"> | ||
<Icon height={120} width={150} name="exposure-history-thumb" /> | ||
<Text paddingTop="s" fontWeight="bold"> | ||
{i18n.translate('ExposureHistory.NoExposures')} | ||
</Text> | ||
</Box> | ||
); | ||
}; | ||
|
||
export const ExposureHistoryScreen = () => { | ||
const i18n = useI18n(); | ||
const exposureHistory = []; | ||
const navigation = useNavigation(); | ||
const back = useCallback(() => navigation.goBack(), [navigation]); | ||
|
||
return ( | ||
<Box flex={1} backgroundColor="overlayBackground"> | ||
<SafeAreaView style={styles.flex}> | ||
<Toolbar title="" navIcon="icon-back-arrow" navText={i18n.translate('PlacesLog.Back')} onIconClicked={back} /> | ||
<ScrollView style={styles.flex}> | ||
<Box paddingHorizontal="m"> | ||
<Text variant="bodyTitle" marginBottom="l" accessibilityRole="header"> | ||
{i18n.translate('ExposureHistory.Title')} | ||
</Text> | ||
<Text>{i18n.translate('ExposureHistory.Body')}</Text> | ||
</Box> | ||
|
||
{exposureHistory.length === 0 ? ( | ||
<NoExposureHistoryScreen /> | ||
) : ( | ||
<> | ||
<Box paddingHorizontal="xxs" marginLeft="m" marginRight="m" paddingBottom="m"> | ||
<ExposureList exposureHistoryData={[]} /> | ||
</Box> | ||
</> | ||
)} | ||
</ScrollView> | ||
</SafeAreaView> | ||
</Box> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
boxStyle: { | ||
flex: 1, | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
}, | ||
bottomBorder: { | ||
borderBottomColor: '#8a8a8a', | ||
borderBottomWidth: 1, | ||
}, | ||
textBox: { | ||
flex: 1, | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
}, | ||
radius: { | ||
borderRadius: 10, | ||
}, | ||
noExposureHistoryScreen: { | ||
flex: 1, | ||
alignItems: 'center', | ||
}, | ||
flex: { | ||
flex: 1, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters