v1.6.0/copyright updates
This commit is contained in:
+75
-43
@@ -5,20 +5,29 @@ Proprietary and confidential
|
||||
Written by Ayushya Amitabh <admin@chromewatchparty.com>, 2020
|
||||
https://www.chromewatchparty.com/copyright
|
||||
=========================================================================
|
||||
ALL CONTENT ON IN WATCH PARTY'S CHROME EXTENSION APP, UNLESS OTHERWISE
|
||||
ALL CONTENT ON WATCH PARTY'S WEBSITE OR IN WATCH PARTY'S CHROME EXTENSION APP, UNLESS OTHERWISE
|
||||
CITED ARE THE SOLE INTELECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE
|
||||
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
|
||||
|
||||
Netflix logo is a trademark and intellectual property of Netflix, Inc.
|
||||
Disney+ logo is a trademark and intellectual property of The Walt Disney Company
|
||||
Prime logo is a trademark and intellectual property of Amazon.com, Inc.
|
||||
YouTube logo is a trademark and intellectual property of Google, Inc.
|
||||
Hulu logo is a trademark and intellectual property of Hulu, LLC.
|
||||
HBO Now and HBO Max logos are trademark and intellectual property of WarnerMedia Direct,LLC.
|
||||
************************************************************************/
|
||||
/*global chrome */
|
||||
import React, { Component } from 'react';
|
||||
import { Button, FormControlLabel, Switch, TextField, Typography, Paper, ButtonGroup, ExpansionPanel, ExpansionPanelSummary, ExpansionPanelDetails, MobileStepper, IconButton, Card, CardContent, CardActions } from '@material-ui/core';
|
||||
import {
|
||||
Button,
|
||||
FormControlLabel,
|
||||
Switch,
|
||||
TextField,
|
||||
Typography,
|
||||
Paper,
|
||||
ButtonGroup,
|
||||
ExpansionPanel,
|
||||
ExpansionPanelSummary,
|
||||
ExpansionPanelDetails,
|
||||
MobileStepper,
|
||||
IconButton,
|
||||
Card,
|
||||
CardContent,
|
||||
CardActions,
|
||||
} from '@material-ui/core';
|
||||
import {
|
||||
JoinRoomApi,
|
||||
CreateRoomApi,
|
||||
@@ -40,9 +49,9 @@ import {
|
||||
ExpandLess,
|
||||
KeyboardArrowLeft,
|
||||
KeyboardArrowRight,
|
||||
Notifications
|
||||
Notifications,
|
||||
} from '@material-ui/icons';
|
||||
import { Autocomplete } from "@material-ui/lab";
|
||||
import { Autocomplete } from '@material-ui/lab';
|
||||
|
||||
const CONSTANTS = {
|
||||
USER_NAME_LENGTH: 12,
|
||||
@@ -60,7 +69,10 @@ export default class Create extends Component {
|
||||
mode: defaultMode,
|
||||
parties: [],
|
||||
adminOnly: false,
|
||||
alertStep: this.props.status && this.props.status.importantAlert ? this.props.status.importantAlert : 0,
|
||||
alertStep:
|
||||
this.props.status && this.props.status.importantAlert
|
||||
? this.props.status.importantAlert
|
||||
: 0,
|
||||
allowAutoRejoin:
|
||||
LocalData().allowAutoRejoin !== undefined ? LocalData().allowAutoRejoin : true,
|
||||
allowChatNotification:
|
||||
@@ -85,7 +97,7 @@ export default class Create extends Component {
|
||||
}
|
||||
chrome.runtime.sendMessage(
|
||||
{
|
||||
type: 'GET_PARTIES'
|
||||
type: 'GET_PARTIES',
|
||||
},
|
||||
(response) => {
|
||||
this.setState({ parties: response });
|
||||
@@ -198,15 +210,15 @@ export default class Create extends Component {
|
||||
goTo(Chat, this.props);
|
||||
}
|
||||
partyNameAutocompleteProcessor(v) {
|
||||
if (v !== null && v !== undefined && typeof (v) === 'object') {
|
||||
if (v !== null && v !== undefined && typeof v === 'object') {
|
||||
if (v.name) this.partyNameChange(v.name);
|
||||
else this.partyNameChange('');
|
||||
if (v.pin) this.partyPinChange(v.pin);
|
||||
else this.partyPinChange('');
|
||||
} else if (typeof (v) === 'object' && (v === null || v === undefined)) {
|
||||
} else if (typeof v === 'object' && (v === null || v === undefined)) {
|
||||
this.partyNameChange('');
|
||||
this.partyPinChange('');
|
||||
} else if (v !== undefined && v !== null && typeof (v) === 'string') {
|
||||
} else if (v !== undefined && v !== null && typeof v === 'string') {
|
||||
this.partyNameChange(v);
|
||||
}
|
||||
}
|
||||
@@ -218,13 +230,13 @@ export default class Create extends Component {
|
||||
updateLocalData({ allowAutoRejoin: !this.state.allowAutoRejoin });
|
||||
this.setState({ allowAutoRejoin: !this.state.allowAutoRejoin });
|
||||
}
|
||||
clearPartyHistory () {
|
||||
clearPartyHistory() {
|
||||
this.setState({
|
||||
parties: [],
|
||||
});
|
||||
chrome.runtime.sendMessage({type: 'EMPTY_PARTIES'});
|
||||
chrome.runtime.sendMessage({ type: 'EMPTY_PARTIES' });
|
||||
}
|
||||
handleSteps (direction) {
|
||||
handleSteps(direction) {
|
||||
const { alertStep } = this.state;
|
||||
if (alertStep + direction < 0) return;
|
||||
if (alertStep + direction >= this.props.status.alerts.length) return;
|
||||
@@ -240,7 +252,7 @@ export default class Create extends Component {
|
||||
adminOnly,
|
||||
allowAutoRejoin,
|
||||
allowChatNotification,
|
||||
alertStep
|
||||
alertStep,
|
||||
} = this.state;
|
||||
const { status } = this.props;
|
||||
return (
|
||||
@@ -290,13 +302,13 @@ export default class Create extends Component {
|
||||
<Autocomplete
|
||||
color="secondary"
|
||||
options={parties}
|
||||
getOptionLabel={o => o.name}
|
||||
getOptionLabel={(o) => o.name}
|
||||
autoComplete
|
||||
freeSolo
|
||||
value={{name:name, pin: pin}}
|
||||
onInputChange={(e,v,r) => this.partyNameAutocompleteProcessor({name: v, pin: pin})}
|
||||
value={{ name: name, pin: pin }}
|
||||
onInputChange={(e, v, r) => this.partyNameAutocompleteProcessor({ name: v, pin: pin })}
|
||||
onChange={(e, v) => this.partyNameAutocompleteProcessor(v)}
|
||||
renderInput={(params) =>
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
color="secondary"
|
||||
size="small"
|
||||
@@ -305,7 +317,8 @@ export default class Create extends Component {
|
||||
label="Party Name"
|
||||
variant="outlined"
|
||||
helperText={name ? `${name.length}/${CONSTANTS.NAME_LENGTH} Characters` : null}
|
||||
/>}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<TextField
|
||||
color="secondary"
|
||||
@@ -319,7 +332,9 @@ export default class Create extends Component {
|
||||
helperText={pin ? `${pin.length}/${CONSTANTS.PIN_LENGTH} Digits` : null}
|
||||
/>
|
||||
<FormControlLabel
|
||||
className={`notification-switch admin-only-switch ${mode !== 'create' ? 'admin-only-switch-hidden' : ''}`}
|
||||
className={`notification-switch admin-only-switch ${
|
||||
mode !== 'create' ? 'admin-only-switch-hidden' : ''
|
||||
}`}
|
||||
control={
|
||||
<Switch
|
||||
checked={adminOnly}
|
||||
@@ -331,14 +346,16 @@ export default class Create extends Component {
|
||||
label={
|
||||
<span>
|
||||
Admin Only Mode (can be changed later)
|
||||
<br />
|
||||
<br />
|
||||
<span style={{ color: '#8a8a8a' }}>
|
||||
{adminOnly ? 'Only admin will update currently playing and start calls' : 'All members will update currently playing and start calls'}
|
||||
{adminOnly
|
||||
? 'Only admin will update currently playing and start calls'
|
||||
: 'All members will update currently playing and start calls'}
|
||||
</span>
|
||||
</span>
|
||||
}
|
||||
labelPlacement="end"
|
||||
/>
|
||||
/>
|
||||
<Button
|
||||
size="small"
|
||||
variant="contained"
|
||||
@@ -348,7 +365,7 @@ export default class Create extends Component {
|
||||
<span>{mode === 'create' ? 'Start Party' : 'Join Party'}</span> <ChevronRight />
|
||||
</Button>
|
||||
</Paper>
|
||||
<ExpansionPanel defaultExpanded className="create-settings-card" >
|
||||
<ExpansionPanel defaultExpanded className="create-settings-card">
|
||||
<ExpansionPanelSummary expandIcon={<ExpandLess />}>
|
||||
<Notifications />
|
||||
<Typography className="create-settings-title" variant="button">
|
||||
@@ -356,7 +373,7 @@ export default class Create extends Component {
|
||||
</Typography>
|
||||
</ExpansionPanelSummary>
|
||||
<ExpansionPanelDetails>
|
||||
{status ?
|
||||
{status ? (
|
||||
<div className="alerts-stepper-container">
|
||||
<Card className="alerts-stepper-card" elevation={10}>
|
||||
<CardContent>
|
||||
@@ -367,31 +384,45 @@ export default class Create extends Component {
|
||||
{status.alerts[alertStep].description}
|
||||
</Typography>
|
||||
</CardContent>
|
||||
{
|
||||
status.alerts[alertStep].link &&
|
||||
status.alerts[alertStep].linkText &&
|
||||
{status.alerts[alertStep].link && status.alerts[alertStep].linkText && (
|
||||
<CardActions>
|
||||
<Button href={status.alerts[alertStep].link} target="_blank" size="small">{status.alerts[alertStep].linkText}</Button>
|
||||
<Button href={status.alerts[alertStep].link} target="_blank" size="small">
|
||||
{status.alerts[alertStep].linkText}
|
||||
</Button>
|
||||
</CardActions>
|
||||
}
|
||||
</Card>
|
||||
)}
|
||||
</Card>
|
||||
<MobileStepper
|
||||
className="alerts-stepper-controls"
|
||||
variant="dots"
|
||||
color="secondary"
|
||||
activeStep={alertStep}
|
||||
backButton={<IconButton disabled={alertStep === 0} onClick={() => this.handleSteps(-1)}> <KeyboardArrowLeft /> </IconButton>}
|
||||
nextButton={<IconButton disabled={alertStep === (status.alerts.length - 1)} onClick={() => this.handleSteps(1)}> <KeyboardArrowRight /> </IconButton>}
|
||||
backButton={
|
||||
<IconButton disabled={alertStep === 0} onClick={() => this.handleSteps(-1)}>
|
||||
{' '}
|
||||
<KeyboardArrowLeft />{' '}
|
||||
</IconButton>
|
||||
}
|
||||
nextButton={
|
||||
<IconButton
|
||||
disabled={alertStep === status.alerts.length - 1}
|
||||
onClick={() => this.handleSteps(1)}
|
||||
>
|
||||
{' '}
|
||||
<KeyboardArrowRight />{' '}
|
||||
</IconButton>
|
||||
}
|
||||
steps={status.alerts ? status.alerts.length : 0}
|
||||
/>
|
||||
</div>
|
||||
: (<Typography color="textSecondary" gutterBottom variant="overline">
|
||||
) : (
|
||||
<Typography color="textSecondary" gutterBottom variant="overline">
|
||||
No alerts right now
|
||||
</Typography>)
|
||||
}
|
||||
</Typography>
|
||||
)}
|
||||
</ExpansionPanelDetails>
|
||||
</ExpansionPanel>
|
||||
<ExpansionPanel className="create-settings-card" >
|
||||
<ExpansionPanel className="create-settings-card">
|
||||
<ExpansionPanelSummary expandIcon={<ExpandLess />}>
|
||||
<Settings />
|
||||
<Typography className="create-settings-title" variant="button">
|
||||
@@ -440,6 +471,7 @@ export default class Create extends Component {
|
||||
labelPlacement="end"
|
||||
/>
|
||||
<Button
|
||||
color="primary"
|
||||
fullWidth
|
||||
variant="contained"
|
||||
onClick={this.clearPartyHistory}
|
||||
|
||||
Reference in New Issue
Block a user