-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docs/infra-cli
- Loading branch information
Showing
27 changed files
with
477 additions
and
89 deletions.
There are no files selected for viewing
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
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
Binary file added
BIN
+21.8 KB
apps/native/app/src/assets/illustrations/digital-services-m1-dots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.6 KB
apps/native/app/src/assets/illustrations/digital-services-m1-dots@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+112 KB
apps/native/app/src/assets/illustrations/digital-services-m1-dots@3x.png
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
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,143 @@ | ||
import { Button, Typography, NavigationBarSheet } from '@ui' | ||
import React, { useEffect } from 'react' | ||
import { useIntl, FormattedMessage } from 'react-intl' | ||
import { View, Image, SafeAreaView, Linking } from 'react-native' | ||
import styled from 'styled-components/native' | ||
import { | ||
Navigation, | ||
NavigationFunctionComponent, | ||
} from 'react-native-navigation' | ||
import { createNavigationOptionHooks } from '../../hooks/create-navigation-option-hooks' | ||
import logo from '../../assets/logo/logo-64w.png' | ||
import illustrationSrc from '../../assets/illustrations/digital-services-m1-dots.png' | ||
import { isIos } from '../../utils/devices' | ||
import { preferencesStore } from '../../stores/preferences-store' | ||
|
||
const Text = styled.View` | ||
margin-horizontal: ${({ theme }) => theme.spacing[7]}px; | ||
text-align: center; | ||
margin-vertical: ${({ theme }) => theme.spacing[5]}px; | ||
` | ||
|
||
const Host = styled.View` | ||
justify-content: center; | ||
align-items: center; | ||
flex: 1; | ||
` | ||
|
||
const ButtonWrapper = styled.View` | ||
padding-horizontal: ${({ theme }) => theme.spacing[2]}px; | ||
padding-vertical: ${({ theme }) => theme.spacing[4]}px; | ||
gap: ${({ theme }) => theme.spacing[1]}px; | ||
` | ||
|
||
const Title = styled(Typography)` | ||
padding-horizontal: ${({ theme }) => theme.spacing[2]}px; | ||
margin-bottom: ${({ theme }) => theme.spacing[2]}px; | ||
` | ||
|
||
const { getNavigationOptions, useNavigationOptions } = | ||
createNavigationOptionHooks(() => ({ | ||
topBar: { | ||
visible: false, | ||
}, | ||
hardwareBackButton: { | ||
dismissModalOnPress: false, | ||
}, | ||
})) | ||
|
||
export const UpdateAppScreen: NavigationFunctionComponent<{ | ||
closable?: boolean | ||
}> = ({ closable = true, componentId }) => { | ||
useNavigationOptions(componentId) | ||
const intl = useIntl() | ||
|
||
useEffect(() => { | ||
// Make sure to allow closing of the modal if this is a closable screen | ||
Navigation.mergeOptions(componentId, { | ||
hardwareBackButton: { | ||
dismissModalOnPress: closable, | ||
}, | ||
modal: { | ||
swipeToDismiss: closable, | ||
}, | ||
}) | ||
}, []) | ||
|
||
return ( | ||
<View style={{ flex: 1 }}> | ||
<NavigationBarSheet | ||
componentId={componentId} | ||
title={''} | ||
onClosePress={() => { | ||
if (closable) { | ||
preferencesStore.setState({ skippedSoftUpdate: true }) | ||
Navigation.dismissModal(componentId) | ||
} | ||
}} | ||
style={{ marginHorizontal: 16 }} | ||
closable={closable} | ||
/> | ||
<SafeAreaView style={{ flex: 1 }}> | ||
<Host> | ||
<Image | ||
source={logo} | ||
resizeMode="contain" | ||
style={{ width: 45, height: 45 }} | ||
/> | ||
<Text> | ||
<Title variant={'heading2'} textAlign="center"> | ||
<FormattedMessage | ||
id="updateApp.title" | ||
defaultMessage="Uppfæra app" | ||
/> | ||
</Title> | ||
<Typography textAlign="center"> | ||
<FormattedMessage | ||
id="updateApp.description" | ||
defaultMessage={ | ||
'Þú ert að fara að nota gamla útgáfu af Ísland.is appinu. Vinsamlegast uppfærðu appið til að halda áfram.' | ||
} | ||
/> | ||
</Typography> | ||
</Text> | ||
<Image | ||
source={illustrationSrc} | ||
style={{ width: 210, height: 240 }} | ||
resizeMode="contain" | ||
/> | ||
</Host> | ||
<ButtonWrapper> | ||
<Button | ||
title={intl.formatMessage({ | ||
id: 'updateApp.button', | ||
defaultMessage: 'Uppfæra', | ||
})} | ||
onPress={() => { | ||
Linking.openURL( | ||
isIos | ||
? 'https://apps.apple.com/app/%C3%ADsland-is-stafr%C3%A6nt-%C3%ADsland/id1569828682' | ||
: 'https://play.google.com/store/apps/details?id=is.island.app', | ||
) | ||
}} | ||
/> | ||
{closable && ( | ||
<Button | ||
isOutlined | ||
title={intl.formatMessage({ | ||
id: 'updateApp.buttonSkip', | ||
defaultMessage: 'Sleppa', | ||
})} | ||
onPress={() => { | ||
preferencesStore.setState({ skippedSoftUpdate: true }) | ||
Navigation.dismissModal(componentId) | ||
}} | ||
/> | ||
)} | ||
</ButtonWrapper> | ||
</SafeAreaView> | ||
</View> | ||
) | ||
} | ||
|
||
UpdateAppScreen.options = getNavigationOptions |
Oops, something went wrong.