2018-05-16 21:49:03 +00:00
|
|
|
// @flow
|
2019-01-22 10:35:28 +00:00
|
|
|
|
|
|
|
import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
|
2019-07-16 13:13:41 +00:00
|
|
|
import { BoxModel, ColorPalette } from '../../../base/styles';
|
|
|
|
|
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,
|
|
|
|
marginTop: 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',
|
2017-04-11 17:00:41 +00:00
|
|
|
color: ColorPalette.darkGrey,
|
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,
|
|
|
|
color: ColorPalette.white
|
|
|
|
};
|
|
|
|
|
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
|
|
|
expandMenuContainer: {
|
|
|
|
alignItems: 'center',
|
|
|
|
borderTopLeftRadius: 16,
|
|
|
|
borderTopRightRadius: 16,
|
|
|
|
flexDirection: 'column'
|
|
|
|
},
|
|
|
|
|
|
|
|
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-03-10 13:06:56 +00:00
|
|
|
backgroundColor: ColorPalette.darkBackground,
|
2021-03-22 09:02:57 +00:00
|
|
|
borderTopLeftRadius: 3,
|
|
|
|
borderTopRightRadius: 3,
|
2016-12-12 19:49:23 +00:00
|
|
|
flexDirection: 'row',
|
2018-08-29 19:04:05 +00:00
|
|
|
flexGrow: 0,
|
2021-03-10 13:06:56 +00:00
|
|
|
justifyContent: 'space-between',
|
|
|
|
paddingHorizontal: BoxModel.margin,
|
|
|
|
paddingVertical: 8
|
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: {
|
2017-10-13 16:13:46 +00:00
|
|
|
flexDirection: 'column',
|
2021-03-15 12:12:50 +00:00
|
|
|
flexGrow: 0,
|
|
|
|
width: '100%',
|
2021-04-05 10:27:50 +00:00
|
|
|
maxWidth: 580,
|
2021-03-15 12:12:50 +00:00
|
|
|
marginLeft: 'auto',
|
|
|
|
marginRight: 'auto'
|
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'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-03-22 09:02:57 +00:00
|
|
|
backgroundToggle: {
|
|
|
|
backgroundColor: ColorPalette.toggled
|
2019-01-22 10:35:28 +00:00
|
|
|
},
|
2018-05-15 11:18:42 +00:00
|
|
|
|
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
|
|
|
},
|
|
|
|
underlayColor: ColorPalette.buttonUnderlay
|
|
|
|
},
|
2019-01-13 19:34:38 +00:00
|
|
|
|
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
|
2019-01-22 10:35:28 +00:00
|
|
|
}
|
2019-01-13 19:34:38 +00:00
|
|
|
}
|
|
|
|
});
|