2018-05-16 21:49:03 +00:00
|
|
|
// @flow
|
2019-01-22 10:35:28 +00:00
|
|
|
|
|
|
|
import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
|
2022-02-22 12:36:30 +00:00
|
|
|
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
|
2019-07-16 13:13:41 +00:00
|
|
|
|
2021-03-10 13:06:56 +00:00
|
|
|
const BUTTON_SIZE = 48;
|
2016-10-05 14:36:59 +00:00
|
|
|
|
2018-05-16 21:49:03 +00:00
|
|
|
// Toolbox, toolbar:
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The style of toolbar buttons.
|
2016-12-14 22:15:17 +00:00
|
|
|
*/
|
2018-05-15 11:18:42 +00:00
|
|
|
const toolbarButton = {
|
2021-03-10 13:06:56 +00:00
|
|
|
borderRadius: 3,
|
2017-04-11 17:00:41 +00:00
|
|
|
borderWidth: 0,
|
2018-05-15 11:18:42 +00:00
|
|
|
flex: 0,
|
2017-04-11 17:00:41 +00:00
|
|
|
flexDirection: 'row',
|
2019-07-16 13:13:41 +00:00
|
|
|
height: BUTTON_SIZE,
|
2018-05-15 11:18:42 +00:00
|
|
|
justifyContent: 'center',
|
2021-03-22 09:02:57 +00:00
|
|
|
marginHorizontal: 6,
|
2022-03-01 15:41:45 +00:00
|
|
|
marginVertical: 6,
|
2019-07-16 13:13:41 +00:00
|
|
|
width: BUTTON_SIZE
|
2016-10-05 14:36:59 +00:00
|
|
|
};
|
|
|
|
|
2016-12-14 22:15:17 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The icon style of the toolbar buttons.
|
2016-12-14 22:15:17 +00:00
|
|
|
*/
|
2018-05-15 11:18:42 +00:00
|
|
|
const toolbarButtonIcon = {
|
|
|
|
alignSelf: 'center',
|
2021-11-25 16:41:03 +00:00
|
|
|
color: BaseTheme.palette.icon04,
|
2021-03-10 13:06:56 +00:00
|
|
|
fontSize: 24
|
2016-10-05 14:36:59 +00:00
|
|
|
};
|
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The icon style of toolbar buttons which display white icons.
|
|
|
|
*/
|
|
|
|
const whiteToolbarButtonIcon = {
|
|
|
|
...toolbarButtonIcon,
|
2021-11-25 16:41:03 +00:00
|
|
|
color: BaseTheme.palette.icon01
|
2019-01-22 10:35:28 +00:00
|
|
|
};
|
|
|
|
|
2021-07-13 06:50:08 +00:00
|
|
|
/**
|
|
|
|
* The style of reaction buttons.
|
|
|
|
*/
|
|
|
|
const reactionButton = {
|
|
|
|
...toolbarButton,
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
alignItems: 'center',
|
|
|
|
marginTop: 0,
|
|
|
|
marginHorizontal: 0
|
|
|
|
};
|
|
|
|
|
2022-03-30 13:54:03 +00:00
|
|
|
const gifButton = {
|
|
|
|
...reactionButton,
|
|
|
|
backgroundColor: '#000'
|
|
|
|
};
|
|
|
|
|
2021-07-13 06:50:08 +00:00
|
|
|
/**
|
|
|
|
* The style of the emoji on the reaction buttons.
|
|
|
|
*/
|
|
|
|
const reactionEmoji = {
|
|
|
|
fontSize: 20,
|
2021-11-25 16:41:03 +00:00
|
|
|
color: BaseTheme.palette.icon01
|
2021-07-13 06:50:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const reactionMenu = {
|
|
|
|
flexDirection: 'column',
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
2021-11-25 16:41:03 +00:00
|
|
|
backgroundColor: BaseTheme.palette.bottomSheet,
|
2022-02-22 12:36:30 +00:00
|
|
|
padding: BaseTheme.spacing[3]
|
2021-07-13 06:50:08 +00:00
|
|
|
};
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The Toolbox and toolbar related styles.
|
2016-10-05 14:36:59 +00:00
|
|
|
*/
|
2019-07-16 13:13:41 +00:00
|
|
|
const styles = {
|
2018-04-18 14:34:40 +00:00
|
|
|
|
2020-03-23 08:37:35 +00:00
|
|
|
sheetGestureRecognizer: {
|
|
|
|
alignItems: 'stretch',
|
|
|
|
flexDirection: 'column'
|
|
|
|
},
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The style of the toolbar.
|
2016-10-05 14:36:59 +00:00
|
|
|
*/
|
2021-03-18 11:32:33 +00:00
|
|
|
toolbox: {
|
2018-05-15 11:18:42 +00:00
|
|
|
alignItems: 'center',
|
2021-11-25 16:41:03 +00:00
|
|
|
backgroundColor: BaseTheme.palette.uiBackground,
|
2021-03-22 09:02:57 +00:00
|
|
|
borderTopLeftRadius: 3,
|
|
|
|
borderTopRightRadius: 3,
|
2016-12-12 19:49:23 +00:00
|
|
|
flexDirection: 'row',
|
2022-03-01 15:41:45 +00:00
|
|
|
justifyContent: 'space-between'
|
2016-10-05 14:36:59 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
2021-03-18 11:32:33 +00:00
|
|
|
* The style of the root/top-level container of {@link Toolbox}.
|
2017-10-13 16:13:46 +00:00
|
|
|
*/
|
2021-03-18 11:32:33 +00:00
|
|
|
toolboxContainer: {
|
2022-02-22 12:36:30 +00:00
|
|
|
backgroundColor: BaseTheme.palette.uiBackground,
|
2017-10-13 16:13:46 +00:00
|
|
|
flexDirection: 'column',
|
2021-04-05 10:27:50 +00:00
|
|
|
maxWidth: 580,
|
2021-03-15 12:12:50 +00:00
|
|
|
marginLeft: 'auto',
|
2022-03-01 15:41:45 +00:00
|
|
|
marginRight: 'auto',
|
|
|
|
width: '100%'
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
2019-07-16 13:13:41 +00:00
|
|
|
};
|
2018-05-15 11:18:42 +00:00
|
|
|
|
|
|
|
export default styles;
|
|
|
|
|
|
|
|
/**
|
2019-01-22 10:35:28 +00:00
|
|
|
* Color schemed styles for the @{Toolbox} component.
|
2018-05-15 11:18:42 +00:00
|
|
|
*/
|
2019-01-22 10:35:28 +00:00
|
|
|
ColorSchemeRegistry.register('Toolbox', {
|
|
|
|
/**
|
|
|
|
* Styles for buttons in the toolbar.
|
|
|
|
*/
|
|
|
|
buttonStyles: {
|
|
|
|
iconStyle: toolbarButtonIcon,
|
|
|
|
style: toolbarButton
|
|
|
|
},
|
2018-05-15 11:18:42 +00:00
|
|
|
|
2019-07-12 08:32:47 +00:00
|
|
|
buttonStylesBorderless: {
|
|
|
|
iconStyle: whiteToolbarButtonIcon,
|
|
|
|
style: {
|
|
|
|
...toolbarButton,
|
|
|
|
backgroundColor: 'transparent'
|
2022-10-13 13:13:00 +00:00
|
|
|
},
|
|
|
|
underlayColor: 'transparent'
|
2019-07-12 08:32:47 +00:00
|
|
|
},
|
|
|
|
|
2021-03-22 09:02:57 +00:00
|
|
|
backgroundToggle: {
|
2021-11-25 16:41:03 +00:00
|
|
|
backgroundColor: BaseTheme.palette.ui13
|
2019-01-22 10:35:28 +00:00
|
|
|
},
|
2018-05-15 11:18:42 +00:00
|
|
|
|
2022-08-26 18:25:04 +00:00
|
|
|
hangupMenuContainer: {
|
|
|
|
marginHorizontal: BaseTheme.spacing[2],
|
|
|
|
marginVertical: BaseTheme.spacing[2]
|
|
|
|
},
|
|
|
|
|
|
|
|
hangupButton: {
|
|
|
|
flex: 1,
|
|
|
|
marginHorizontal: BaseTheme.spacing[2],
|
|
|
|
marginVertical: BaseTheme.spacing[2]
|
|
|
|
},
|
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
hangupButtonStyles: {
|
|
|
|
iconStyle: whiteToolbarButtonIcon,
|
|
|
|
style: {
|
|
|
|
...toolbarButton,
|
2019-07-12 08:32:47 +00:00
|
|
|
backgroundColor: schemeColor('hangup')
|
2019-01-22 10:35:28 +00:00
|
|
|
},
|
2021-11-25 16:41:03 +00:00
|
|
|
underlayColor: BaseTheme.palette.underlay01
|
2019-01-22 10:35:28 +00:00
|
|
|
},
|
2019-01-13 19:34:38 +00:00
|
|
|
|
2021-07-13 06:50:08 +00:00
|
|
|
reactionDialog: {
|
|
|
|
position: 'absolute',
|
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
|
|
|
backgroundColor: 'transparent'
|
|
|
|
},
|
|
|
|
|
|
|
|
overflowReactionMenu: reactionMenu,
|
|
|
|
|
|
|
|
reactionMenu: {
|
|
|
|
...reactionMenu,
|
|
|
|
borderRadius: 3,
|
|
|
|
width: 360
|
|
|
|
},
|
|
|
|
|
|
|
|
reactionRow: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
alignItems: 'center',
|
2022-07-07 12:29:18 +00:00
|
|
|
width: '100%'
|
2021-07-13 06:50:08 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
reactionButton: {
|
2022-03-30 13:54:03 +00:00
|
|
|
gifButton,
|
2021-07-13 06:50:08 +00:00
|
|
|
style: reactionButton,
|
2021-11-25 16:41:03 +00:00
|
|
|
underlayColor: BaseTheme.palette.ui13,
|
2021-07-13 06:50:08 +00:00
|
|
|
emoji: reactionEmoji
|
|
|
|
},
|
|
|
|
|
|
|
|
emojiAnimation: {
|
2021-11-25 16:41:03 +00:00
|
|
|
color: BaseTheme.palette.icon01,
|
2021-07-13 06:50:08 +00:00
|
|
|
position: 'absolute',
|
|
|
|
zIndex: 1001,
|
|
|
|
elevation: 2,
|
|
|
|
fontSize: 20,
|
|
|
|
left: '50%',
|
|
|
|
top: '100%'
|
|
|
|
},
|
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
/**
|
|
|
|
* Styles for toggled buttons in the toolbar.
|
|
|
|
*/
|
|
|
|
toggledButtonStyles: {
|
|
|
|
iconStyle: whiteToolbarButtonIcon,
|
|
|
|
style: {
|
2021-03-10 13:06:56 +00:00
|
|
|
...toolbarButton
|
2022-10-13 13:13:00 +00:00
|
|
|
},
|
|
|
|
underlayColor: 'transparent'
|
2019-01-13 19:34:38 +00:00
|
|
|
}
|
|
|
|
});
|