feat: add bottom gradient
This commit is contained in:
parent
250c61279b
commit
a25a504a59
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
|
import { NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
|
||||||
|
import LinearGradient from 'react-native-linear-gradient';
|
||||||
|
|
||||||
import { appNavigate } from '../../../app';
|
import { appNavigate } from '../../../app';
|
||||||
import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
|
import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
|
||||||
|
@ -34,7 +35,7 @@ import {
|
||||||
} from '../AbstractConference';
|
} from '../AbstractConference';
|
||||||
import Labels from './Labels';
|
import Labels from './Labels';
|
||||||
import NavigationBar from './NavigationBar';
|
import NavigationBar from './NavigationBar';
|
||||||
import styles from './styles';
|
import styles, { NAVBAR_GRADIENT_COLORS } from './styles';
|
||||||
|
|
||||||
import type { AbstractProps } from '../AbstractConference';
|
import type { AbstractProps } from '../AbstractConference';
|
||||||
|
|
||||||
|
@ -199,10 +200,14 @@ class Conference extends AbstractConference<Props, *> {
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
_connecting,
|
_connecting,
|
||||||
|
_filmstripVisible,
|
||||||
_largeVideoParticipantId,
|
_largeVideoParticipantId,
|
||||||
_reducedUI,
|
_reducedUI,
|
||||||
_shouldDisplayTileView
|
_shouldDisplayTileView,
|
||||||
|
_toolboxVisible
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
const showGradient = _toolboxVisible;
|
||||||
|
const applyGradientStretching = _filmstripVisible && isNarrowAspectRatio(this) && !_shouldDisplayTileView;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container style = { styles.conference }>
|
<Container style = { styles.conference }>
|
||||||
|
@ -242,6 +247,22 @@ class Conference extends AbstractConference<Props, *> {
|
||||||
pointerEvents = 'box-none'
|
pointerEvents = 'box-none'
|
||||||
style = { styles.toolboxAndFilmstripContainer }>
|
style = { styles.toolboxAndFilmstripContainer }>
|
||||||
|
|
||||||
|
{ showGradient && <LinearGradient
|
||||||
|
colors = { NAVBAR_GRADIENT_COLORS }
|
||||||
|
end = {{
|
||||||
|
x: 0.0,
|
||||||
|
y: 0.0
|
||||||
|
}}
|
||||||
|
pointerEvents = 'none'
|
||||||
|
start = {{
|
||||||
|
x: 0.0,
|
||||||
|
y: applyGradientStretching ? 0.5 : 1.0
|
||||||
|
}}
|
||||||
|
style = { [
|
||||||
|
styles.bottomGradient,
|
||||||
|
applyGradientStretching ? styles.gradientStretchBottom : undefined
|
||||||
|
] } />}
|
||||||
|
|
||||||
<Labels />
|
<Labels />
|
||||||
|
|
||||||
<Captions onPress = { this._onClick } />
|
<Captions onPress = { this._onClick } />
|
||||||
|
@ -249,7 +270,7 @@ class Conference extends AbstractConference<Props, *> {
|
||||||
{ _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
|
{ _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
|
||||||
|
|
||||||
{/*
|
{/*
|
||||||
* The Toolbox is in a stacking layer bellow the Filmstrip.
|
* The Toolbox is in a stacking layer below the Filmstrip.
|
||||||
*/}
|
*/}
|
||||||
<Toolbox />
|
<Toolbox />
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,27 @@
|
||||||
import {
|
import { BoxModel, ColorPalette, fixAndroidViewClipping } from '../../../base/styles';
|
||||||
BoxModel,
|
|
||||||
ColorPalette,
|
|
||||||
createStyleSheet,
|
|
||||||
fixAndroidViewClipping
|
|
||||||
} from '../../../base/styles';
|
|
||||||
|
|
||||||
import { FILMSTRIP_SIZE } from '../../../filmstrip';
|
import { FILMSTRIP_SIZE } from '../../../filmstrip';
|
||||||
|
|
||||||
export const NAVBAR_GRADIENT_COLORS = [ 'black', '#00000000' ];
|
export const NAVBAR_GRADIENT_COLORS = [ '#0000007F', '#00000000' ];
|
||||||
|
|
||||||
|
// From brand guideline
|
||||||
|
const GRADIENT_HEIGHT = 116;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The styles of the feature conference.
|
* The styles of the feature conference.
|
||||||
*/
|
*/
|
||||||
export default createStyleSheet({
|
export default {
|
||||||
|
|
||||||
|
bottomGradient: {
|
||||||
|
bottom: 0,
|
||||||
|
flexDirection: 'column',
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
minHeight: GRADIENT_HEIGHT,
|
||||||
|
left: 0,
|
||||||
|
position: 'absolute',
|
||||||
|
right: 0
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code Conference} style.
|
* {@code Conference} style.
|
||||||
*/
|
*/
|
||||||
|
@ -30,8 +39,12 @@ export default createStyleSheet({
|
||||||
flex: 1
|
flex: 1
|
||||||
},
|
},
|
||||||
|
|
||||||
|
gradientStretchBottom: {
|
||||||
|
height: GRADIENT_HEIGHT + FILMSTRIP_SIZE
|
||||||
|
},
|
||||||
|
|
||||||
gradientStretch: {
|
gradientStretch: {
|
||||||
height: 116
|
height: GRADIENT_HEIGHT
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,10 +125,11 @@ export default createStyleSheet({
|
||||||
* the {@link Toolbox}.
|
* the {@link Toolbox}.
|
||||||
*/
|
*/
|
||||||
toolboxAndFilmstripContainer: {
|
toolboxAndFilmstripContainer: {
|
||||||
bottom: BoxModel.margin,
|
bottom: 0,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
left: 0,
|
left: 0,
|
||||||
|
paddingBottom: BoxModel.padding,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 0,
|
right: 0,
|
||||||
|
|
||||||
|
@ -124,4 +138,4 @@ export default createStyleSheet({
|
||||||
// not enough.
|
// not enough.
|
||||||
top: BoxModel.margin * 3
|
top: BoxModel.margin * 3
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
Loading…
Reference in New Issue