Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: android footer and status bar #3302

Merged
merged 1 commit into from May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 19 additions & 14 deletions js/packages/components/chat/ContactSettings.tsx
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { View, ScrollView, ActivityIndicator } from 'react-native'
import { View, ScrollView, ActivityIndicator, StatusBar } from 'react-native'
import { Text } from '@ui-kitten/components'
import { useTranslation } from 'react-i18next'

Expand Down Expand Up @@ -132,7 +132,7 @@ export const ContactSettings: React.FC<ScreenProps.Chat.ContactSettings> = ({ ro
const { contactId } = route.params
const { goBack } = useNavigation()
const contact: any = (useContacts() as any)[contactId] || null
const [{ background, flex, padding }] = useStyles()
const [{ background, flex, padding, color }] = useStyles()
if (!contact) {
goBack()
return (
Expand All @@ -144,17 +144,22 @@ export const ContactSettings: React.FC<ScreenProps.Chat.ContactSettings> = ({ ro
)
}
return (
<ScrollView
style={[flex.tiny, background.white]}
contentContainerStyle={[padding.bottom.huge]}
bounces={false}
>
<SwipeNavRecognizer>
<HeaderSettings actionIcon='upload' undo={goBack}>
<ContactSettingsHeader contact={contact} />
</HeaderSettings>
<ContactSettingsBody id={contact.publicKey} />
</SwipeNavRecognizer>
</ScrollView>
<>
<View style={[flex.tiny]}>
<StatusBar backgroundColor={color.blue} barStyle='light-content' />
<ScrollView
style={[flex.tiny, background.white]}
contentContainerStyle={[padding.bottom.huge]}
bounces={false}
>
<SwipeNavRecognizer>
<HeaderSettings actionIcon='upload' undo={goBack}>
<ContactSettingsHeader contact={contact} />
</HeaderSettings>
<ContactSettingsBody id={contact.publicKey} />
</SwipeNavRecognizer>
</ScrollView>
</View>
</>
)
}
5 changes: 3 additions & 2 deletions js/packages/components/chat/OneToOneSettings.tsx
@@ -1,5 +1,5 @@
import React from 'react'
import { ScrollView, View } from 'react-native'
import { ScrollView, View, StatusBar } from 'react-native'
import { Text } from '@ui-kitten/components'
import { useTranslation } from 'react-i18next'

Expand Down Expand Up @@ -130,7 +130,7 @@ export const OneToOneSettings: React.FC<ScreenProps.Chat.OneToOneSettings> = ({
route: { params },
}) => {
const { goBack, navigate } = useNavigation()
const [{ flex, background, padding }] = useStyles()
const [{ flex, background, padding, color }] = useStyles()
const { convId } = params
const conv = useConversation(convId)
const contact = useContact(conv?.contactPublicKey)
Expand All @@ -143,6 +143,7 @@ export const OneToOneSettings: React.FC<ScreenProps.Chat.OneToOneSettings> = ({
return (
<>
<View style={[flex.tiny]}>
<StatusBar backgroundColor={color.blue} barStyle='light-content' />
<ScrollView
style={[flex.tiny, background.white]}
contentContainerStyle={[padding.bottom.huge]}
Expand Down
6 changes: 1 addition & 5 deletions js/packages/components/chat/common.tsx
Expand Up @@ -200,6 +200,7 @@ export const ChatFooter: React.FC<{
})
.then(() => {
setMessage('')
setInputHeight(35)
setMediaCids([])
ctx.playSound('messageSent')
setActiveReplyInte()
Expand Down Expand Up @@ -425,16 +426,13 @@ export const ChatFooter: React.FC<{
<Animated.View
style={[
border.radius.medium,

{
alignSelf: 'flex-end',
backgroundColor: _isFocused ? '#E8E9FC99' : '#F7F8FF',
marginRight: aMaxWidth,
right: aFixLeft,
marginLeft: 9 * scaleSize,
zIndex: 100,
elevation: 100,

flex: 1,
},
]}
Expand Down Expand Up @@ -477,8 +475,6 @@ export const ChatFooter: React.FC<{
{
height: inputHeight < 35 ? 35 * scaleSize : inputHeight * scaleSize,
fontFamily: 'Open Sans',
marginTop: 3 * scaleSize,
fontSize: 15 * scaleSize,
paddingRight: 12 * scaleSize,
},
]}
Expand Down
6 changes: 4 additions & 2 deletions js/packages/components/main/Scan.tsx
Expand Up @@ -6,6 +6,7 @@ import {
TouchableOpacity,
Vibration,
Text as TextNative,
StatusBar,
} from 'react-native'
import { Layout, Text, Icon } from '@ui-kitten/components'
import QRCodeScanner from 'react-native-qrcode-scanner'
Expand All @@ -15,7 +16,7 @@ import { useStyles } from '@berty-tech/styles'
import { useNavigation } from '@react-navigation/native'

import ScanTarget from './scan_target.svg'
import { SwipeNavRecognizer } from '../shared-components/SwipeNavRecognizer.tsx'
import { SwipeNavRecognizer } from '../shared-components/SwipeNavRecognizer'

//
// Scan => Scan QrCode of an other contact
Expand Down Expand Up @@ -211,11 +212,12 @@ const ScanComponent: React.FC<any> = () => {
}

export const Scan: React.FC<{}> = () => {
const [{ flex }] = useStyles()
const [{ flex, color }] = useStyles()
const navigation = useNavigation()

return (
<Layout style={[flex.tiny, { backgroundColor: 'transparent' }]}>
<StatusBar backgroundColor={color.red} barStyle='light-content' />
<SwipeNavRecognizer
onSwipeRight={() => navigation.goBack()}
onSwipeLeft={() => navigation.goBack()}
Expand Down