aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/CaptionScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-22 14:32:15 -0400
committerGitHub <noreply@github.com>2021-04-22 14:32:15 -0400
commitf0cff95cfa612b295caf68552bc3d29a7fb23a42 (patch)
treedd3df697478a19048cd4bf6d0b499a91c1a93eb3 /src/screens/profile/CaptionScreen.tsx
parent4e8e1c0d58424e6b63cfb8470fc0a73c0e6b102b (diff)
parent33c172cc31957966b14321520c56816ba044db14 (diff)
Merge pull request #374 from IvanIFChen/hotfix-linting-fixup
[HOTFIX] Linter fixup
Diffstat (limited to 'src/screens/profile/CaptionScreen.tsx')
-rw-r--r--src/screens/profile/CaptionScreen.tsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx
index 282857d6..156ee41c 100644
--- a/src/screens/profile/CaptionScreen.tsx
+++ b/src/screens/profile/CaptionScreen.tsx
@@ -49,8 +49,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 = () => {
@@ -63,6 +63,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);
@@ -88,7 +91,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
@@ -157,6 +160,9 @@ const styles = StyleSheet.create({
paddingVertical: '1%',
height: 60,
},
+ flex: {
+ flex: 1,
+ },
});
export default CaptionScreen;