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

Mobile UI polish #10982

Merged
merged 7 commits into from
Feb 17, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions react/features/base/dialog/components/native/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,12 @@ ColorSchemeRegistry.register('Dialog', {
},

text: {
...brandedDialogText
...brandedDialogText,
color: BaseTheme.palette.text01
},

topBorderContainer: {
borderTopColor: schemeColor('border'),
borderTopColor: BaseTheme.palette.dividerColor,
borderTopWidth: 1
}
});
Expand Down
9 changes: 9 additions & 0 deletions react/features/base/ui/Tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const colors = {
surface12: '#AAAAAA',
surface13: '#495258',
surface14: '#555555',
surface15: '#474747',

success04: '#189B55',
success05: '#1EC26A',
Expand Down Expand Up @@ -69,6 +70,8 @@ export const colorMap = {
ui05: 'surface06',
ui12: 'surface11',
ui13: 'surface14',
ui14: 'surface15',
ui15: 'surface12',

// Primary buttons
action01: 'primary05',
Expand Down Expand Up @@ -201,6 +204,9 @@ export const colorMap = {
// Color for the section divider
dividerColor: 'surface12',

// Color for indicator
indicatorColor: 'surface12',

// Background for high-contrast input fields on hover
field02Hover: 'primary09',

Expand Down Expand Up @@ -260,6 +266,9 @@ export const colorMap = {
// Color for disabled tab
tab01Disabled: 'disabled01',

// Color for enabled lobby mode switch
lobbySwitch01Active: 'success04',

// Color for disabled video switch
video01Disabled: 'disabled01',

Expand Down
3 changes: 3 additions & 0 deletions react/features/chat/components/native/ChatInputBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Platform, TextInput, TouchableOpacity, View } from 'react-native';

import { translate } from '../../../base/i18n';
import { Icon, IconChatSend } from '../../../base/icons';
import BaseTheme from '../../../base/ui/components/BaseTheme.native';

import styles from './styles';

Expand Down Expand Up @@ -82,7 +83,9 @@ class ChatInputBar extends Component<Props, State> {
onFocus = { this._onFocused(true) }
onSubmitEditing = { this._onSubmit }
placeholder = { this.props.t('chat.fieldPlaceHolder') }
placeholderTextColor = { BaseTheme.palette.text03 }
returnKeyType = 'send'
selectionColor = { BaseTheme.palette.text03 }
style = { styles.inputField }
value = { this.state.message } />
{
Expand Down
7 changes: 4 additions & 3 deletions react/features/chat/components/native/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
},

inputField: {
color: 'rgb(28, 32, 37)',
color: BaseTheme.palette.text01,
flex: 1,
height: 48
},
Expand Down Expand Up @@ -95,7 +95,7 @@ export default {
},

sendButtonIcon: {
color: ColorPalette.darkGrey,
color: BaseTheme.palette.icon01,
fontSize: 22
},

Expand Down Expand Up @@ -124,6 +124,7 @@ export default {
},

chatContainer: {
backgroundColor: BaseTheme.palette.ui01,
flex: 1
},

Expand Down Expand Up @@ -165,7 +166,7 @@ ColorSchemeRegistry.register('Chat', {
},

emptyComponentText: {
color: BaseTheme.palette.ui05,
color: BaseTheme.palette.text03,
textAlign: 'center'
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const ICON_SIZE = 15;
export default {

addPeopleContainer: {
backgroundColor: BaseTheme.palette.ui01,
flex: 1
},

Expand Down Expand Up @@ -75,7 +76,7 @@ export default {
},

itemText: {
color: DARK_GREY,
color: BaseTheme.palette.text01,
fontSize: 14,
fontWeight: 'normal'
},
Expand Down Expand Up @@ -104,14 +105,14 @@ export default {
},

selectedIcon: {
color: DARK_GREY,
color: BaseTheme.palette.icon01,
fontSize: 20,
marginRight: BoxModel.margin,
padding: 2
},

separator: {
borderBottomColor: LIGHT_GREY,
borderBottomColor: BaseTheme.palette.dividerColor,
borderBottomWidth: 1,
marginLeft: 85
},
Expand Down Expand Up @@ -146,7 +147,7 @@ export default {
},

unselectIcon: {
color: LIGHT_GREY,
color: BaseTheme.palette.ui01,
fontSize: 16,
left: AVATAR_SIZE / -3,
position: 'relative',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @flow

import { ColorPalette } from '../../../../base/styles';
import BaseTheme from '../../../../base/ui/components/BaseTheme.native';

export const INDICATOR_COLOR = ColorPalette.lightGrey;
export const INDICATOR_COLOR = BaseTheme.palette.indicatorColor;

const WV_BACKGROUND = 'rgb(71, 71, 71)';
const WV_BACKGROUND = BaseTheme.palette.ui14;

export default {

Expand All @@ -15,7 +15,7 @@ export default {

indicatorWrapper: {
alignItems: 'center',
backgroundColor: ColorPalette.white,
backgroundColor: BaseTheme.palette.ui12,
height: '100%',
justifyContent: 'center'
},
Expand Down
12 changes: 2 additions & 10 deletions react/features/lobby/components/native/LobbyModeSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import { Switch, View } from 'react-native';
import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux';

import styles, {
ENABLED_THUMB_COLOR,
ENABLED_TRACK_COLOR,
DISABLED_THUMB_COLOR
} from './styles';
import styles, { ENABLED_TRACK_COLOR, THUMB_COLOR } from './styles';

/**
* The type of the React {@code Component} props of {@link LobbyModeSwitch}.
Expand Down Expand Up @@ -44,11 +40,7 @@ function LobbyModeSwitch(
<Switch
onValueChange = { onToggleLobbyMode }
style = { styles.lobbySwitchIcon }
thumbColor = {
lobbyEnabled
? ENABLED_THUMB_COLOR
: DISABLED_THUMB_COLOR
}
thumbColor = { THUMB_COLOR }
trackColor = {{ true: ENABLED_TRACK_COLOR }}
value = { lobbyEnabled } />
</View>
Expand Down
11 changes: 5 additions & 6 deletions react/features/lobby/components/native/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import BaseTheme from '../../../base/ui/components/BaseTheme';

const SECONDARY_COLOR = BaseTheme.palette.border04;

export const ENABLED_THUMB_COLOR = BaseTheme.palette.action04;
export const ENABLED_TRACK_COLOR = BaseTheme.palette.screen01Header;
export const DISABLED_THUMB_COLOR = BaseTheme.palette.icon04;
export const ENABLED_TRACK_COLOR = BaseTheme.palette.lobbySwitch01Active;
export const THUMB_COLOR = BaseTheme.palette.field02;

export default {
button: {
alignItems: 'center',
borderRadius: 4,
marginVertical: 4,
paddingVertical: 8
marginVertical: BaseTheme.spacing[1],
paddingVertical: BaseTheme.spacing[2]
},

contentWrapper: {
Expand All @@ -33,7 +32,7 @@ export default {
fontSize: 18,
fontWeight: 'bold',
margin: 'auto',
marginVertical: 24,
marginVertical: BaseTheme.spacing[3],
textAlign: 'center'
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
getClientHeight,
getClientWidth
} from '../../../../../base/modal/components/functions.native';
import BaseTheme from '../../../../../base/ui/components/BaseTheme.native';
import { Chat } from '../../../../../chat';
import { PollsPane } from '../../../../../polls/components';
import { screen } from '../../../routes';
Expand All @@ -28,7 +29,10 @@ const ChatAndPollsNavigationContainer = () => {
width: clientWidth
}}
screenOptions = {{
...chatTabBarOptions
...chatTabBarOptions,
tabBarStyle: {
backgroundColor: BaseTheme.palette.ui01
}
}}>
<ChatTab.Screen
component = { Chat }
Expand Down
2 changes: 1 addition & 1 deletion react/features/mobile/navigation/screenOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const chatTabBarOptions = {
tabBarLabelStyle: {
fontSize: BaseTheme.typography.labelRegular.fontSize
},
tabBarInactiveTintColor: BaseTheme.palette.field02Disabled,
tabBarInactiveTintColor: BaseTheme.palette.text01,
tabBarIndicatorStyle: {
backgroundColor: BaseTheme.palette.screen01Header
}
Expand Down
12 changes: 9 additions & 3 deletions react/features/polls/components/native/PollAnswer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import { Switch, Text, View } from 'react-native';
import { Button } from 'react-native-paper';

import BaseTheme from '../../../base/ui/components/BaseTheme.native';
import { BUTTON_MODES } from '../../../chat/constants';
import { isSubmitAnswerDisabled } from '../../functions';
import AbstractPollAnswer from '../AbstractPollAnswer';
Expand Down Expand Up @@ -38,21 +39,26 @@ const PollAnswer = (props: AbstractProps) => {
/* eslint-disable react/jsx-no-bind */
onValueChange = { state => setCheckbox(index, state) }
value = { checkBoxStates[index] } />
<Text>{answer.name}</Text>
<Text style = { chatStyles.switchLabel }>{answer.name}</Text>
</View>
))}
</View>
<View style = { chatStyles.buttonRow }>
<Button
color = '#3D3D3D'
color = { BaseTheme.palette.action02 }
mode = { BUTTON_MODES.CONTAINED }
onPress = { changingVote ? skipChangeVote : skipAnswer }
style = { chatStyles.pollCreateButton } >
{t('polls.answer.skip')}
</Button>
<Button
color = '#17a0db'
color = { BaseTheme.palette.screen01Header }
disabled = { isSubmitAnswerDisabled(checkBoxStates) }
labelStyle = {
isSubmitAnswerDisabled(checkBoxStates)
? chatStyles.pollSendDisabledLabel
: chatStyles.pollSendLabel
}
mode = { BUTTON_MODES.CONTAINED }
onPress = { submitAnswer }
style = { chatStyles.pollCreateButton } >
Expand Down
20 changes: 16 additions & 4 deletions react/features/polls/components/native/PollCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { View, TextInput, FlatList, TouchableOpacity } from 'react-native';
import { Button } from 'react-native-paper';

import { Icon, IconClose } from '../../../base/icons';
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
import { BUTTON_MODES } from '../../../chat/constants';
import { CHAR_LIMIT } from '../../constants';
import AbstractPollCreate from '../AbstractPollCreate';
import type { AbstractProps } from '../AbstractPollCreate';

import { chatStyles, dialogStyles } from './styles';


const PollCreate = (props: AbstractProps) => {


Expand Down Expand Up @@ -111,11 +113,14 @@ const PollCreate = (props: AbstractProps) => {
onChangeText = { text => setAnswer(index, text) }
onKeyPress = { ev => onAnswerKeyDown(index, ev) }
placeholder = { t('polls.create.answerPlaceholder', { index: index + 1 }) }
placeholderTextColor = { BaseTheme.palette.text03 }
ref = { input => registerFieldRef(index, input) }
selectionColor = { BaseTheme.palette.text03 }
style = { dialogStyles.field }
value = { answers[index] } />

{answers.length > 2
{
answers.length > 2
&& createIconButton(IconClose, () => removeAnswer(index))
}
</View>
Expand All @@ -132,6 +137,8 @@ const PollCreate = (props: AbstractProps) => {
onChangeText = { setQuestion }
onSubmitEditing = { onQuestionKeyDown }
placeholder = { t('polls.create.questionPlaceholder') }
placeholderTextColor = { BaseTheme.palette.text03 }
selectionColor = { BaseTheme.palette.text03 }
style = { dialogStyles.question }
value = { question } />
<FlatList
Expand All @@ -143,7 +150,7 @@ const PollCreate = (props: AbstractProps) => {
renderItem = { renderListItem } />
<View style = { chatStyles.pollCreateButtonsContainer }>
<Button
color = '#3D3D3D'
color = { BaseTheme.palette.action02 }
mode = { BUTTON_MODES.CONTAINED }
onPress = { () => {
// adding and answer
Expand All @@ -156,16 +163,21 @@ const PollCreate = (props: AbstractProps) => {
<View
style = { chatStyles.buttonRow }>
<Button
color = '#3D3D3D'
color = { BaseTheme.palette.action02 }
mode = { BUTTON_MODES.CONTAINED }
onPress = { () => setCreateMode(false) }
style = { chatStyles.pollCreateButton } >
{t('polls.create.cancel')}
</Button>

<Button
color = '#17a0db'
color = { BaseTheme.palette.screen01Header }
disabled = { isSubmitDisabled }
labelStyle = {
isSubmitDisabled
? chatStyles.pollSendDisabledLabel
: chatStyles.pollSendLabel
}
mode = { BUTTON_MODES.CONTAINED }
onPress = { onSubmit }
style = { chatStyles.pollCreateButton } >
Expand Down
6 changes: 5 additions & 1 deletion react/features/polls/components/native/PollResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ const PollResults = (props: AbstractProps) => {
{ voters && voterCount > 0
&& <View style = { resultsStyles.voters }>
{voters.map(({ id, name: voterName }) =>
<Text key = { id }>{ voterName }</Text>
(<Text
key = { id }
style = { resultsStyles.voter }>
{ voterName }
</Text>)
)}
</View>}
</View>
Expand Down
10 changes: 7 additions & 3 deletions react/features/polls/components/native/PollsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ const PollsList = () => {

return (
<>
{listPolls.length === 0
{
listPolls.length === 0
&& <Text style = { chatStyles.noPollText } >
{t('polls.results.empty')}
</Text>}
{
t('polls.results.empty')
}
</Text>
}
<FlatList
data = { listPolls }
extraData = { listPolls }
Expand Down
Loading