Skip to content

Commit 40d89ea

Browse files
authored
fix(site-enhancements): Update theme, faq, copy and notices (#56)
* fix(site-enhancements): Update theme, faq, copy and notices * fix error copy
1 parent e42ef64 commit 40d89ea

File tree

7 files changed

+83
-13
lines changed

7 files changed

+83
-13
lines changed

src/client/utils/theme-colors.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const themes = {
77
orca: {
88
color1: '#44A08D',
99
color2: '#093637'
10+
},
11+
default: {
12+
color1: '#282c34',
13+
primary: '#325D88'
1014
}
1115
}
1216

src/client/utils/theme.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ import { keys } from 'lodash'
22
import themes from './theme-colors'
33

44
// build css gradient
5-
const getBackgroundCSS = ({ color1, color2, color3 }) => (
6-
`
7-
background: ${color1}; /* fallback for old browsers */
8-
background: -webkit-linear-gradient(to right, ${color1}, ${color2}${color3 ? `, ${color3}` : ''} ); /* Chrome 10-25, Safari 5.1-6 */
9-
background: linear-gradient(to right, ${color1}, ${color2}${color3 ? `, ${color3}` : ''}); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
10-
`
11-
)
5+
const getBackgroundCSS = ({ color1, color2, color3 }) => {
6+
if (color1 && !color2 && !color3) {
7+
return `
8+
background: ${color1};
9+
`
10+
} else {
11+
return `
12+
background: ${color1}; /* fallback for old browsers */
13+
background: -webkit-linear-gradient(to right, ${color1}, ${color2}${color3 ? `, ${color3}` : ''} ); /* Chrome 10-25, Safari 5.1-6 */
14+
background: linear-gradient(to right, ${color1}, ${color2}${color3 ? `, ${color3}` : ''}); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
15+
`
16+
}
17+
}
1218

1319
function getRandomIntInclusive (min, max) {
1420
min = Math.ceil(min)
@@ -24,11 +30,13 @@ const getRandomThemeColors = () => {
2430
return themes[themeKeys[randomIndex]]
2531
}
2632

33+
const getDefaultThemeColors = () => themes.default
34+
2735
// get CSS For Random Theme
28-
export function getThemeCSS () {
29-
const themeColors = getRandomThemeColors()
36+
export function getThemeCSS (random = false) {
37+
const themeColors = random ? getRandomThemeColors() : getDefaultThemeColors()
3038
return {
3139
body: getBackgroundCSS(themeColors),
32-
primaryColor: themeColors.color1
40+
primaryColor: themeColors.primary || themeColors.color1
3341
}
3442
}

src/client/views/home/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ a:hover {
4545
.sc-message--text {
4646
background-color: ${themeCSS.primaryColor} !important;
4747
}
48+
.sc-message--content.received .sc-message--text {
49+
color: white !important;
50+
background-color: ${themeCSS.primaryColor} !important;
51+
}
4852
.btn-primary:hover {
4953
background-color: ${themeCSS.primaryColor};
5054
border-color: ${themeCSS.primaryColor};
5155
}
56+
.room-notice {
57+
background: ${themeCSS.primaryColor};
58+
}
5259
`
5360
class Home extends Component {
5461
componentWillMount () {

src/client/views/room/index.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
text-align: center;
44
padding-bottom: 10px;
55
}
6+
7+
.room-notice {
8+
text-align: center;
9+
margin: auto;
10+
width: 50%;
11+
font-size: 18px;
12+
border-radius: 20px;
13+
}

src/client/views/room/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import { Grid, Row, Col } from 'react-bootstrap'
66
import { connect } from 'react-redux'
77
import { initialize, shutdown } from '../../redux/ducks/room'
88
import { onToggleChat } from '../../redux/ducks/chat'
9+
import { isEmpty } from 'lodash'
910
import ChatMenu from './chat-menu'
11+
import WaitingForOthers from './waiting-for-others'
1012
import './index.css'
1113

14+
const errorCopy = 'Encountered an error getting streams. Are you using a supported browser (ex: Google Chrome)? Please clear your cookies and cache for this site and try again.'
1215
class Room extends Component {
1316
componentWillMount () {
1417
this.props.initialize(this.props.roomId)
@@ -33,10 +36,18 @@ class Room extends Component {
3336
/>
3437
</Col>
3538
</Row>
39+
{!this.props.hasPeers && (
40+
<Row>
41+
<Col md={12} xs={12}>
42+
<WaitingForOthers />
43+
<br />
44+
</Col>
45+
</Row>
46+
)}
3647
<Row>
3748
<Col md={12} xs={12}>
3849
{this.props.error
39-
? 'Encountered an error getting streams'
50+
? (errorCopy)
4051
: (
4152
this.props.user && this.props.user.stream
4253
? <VideoContainer />
@@ -63,6 +74,7 @@ Room.propTypes = {
6374

6475
function mapStateToProps (state, ownProps) {
6576
return {
77+
hasPeers: !isEmpty(state.peer),
6678
roomId: ownProps && ownProps.match ? ownProps.match.params.id : null,
6779
error: state.room.error,
6880
user: state.user,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
const copy = 'Waiting for others to join... Use the share feature to send this link to anyone!'
3+
const WaitingForOthers = () => (
4+
<div className='room-notice'>
5+
{copy}
6+
</div>
7+
)
8+
9+
export default WaitingForOthers

src/client/views/welcome/faq.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,30 @@ const FAQ = () => (
2424
</Col>
2525
<Col md={8}>
2626
1. Create a room<br />
27-
2. Share the room with a friend using the link/url <br />
28-
3. When your friend joins the room, you'll instantly see them! <br />
27+
2. Provide access to your camera and microphone (required for it to work)<br />
28+
3. Share the room with a friend using the link/url <br />
29+
4. When your friend joins the room, you'll instantly see them! <br />
30+
</Col>
31+
</Row>
32+
<br />
33+
<Row>
34+
<Col md={4}>
35+
Privacy
36+
</Col>
37+
<Col md={8}>
38+
TalktoMe does not store or record any information in a chat room or about a chat room.
39+
All sessions are active for the duration in which they are live and destroyed after the room is closed.
40+
You cannot see what rooms are active or live at any given time.
41+
The site does use Google Analytics to track general site usage metrics but nothing else.
42+
</Col>
43+
</Row>
44+
<br />
45+
<Row>
46+
<Col md={4}>
47+
Security
48+
</Col>
49+
<Col md={8}>
50+
The technology used by TalktoMe is WebRTC where encryption is madatory by default. All data exchanges over the wire use DTLS, SRTP and the site uses HTTPS.
2951
</Col>
3052
</Row>
3153
<br />

0 commit comments

Comments
 (0)