v1.0.0-beta/amazon styling fix

This commit is contained in:
Ayushya Amitabh
2020-04-22 13:13:59 -04:00
parent 9604d8c448
commit d301a61349
5 changed files with 160 additions and 41 deletions
+37 -13
View File
@@ -64,6 +64,11 @@ export default class Chat extends Component {
roomId: window.localStorage.getItem('watchPartyRoomId'),
});
this.port.onMessage.addListener((response) => {
if (response.isError === true) {
this.props.notify('Uh oh. Got lost from the party.');
goTo(Create, this.props);
return;
}
this.setState(response);
if (response.player && this.state.localPlayer.status !== response.player.status) {
if (response.player.source !== getPlayerSource()) {
@@ -104,6 +109,10 @@ export default class Chat extends Component {
time,
source,
},
}).catch((err) => {
this.props.updateLoading(false);
this.props.notify(err.message || err.statusText);
console.error('Sync Party API error', err);
});
} else {
this.mVideoListener.start();
@@ -115,12 +124,18 @@ export default class Chat extends Component {
const data = {
roomId: window.localStorage.getItem('watchPartyRoomId'),
};
DeleteRoomApi(data).then((res) => {
this.props.notify('Ended party');
window.localStorage.removeItem('watchPartyRoomId');
goTo(Create, this.props);
this.props.updateLoading(false);
});
DeleteRoomApi(data)
.then((res) => {
this.props.notify('Ended party');
window.localStorage.removeItem('watchPartyRoomId');
goTo(Create, this.props);
this.props.updateLoading(false);
})
.catch((err) => {
this.props.updateLoading(false);
this.props.notify(err.message || err.statusText);
console.error('End Party API error', err);
});
}
leaveParty() {
this.props.notify('Leaving party...');
@@ -129,12 +144,18 @@ export default class Chat extends Component {
roomId: window.localStorage.getItem('watchPartyRoomId'),
uid: window.localStorage.getItem('watchPartyUserUid'),
};
LeaveRoomApi(data).then((res) => {
this.props.notify('Left party');
window.localStorage.removeItem('watchPartyRoomId');
goTo(Create, this.props);
this.props.updateLoading(false);
});
LeaveRoomApi(data)
.then((res) => {
this.props.notify('Left party');
window.localStorage.removeItem('watchPartyRoomId');
goTo(Create, this.props);
this.props.updateLoading(false);
})
.catch((err) => {
this.props.updateLoading(false);
this.props.notify(err.message || err.statusText);
console.error('End Party API error', err);
});
}
shareParty() {
const el = document.createElement('textarea');
@@ -153,7 +174,10 @@ export default class Chat extends Component {
text: message,
time: new Date().toISOString(),
};
SendMessageApi(data);
SendMessageApi(data).catch((err) => {
this.props.notify(err.message || err.statusText);
console.error('Send Message API error', err);
});
}
render() {
const { admin, name, messages, newMessage } = this.state;
+4 -3
View File
@@ -32,13 +32,14 @@ const joinRoom = async (data) => {
const apidata = {
roomId: data.joinName.trim(),
userName: data.name.trim(),
source: getPlayerSource(),
};
const confirmedRoomId = await JoinRoomApi(apidata)
.then((res) => res.json())
.then((res) => res.roomId)
.catch((err) => {
data.props.updateLoading(false);
data.props.notify(err.statusText);
data.props.notify(err.message || err.statusText);
console.error('Join Room API error', err);
});
if (confirmedRoomId && confirmedRoomId === apidata.roomId) {
@@ -86,12 +87,12 @@ const createRoom = async (data) => {
goTo(Chat, data.props);
} else {
data.props.updateLoading(false);
data.props.notify(res.statusText);
data.props.notify(res.message || res.statusText);
}
})
.catch((err) => {
data.props.updateLoading(false);
data.props.notify(err.statusText);
data.props.notify(err.message || err.statusText);
console.error('Create Room API error', err);
});
};
+22
View File
@@ -31,6 +31,28 @@ body.amazon-prime #party-routes-wrapper {
width: 35% !important;
height: 100% !important;
}
/* AMAZON STYLING FIX */
body.amazon-prime input,
body.amazon-prime textarea {
background-color: inherit !important;
border: initial !important;
box-shadow: none !important;
}
body.amazon-prime input.MuiInputBase-input {
height: 1.1876em !important;
padding: 6px 0 7px !important;
}
body.amazon-prime input.MuiFilledInput-inputAdornedEnd {
padding-right: 0 !important;
}
body.amazon-prime input.MuiFilledInput-input {
padding: 27px 12px 10px !important;
}
body.amazon-prime input:focus,
body.amazon-prime textarea:focus {
border: none !important;
box-shadow: none !important;
}
@keyframes backgroundpulse {
0% {