Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Differentiate keyboard offset for android and ios
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jan 14, 2020
1 parent b7d7f10 commit 3fe5887
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/screen/Message.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image, TouchableOpacity, View } from 'react-native';
import { Image, Platform, TouchableOpacity, View } from 'react-native';
import { MessageProps, MessageType } from '../../types';
import React, { useState } from 'react';
import {
Expand All @@ -15,7 +15,7 @@ import { Ionicons } from '@expo/vector-icons';
import { MainStackNavigationProps } from '../navigation/MainStackNavigator';
import MessageListItem from '../shared/MessageListItem';
import { getString } from '../../../STRINGS';
import { isIPhoneXSize } from '../../utils/Styles';
import { isIphoneX } from '../../utils/Styles';
import styled from 'styled-components/native';
import { useProfileContext } from '../../providers/ProfileModalProvider';
import { useThemeContext } from '@dooboo-ui/native-theme';
Expand Down Expand Up @@ -123,9 +123,12 @@ function Message(): React.ReactElement {
borderColor={theme.lineColor}
backgroundColor={theme.background}
fontColor={theme.fontColor}
keyboardOffset={isIPhoneXSize
? Constants.statusBarHeight + 40
: Constants.statusBarHeight}
keyboardOffset={Platform.select({
ios: isIphoneX
? Constants.statusBarHeight + 40
: Constants.statusBarHeight,
android: Constants.statusBarHeight + 52,
})}
message={textToSend}
placeholder={getString('WRITE_MESSAGE')}
placeholderTextColor={theme.placeholder}
Expand Down

0 comments on commit 3fe5887

Please sign in to comment.