diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-04-20 17:10:33 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-04-20 17:21:36 -0400 |
| commit | 5ff7cab4bd36337b2c86e3d4915a6fc3ceef1ddb (patch) | |
| tree | 1620cc8ff132043aca30f8f0998d77a3ecc1add9 /src/screens/profile/CaptionScreen.tsx | |
| parent | 5946e667c55de4ee4e9d5d64ad6e5f3eb5e123dd (diff) | |
linted
Diffstat (limited to 'src/screens/profile/CaptionScreen.tsx')
| -rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 998897e2..c039b8cb 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -48,8 +48,8 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { const [caption, setCaption] = useState(''); const [loading, setLoading] = useState(false); - const handleCaptionUpdate = (caption: string) => { - setCaption(caption); + const handleCaptionUpdate = (newCaption: string) => { + setCaption(newCaption); }; const navigateToProfile = () => { @@ -62,6 +62,9 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { const handleShare = async () => { setLoading(true); + if (!image.filename) { + return; + } postMoment(image.filename, image.path, caption, title, userId).then( (data) => { setLoading(false); @@ -87,7 +90,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { <TouchableWithoutFeedback onPress={Keyboard.dismiss}> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} - style={{flex: 1}}> + style={styles.flex}> <View style={styles.contentContainer}> <View style={styles.buttonsContainer}> <Button @@ -156,6 +159,9 @@ const styles = StyleSheet.create({ paddingVertical: '1%', height: 60, }, + flex: { + flex: 1, + }, }); export default CaptionScreen; |
