This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e47c38b
commit 73621c7
Showing
18 changed files
with
173 additions
and
11 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
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,54 @@ | ||
import { VerticalSpacing } from "@components/atoms"; | ||
import { Text } from "@components/atoms/Text"; | ||
import { fontFamilies, fontSizes, grid2x, grid4x } from "@constants"; | ||
import React, { useCallback } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Linking } from "react-native"; | ||
import styled from "styled-components/native"; | ||
|
||
import config from "../../../config"; | ||
|
||
const DescriptionBold = styled(Text)` | ||
font-family: ${fontFamilies["open-sans-bold"]}; | ||
font-size: ${fontSizes.normal}px; | ||
text-align: left; | ||
`; | ||
|
||
const Description = styled(Text)` | ||
font-family: ${fontFamilies["open-sans"]}; | ||
font-size: ${fontSizes.normal}px; | ||
margin-bottom: ${grid4x}px; | ||
text-align: left; | ||
`; | ||
|
||
const DescriptionLink = styled(DescriptionBold)` | ||
padding-top: 8px; | ||
text-decoration-line: underline; | ||
`; | ||
|
||
export interface ENFiOS12SupportProps { | ||
showLogParagraph?: boolean; | ||
} | ||
|
||
export function ENFiOS12Support({ showLogParagraph }: ENFiOS12SupportProps) { | ||
const { t } = useTranslation(); | ||
|
||
const handleLink = useCallback(() => { | ||
Linking.openURL(config.iOS12SupportLink); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<DescriptionBold> | ||
{t("screens:enfSettings:descriptioniOS12")} | ||
</DescriptionBold> | ||
<DescriptionLink onPress={handleLink}> | ||
{t("screens:enfSettings:descriptionLinkiOS12")} | ||
</DescriptionLink> | ||
<VerticalSpacing height={grid2x} /> | ||
{showLogParagraph && ( | ||
<Description>{t("screens:enfSettings:description")}</Description> | ||
)} | ||
</> | ||
); | ||
} |
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
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,13 @@ | ||
import { parseVersion } from "./versions"; | ||
|
||
it.each([ | ||
["12.5", { major: 12, minor: 5 }], | ||
["12.5.1", { major: 12, minor: 5 }], | ||
["12.6", { major: 12, minor: 6 }], | ||
["12.6,1", { major: 12, minor: 6 }], | ||
["12", undefined], | ||
["foo", undefined], | ||
[8, { major: 8 }], | ||
])("parses version %s to %s", (version, result) => { | ||
expect(parseVersion(version)).toEqual(result); | ||
}); |
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,40 @@ | ||
import { Platform } from "react-native"; | ||
|
||
export interface Version { | ||
major: number; | ||
minor?: number; | ||
} | ||
|
||
export const parseVersion = (version: string | number): Version | undefined => { | ||
if (typeof version === "number") { | ||
return { | ||
major: version, | ||
}; | ||
} | ||
const components = version.split("."); | ||
if (components.length < 2) { | ||
return undefined; | ||
} | ||
|
||
const major = parseInt(components[0]); | ||
const minor = parseInt(components[1]); | ||
|
||
if (isNaN(major) || isNaN(minor)) { | ||
return undefined; | ||
} | ||
|
||
return { | ||
major, | ||
minor, | ||
}; | ||
}; | ||
|
||
const platform = Platform.OS; | ||
const version = parseVersion(Platform.Version || ""); | ||
|
||
export const iOS12EnfSupported = | ||
platform === "ios" && | ||
version != null && | ||
version.major === 12 && | ||
version.minor != null && | ||
version.minor >= 5; |