-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(map): break down into several components
- Loading branch information
Showing
13 changed files
with
1,235 additions
and
1,126 deletions.
There are no files selected for viewing
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,58 @@ | ||
import React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { Linking, Pressable, Text, View } from 'react-native' | ||
import { createStyleSheet, useStyles } from 'react-native-unistyles' | ||
|
||
import PlatformIcon from '../Universal/Icon' | ||
|
||
const AttributionLink: React.FC = () => { | ||
const { styles } = useStyles(stylesheet) | ||
const { t } = useTranslation('common') | ||
|
||
return ( | ||
<View style={styles.attributionContainer}> | ||
<Pressable | ||
onPress={() => { | ||
void Linking.openURL( | ||
'https://www.openstreetmap.org/copyright' | ||
) | ||
}} | ||
style={styles.attributionLink} | ||
> | ||
<Text style={styles.attributionText}> | ||
{t('pages.map.details.osm')} | ||
</Text> | ||
<PlatformIcon | ||
ios={{ | ||
name: 'chevron.forward', | ||
size: 11, | ||
}} | ||
android={{ | ||
name: 'chevron_right', | ||
size: 16, | ||
}} | ||
style={styles.label} | ||
/> | ||
</Pressable> | ||
</View> | ||
) | ||
} | ||
|
||
export default AttributionLink | ||
|
||
const stylesheet = createStyleSheet((theme) => ({ | ||
attributionContainer: { paddingVertical: 40 }, | ||
attributionLink: { | ||
alignItems: 'center', | ||
flexDirection: 'row', | ||
gap: 4, | ||
}, | ||
attributionText: { | ||
color: theme.colors.labelColor, | ||
fontSize: 15, | ||
paddingStart: 4, | ||
}, | ||
label: { | ||
color: theme.colors.labelColor, | ||
}, | ||
})) |
Oops, something went wrong.