feat(welcome/native): improved ui

This commit is contained in:
Calin-Teodor 2022-11-09 12:59:17 +02:00 committed by Calinteodor
parent cbb8b5f620
commit 10db5ecf1f
4 changed files with 51 additions and 46 deletions

View File

@ -51,7 +51,7 @@ export const welcomeScreenOptions = {
gestureEnabled: false, gestureEnabled: false,
headerShown: true, headerShown: true,
headerStyle: { headerStyle: {
backgroundColor: BaseTheme.palette.screen01Header backgroundColor: BaseTheme.palette.screen02Header
}, },
headerTitleStyle: { headerTitleStyle: {
color: BaseTheme.palette.text01 color: BaseTheme.palette.text01

View File

@ -8,7 +8,9 @@ import JitsiStatusBar from '../../base/modal/components/JitsiStatusBar';
import { LoadingIndicator, Text } from '../../base/react'; import { LoadingIndicator, Text } from '../../base/react';
import { connect } from '../../base/redux'; import { connect } from '../../base/redux';
import BaseTheme from '../../base/ui/components/BaseTheme.native'; import BaseTheme from '../../base/ui/components/BaseTheme.native';
import Button from '../../base/ui/components/native/Button';
import Input from '../../base/ui/components/native/Input'; import Input from '../../base/ui/components/native/Input';
import { BUTTON_TYPES } from '../../base/ui/constants.native';
import WelcomePageTabs import WelcomePageTabs
from '../../mobile/navigation/components/welcome/components/WelcomePageTabs'; from '../../mobile/navigation/components/welcome/components/WelcomePageTabs';
@ -19,7 +21,6 @@ import {
} from './AbstractWelcomePage'; } from './AbstractWelcomePage';
import styles from './styles'; import styles from './styles';
type Props = AbstractProps & { type Props = AbstractProps & {
/** /**
@ -281,38 +282,39 @@ class WelcomePage extends AbstractWelcomePage<*> {
*/ */
_renderJoinButton() { _renderJoinButton() {
const { t } = this.props; const { t } = this.props;
let children; let joinButton;
if (this.state.joining) { if (this.state.joining) {
// TouchableHighlight is picky about what its children can be, so // TouchableHighlight is picky about what its children can be, so
// wrap it in a native component, i.e. View to avoid having to // wrap it in a native component, i.e. View to avoid having to
// modify non-native children. // modify non-native children.
children = ( joinButton = (
<View>
<LoadingIndicator
color = { styles.buttonText.color }
size = 'small' />
</View>
);
} else {
children = (
<Text style = { styles.buttonText }>
{ this.props.t('welcomepage.join') }
</Text>
);
}
return (
<TouchableHighlight <TouchableHighlight
accessibilityLabel = accessibilityLabel =
{ t('welcomepage.accessibilityLabel.join') } { t('welcomepage.accessibilityLabel.join') }
onPress = { this._onJoin } onPress = { this._onJoin }
style = { styles.button } style = { styles.button }>
underlayColor = { BaseTheme.palette.ui12 }> <View>
{ children } <LoadingIndicator
color = { BaseTheme.palette.icon01 }
size = 'small' />
</View>
</TouchableHighlight> </TouchableHighlight>
); );
} else {
joinButton = (
<Button
accessibilityLabel = { 'welcomepage.accessibilityLabel.join' }
labelKey = { 'welcomepage.join' }
labelStyle = { styles.joinButtonLabel }
onClick = { this._onJoin }
style = { styles.buttonText }
type = { BUTTON_TYPES.PRIMARY } />
);
}
return joinButton;
} }
/** /**

View File

@ -41,19 +41,20 @@ export default {
* Join button style. * Join button style.
*/ */
button: { button: {
backgroundColor: BaseTheme.palette.screen01Header, backgroundColor: BaseTheme.palette.action01,
borderColor: BaseTheme.palette.screen01Header, borderColor: BaseTheme.palette.action01,
borderRadius: 4, borderRadius: BaseTheme.shape.borderRadius,
borderWidth: 1, borderWidth: 1,
height: 30, height: BaseTheme.spacing[7],
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 20 paddingHorizontal: BaseTheme.spacing[4]
}, },
/** joinButtonLabel: {
* Join button text style. textTransform: 'uppercase'
*/ },
buttonText: {
joinButtonText: {
alignSelf: 'center', alignSelf: 'center',
color: BaseTheme.palette.text01, color: BaseTheme.palette.text01,
fontSize: 14 fontSize: 14
@ -85,6 +86,7 @@ export default {
* The text of the hint box. * The text of the hint box.
*/ */
hintText: { hintText: {
color: BaseTheme.palette.text01,
textAlign: 'center' textAlign: 'center'
}, },
@ -111,13 +113,11 @@ export default {
}, },
messageContainer: { messageContainer: {
backgroundColor: BaseTheme.palette.ui12, backgroundColor: BaseTheme.palette.ui03,
borderColor: BaseTheme.palette.field02, borderRadius: BaseTheme.shape.borderRadius,
borderRadius: 4, marginVertical: BaseTheme.spacing[1],
borderWidth: 1, paddingHorizontal: BaseTheme.spacing[2],
marginVertical: 5, paddingVertical: 2 * BaseTheme.spacing[2]
paddingHorizontal: BoxModel.padding,
paddingVertical: 2 * BoxModel.padding
}, },
roomNameInputContainer: { roomNameInputContainer: {
@ -191,7 +191,7 @@ export default {
insecureRoomNameWarningContainer: { insecureRoomNameWarningContainer: {
alignItems: 'center', alignItems: 'center',
flexDirection: 'row', flexDirection: 'row',
paddingHorizontal: 5 paddingHorizontal: BaseTheme.spacing[1]
}, },
insecureRoomNameWarningIcon: { insecureRoomNameWarningIcon: {
@ -215,8 +215,9 @@ export default {
}, },
customInput: { customInput: {
fontSize: 24, fontSize: 32,
lineHeight: 32, letterSpacing: 0,
lineHeight: BaseTheme.spacing[6],
textAlign: 'center' textAlign: 'center'
}, },

View File

@ -1,23 +1,25 @@
/* eslint-disable lines-around-comment */ /* eslint-disable lines-around-comment */
import React from 'react'; import React from 'react';
import { IconCalendar, IconGear, IconRestore } from '../base/icons/svg'; import { IconCalendar, IconGear, IconRestore } from '../base/icons/svg';
import BaseTheme from '../base/ui/components/BaseTheme'; import BaseTheme from '../base/ui/components/BaseTheme.native';
// @ts-ignore // @ts-ignore
import TabIcon from './components/TabIcon'; import TabIcon from './components/TabIcon';
// @ts-ignore // @ts-ignore
export const INACTIVE_TAB_COLOR = BaseTheme.palette.tab01Disabled; export const ACTIVE_TAB_COLOR = BaseTheme.palette.icon01;
export const INACTIVE_TAB_COLOR = BaseTheme.palette.icon03;
export const tabBarOptions = { export const tabBarOptions = {
tabBarActiveTintColor: BaseTheme.palette.icon01, tabBarActiveTintColor: ACTIVE_TAB_COLOR,
tabBarInactiveTintColor: INACTIVE_TAB_COLOR, tabBarInactiveTintColor: INACTIVE_TAB_COLOR,
tabBarLabelStyle: { tabBarLabelStyle: {
fontSize: 12 fontSize: 12
}, },
tabBarStyle: { // @ts-ignore tabBarStyle: { // @ts-ignore
backgroundColor: BaseTheme.palette.screen01Header backgroundColor: BaseTheme.palette.screen02Header
} }
}; };