More Responsive and add AdjustText, Flady Components
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
35ae22ffaa
commit
acaa8376a0
Before Width: | Height: | Size: 322 KiB After Width: | Height: | Size: 329 KiB |
Before Width: | Height: | Size: 298 KiB After Width: | Height: | Size: 284 KiB |
After Width: | Height: | Size: 756 KiB |
After Width: | Height: | Size: 778 KiB |
@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
// @ts-ignore
|
||||
export default function AdjustSize(Text: String) {
|
||||
const titleLength = Text.length;
|
||||
const minFontSize = 23;
|
||||
const maxFontSize = 48;
|
||||
const fontRatio = 1.1;
|
||||
const fontSize = Math.max(minFontSize, maxFontSize - (titleLength * fontRatio));
|
||||
return fontSize;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import React from 'react';
|
||||
import { View, Image, StyleSheet } from 'react-native';
|
||||
import normalize from './Normalize';
|
||||
|
||||
type Flady = {
|
||||
image: string | object;
|
||||
};
|
||||
|
||||
export default function FladyComponent(monFlady: Flady) {
|
||||
const source = typeof monFlady.image === 'string' ? { uri: monFlady.image } : monFlady.image;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Image source={source} style={styles.image}/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create ({
|
||||
container: {
|
||||
alignItems: "flex-start",
|
||||
width: normalize(152),
|
||||
height: normalize(152),
|
||||
borderRadius: 90,
|
||||
backgroundColor: "white",
|
||||
marginHorizontal: normalize(15),
|
||||
},
|
||||
image: {
|
||||
width: normalize(200),
|
||||
height: normalize(200),
|
||||
}
|
||||
})
|
Loading…
Reference in new issue