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