diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2022-03-03 22:57:17 +0100 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2022-03-03 22:57:17 +0100 |
| commit | 5cf454c6800d6bfe26e08c6b4393b82bff442b4d (patch) | |
| tree | 55ad9e2bfdfa35e2665451ed9f3b370e7d6d6a70 /components/PhotoSmall.js | |
| download | aparatus-5cf454c6800d6bfe26e08c6b4393b82bff442b4d.tar.gz aparatus-5cf454c6800d6bfe26e08c6b4393b82bff442b4d.tar.zst aparatus-5cf454c6800d6bfe26e08c6b4393b82bff442b4d.zip | |
Initial commit - v1.0.0
Diffstat (limited to 'components/PhotoSmall.js')
| -rw-r--r-- | components/PhotoSmall.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/components/PhotoSmall.js b/components/PhotoSmall.js new file mode 100644 index 0000000..52f86d1 --- /dev/null +++ b/components/PhotoSmall.js @@ -0,0 +1,55 @@ +import * as React from 'react'; +import { View, Text, StyleSheet, Image } from 'react-native'; +// import * as MediaLibrary from "expo-media-library"; + +const MARGIN = 3; + +export default class PhotoSmall extends React.Component { + constructor(props) { + super(props) + this.state = {} + } + + async componentDidMount() { + } + + render() { + return ( + <View style={styles.cont}> + <Image source={this.props.source} style={[this.props.style, styles.img, { width: this.props.size.width - MARGIN * 2, height: this.props.size.height }]} /> + <Text style={[this.props.style, styles.txt]}>{this.props.id}</Text> + <Text style={[{ opacity: this.props.style.opacity === 1 ? 0 : 1 }, styles.plus]}>+</Text> + </View> + ) + } +} + +const styles = StyleSheet.create({ + cont: { + flex: 1, + flexDirection: "column", + margin: MARGIN, + justifyContent: "center", + alignItems: "center", + }, + img: { + borderRadius: 15, + flex: 1, + }, + txt: { + position: "absolute", + bottom: 10, + right: 10, + color: "white", + fontWeight: "bold", + }, + plus: { + position: "absolute", + alignSelf: "center", + fontWeight: "100", + fontSize: 100, + color: "#EB1F63", + }, +}) + + |
