Skip to content

Commit

Permalink
Hyperlinks to legalese such as Privacy Policy and Terms of Service
Browse files Browse the repository at this point in the history
  • Loading branch information
lyubomir committed Nov 29, 2016
1 parent 8410509 commit 1f457df
Show file tree
Hide file tree
Showing 11 changed files with 259 additions and 86 deletions.
87 changes: 87 additions & 0 deletions react/features/base/react/components/Link.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import React, { Component } from 'react';
import { Linking, Text } from 'react-native';

/**
* Implements a (hyper)link to a URL in the fashion of the HTML anchor element
* and its href attribute.
*/
export class Link extends Component {
/**
* Initializes a new Link instance.
*
* @param {Object} props - Component properties.
*/
constructor(props) {
super(props);

// Bind event handlers so they are only bound once for every instance.
this._onPress = this._onPress.bind(this);
}

/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return (
<Text
onPress = { this._onPress }
style = { this.props.style }>
{
this.props.children
}
</Text>
);
}

/**
* Notifies this instance that Linking failed to open the associated URL.
*
* @param {any} reason - The rejection reason.
* @private
* @returns {void}
*/
_onLinkingOpenURLRejected(reason) {
const onRejected = this.props.onLinkingOpenURLRejected;

onRejected && onRejected(reason);
}

/**
* Handles press on this Link. Opens the URL associated with this Link.
*
* @private
* @returns {void}
*/
_onPress() {
Linking.openURL(this.props.url)
.catch(reason => this._onLinkingOpenURLRejected(reason));
}
}

/**
* Link component's property types.
*/
Link.propTypes = {
/**
* The children to be displayed within this Link.
*/
children: React.PropTypes.node,

/**
* Notifies that this Link failed to open the URL associated with it.
*/
onLinkingOpenURLRejected: React.PropTypes.function,

/**
* The CSS style to be applied to this Link for the purposes of display.
*/
style: React.PropTypes.object,

/**
* The URL to be opened when this Link is clicked/pressed.
*/
url: React.PropTypes.string
};
1 change: 1 addition & 0 deletions react/features/base/react/components/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './Container';
export * from './Link';
15 changes: 15 additions & 0 deletions react/features/base/styles/components/styles/BoxModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* The application's default properties related to the CSS box model such as
* margins, borders, padding.
*/
export const BoxModel = {
/**
* The application's default margin when non-zero margin is necessary.
*/
margin: 10,

/**
* The application's default padding when non-zero padding is necessary.
*/
padding: 10
};
27 changes: 21 additions & 6 deletions react/features/base/styles/components/styles/ColorPalette.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
/**
* The application color palette.
* The application's definition of the default color black.
*/
const BLACK = '#111111';

/**
* The application's color palette.
*/
export const ColorPalette = {
appBackground: '#111111',
/**
* The application's background color.
*/
appBackground: BLACK,

/**
* The application's definition of the default color black. Generally,
* expected to be kept in sync with the application's background color for
* the sake of consistency.
*/
black: BLACK,
blue: '#17A0DB',
buttonUnderlay: '#495258',
jitsiBlue: '#17A0DB',
jitsiDarkGrey: '#555555',
jitsiRed: '#D00000',
jitsiToggled: '#495258'
darkGrey: '#555555',
red: '#D00000',
white: 'white'
};
1 change: 1 addition & 0 deletions react/features/base/styles/components/styles/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './BoxModel';
export * from './ColorPalette';
38 changes: 16 additions & 22 deletions react/features/filmStrip/components/native/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import { createStyleSheet } from '../../../base/styles';
import { ColorPalette, createStyleSheet } from '../../../base/styles';

import { styles as platformIndependentStyles } from '../styles';

/**
* The base/default style of indicators such as audioMutedIndicator,
* moderatorIndicator, and videoMutedIndicator.
*/
const indicator = {
textShadowColor: ColorPalette.black,
textShadowOffset: {
height: -1,
width: 0
}
};

/**
* Native-specific styles for the film strip.
*/
Expand All @@ -10,13 +22,7 @@ export const styles = createStyleSheet(platformIndependentStyles, {
/**
* Audio muted indicator style.
*/
audioMutedIndicator: {
textShadowColor: 'black',
textShadowOffset: {
height: -1,
width: 0
}
},
audioMutedIndicator: indicator,

/**
* Dominant speaker indicator background style.
Expand All @@ -29,13 +35,7 @@ export const styles = createStyleSheet(platformIndependentStyles, {
/**
* Moderator indicator style.
*/
moderatorIndicator: {
textShadowColor: 'black',
textShadowOffset: {
height: -1,
width: 0
}
},
moderatorIndicator: indicator,

/**
* Video thumbnail style.
Expand All @@ -48,11 +48,5 @@ export const styles = createStyleSheet(platformIndependentStyles, {
/**
* Video muted indicator style.
*/
videoMutedIndicator: {
textShadowColor: 'black',
textShadowOffset: {
height: -1,
width: 0
}
}
videoMutedIndicator: indicator
});
22 changes: 11 additions & 11 deletions react/features/filmStrip/components/styles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColorPalette } from '../../base/styles';
import { BoxModel, ColorPalette } from '../../base/styles';

/**
* Film strip related styles common to both Web and native.
Expand All @@ -9,7 +9,7 @@ export const styles = {
*/
audioMutedIndicator: {
backgroundColor: 'transparent',
color: 'white',
color: ColorPalette.white,
left: 20,
position: 'absolute',
top: 1
Expand All @@ -19,15 +19,15 @@ export const styles = {
* Dominant speaker indicator style.
*/
dominantSpeakerIndicator: {
color: 'white',
color: ColorPalette.white,
fontSize: 15
},

/**
* Dominant speaker indicator background style.
*/
dominantSpeakerIndicatorBackground: {
backgroundColor: ColorPalette.jitsiBlue,
backgroundColor: ColorPalette.blue,
borderRadius: 15,
bottom: 2,
left: 1,
Expand All @@ -41,7 +41,7 @@ export const styles = {
filmStrip: {
alignItems: 'flex-end',
alignSelf: 'stretch',
bottom: 10,
bottom: BoxModel.margin,
flex: 1,
flexDirection: 'column',
left: 0,
Expand All @@ -55,15 +55,15 @@ export const styles = {
* to allow scrolling through them if they do not fit within the display.
*/
filmStripScrollViewContentContainer: {
paddingHorizontal: 10
paddingHorizontal: BoxModel.padding
},

/**
* Moderator indicator style.
*/
moderatorIndicator: {
backgroundColor: 'transparent',
color: 'white',
color: ColorPalette.white,
left: 1,
position: 'absolute',
top: 1
Expand All @@ -74,7 +74,7 @@ export const styles = {
*/
thumbnail: {
alignItems: 'stretch',
backgroundColor: 'black',
backgroundColor: ColorPalette.appBackground,
borderColor: '#424242',
borderStyle: 'solid',
borderWidth: 1,
Expand All @@ -88,8 +88,8 @@ export const styles = {
* Pinned video thumbnail style.
*/
thumbnailPinned: {
borderColor: ColorPalette.jitsiBlue,
shadowColor: 'black',
borderColor: ColorPalette.blue,
shadowColor: ColorPalette.black,
shadowOffset: {
height: 5,
width: 5
Expand All @@ -102,7 +102,7 @@ export const styles = {
*/
videoMutedIndicator: {
backgroundColor: 'transparent',
color: 'white',
color: ColorPalette.white,
left: 35,
position: 'absolute',
top: 1
Expand Down
2 changes: 1 addition & 1 deletion react/features/toolbar/components/Toolbar.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Toolbar extends AbstractToolbar {
onClick = { this._onHangup }
style = {{
...styles.toolbarButton,
backgroundColor: ColorPalette.jitsiRed
backgroundColor: ColorPalette.red
}}
underlayColor = { underlayColor } />
<ToolbarButton
Expand Down
8 changes: 4 additions & 4 deletions react/features/toolbar/components/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const container = {
*/
const icon = {
alignSelf: 'center',
color: ColorPalette.jitsiDarkGrey,
color: ColorPalette.darkGrey,
fontSize: 24
};

Expand All @@ -49,7 +49,7 @@ export const styles = createStyleSheet({
*/
icon: {
...icon,
color: ColorPalette.jitsiDarkGrey
color: ColorPalette.darkGrey
},

/**
Expand All @@ -74,7 +74,7 @@ export const styles = createStyleSheet({
*/
toolbarButton: {
...button,
backgroundColor: 'white',
backgroundColor: ColorPalette.white,
marginLeft: 20,
marginRight: 20,
opacity: 0.8
Expand Down Expand Up @@ -104,6 +104,6 @@ export const styles = createStyleSheet({
*/
whiteIcon: {
...icon,
color: 'white'
color: ColorPalette.white
}
});
Loading

0 comments on commit 1f457df

Please sign in to comment.