|
| 1 | +import React from 'react' |
| 2 | +import { StyleSheet, Text, View } from 'react-native' |
| 3 | +import { Link } from '../navigation/Link' |
| 4 | +import { Image } from '../components/Image' |
| 5 | + |
| 6 | +/* --- <ImagesScreen/> --------------------------------------------------------------------------- */ |
| 7 | + |
| 8 | +const ImagesScreen = () => { |
| 9 | + return ( |
| 10 | + <View style={styles.container}> |
| 11 | + <Link |
| 12 | + href="/" |
| 13 | + style={{ ...styles.backButton, ...styles.link, textDecorationLine: 'none' }} |
| 14 | + > |
| 15 | + {`< Back`} |
| 16 | + </Link> |
| 17 | + {/* - 1 - */} |
| 18 | + <Image src={require('../assets/aetherspaceLogo.png')} width={60} height={60} /> |
| 19 | + <Text style={styles.subtitle}>src=static-require | width: 60 | height: 60</Text> |
| 20 | + {/* - 2 - */} |
| 21 | + <Image src="https://codinsonn.dev/_next/image?url=%2Fimg%2FCodelyFansLogoPic160x160.jpeg&w=256&q=75" width={60} height={60} /> |
| 22 | + <Text style={styles.subtitle}>src=external-url | width: 60 | height: 60</Text> |
| 23 | + {/* - 3 - */} |
| 24 | + <View style={{ width: 60, height: 80, position: 'relative', borderColor: 'black', borderStyle: 'dashed', borderWidth: 1 }}> |
| 25 | + <Image src={require('../assets/aetherspaceLogo.png')} fill /> |
| 26 | + </View> |
| 27 | + <Text style={styles.subtitle}>wrapper=50x80, relative | fill=true</Text> |
| 28 | + {/* - 4 - */} |
| 29 | + <View style={{ width: 80, height: 60, position: 'relative', borderColor: 'black', borderStyle: 'dashed', borderWidth: 1 }}> |
| 30 | + <Image src={require('../assets/aetherspaceLogo.png')} fill contentFit="contain" /> |
| 31 | + </View> |
| 32 | + <Text style={styles.subtitle}>wrapper=80x60, relative | fill | contentFit=contain</Text> |
| 33 | + </View> |
| 34 | + ) |
| 35 | +} |
| 36 | + |
| 37 | +/* --- Styles ---------------------------------------------------------------------------------- */ |
| 38 | + |
| 39 | +const styles = StyleSheet.create({ |
| 40 | + container: { |
| 41 | + flex: 1, |
| 42 | + justifyContent: 'center', |
| 43 | + alignItems: 'center', |
| 44 | + }, |
| 45 | + backButton: { |
| 46 | + position: 'absolute', |
| 47 | + top: 16, |
| 48 | + left: 16, |
| 49 | + }, |
| 50 | + subtitle: { |
| 51 | + marginTop: 8, |
| 52 | + marginBottom: 16, |
| 53 | + fontSize: 16, |
| 54 | + textAlign: 'center', |
| 55 | + }, |
| 56 | + link: { |
| 57 | + marginTop: 16, |
| 58 | + fontSize: 16, |
| 59 | + color: 'blue', |
| 60 | + textAlign: 'center', |
| 61 | + textDecorationLine: 'underline', |
| 62 | + }, |
| 63 | +}) |
| 64 | + |
| 65 | +/* --- Exports --------------------------------------------------------------------------------- */ |
| 66 | + |
| 67 | +export default ImagesScreen |
0 commit comments