Merge pull request #1417 from Bilb/fix-recording-view

Fix recording view
pull/1435/head
Audric Ackermann 5 years ago committed by GitHub
commit fb760a85e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -81,7 +81,6 @@ interface State {
message: string; message: string;
showRecordingView: boolean; showRecordingView: boolean;
mediaSetting: boolean | null;
showEmojiPanel: boolean; showEmojiPanel: boolean;
voiceRecording?: Blob; voiceRecording?: Blob;
ignoredLink?: string; // set the the ignored url when users closed the link preview ignoredLink?: string; // set the the ignored url when users closed the link preview
@ -115,7 +114,6 @@ const getDefaultState = () => {
message: '', message: '',
voiceRecording: undefined, voiceRecording: undefined,
showRecordingView: false, showRecordingView: false,
mediaSetting: null,
showEmojiPanel: false, showEmojiPanel: false,
ignoredLink: undefined, ignoredLink: undefined,
stagedLinkPreview: undefined, stagedLinkPreview: undefined,
@ -177,11 +175,6 @@ export class SessionCompositionBox extends React.Component<Props, State> {
this.fetchUsersForGroup = this.fetchUsersForGroup.bind(this); this.fetchUsersForGroup = this.fetchUsersForGroup.bind(this);
} }
public async componentWillMount() {
const mediaSetting = await window.getSettingValue('media-permissions');
this.setState({ mediaSetting });
}
public componentDidMount() { public componentDidMount() {
setTimeout(this.focusCompositionBox, 100); setTimeout(this.focusCompositionBox, 100);
} }
@ -937,9 +930,9 @@ export class SessionCompositionBox extends React.Component<Props, State> {
this.onExitVoiceNoteView(); this.onExitVoiceNoteView();
} }
private onLoadVoiceNoteView() { private async onLoadVoiceNoteView() {
// Do stuff for component, then run callback to SessionConversation // Do stuff for component, then run callback to SessionConversation
const { mediaSetting } = this.state; const mediaSetting = await window.getSettingValue('media-permissions');
if (mediaSetting) { if (mediaSetting) {
this.setState({ this.setState({

@ -382,7 +382,6 @@ class SessionRecordingInner extends React.Component<Props, State> {
this.pauseAudio(); this.pauseAudio();
return; return;
} }
requestAnimationFrame(drawSweepingTimeline); requestAnimationFrame(drawSweepingTimeline);
}; };
@ -497,7 +496,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
processor.onaudioprocess = () => { processor.onaudioprocess = () => {
const streamParams = { stream, media, input, processor }; const streamParams = { stream, media, input, processor };
this.setState({ streamParams }); this.setState({ streamParams });
const { textColorSubtle } = this.props.theme.colors; const { textColorSubtleNoOpacity } = this.props.theme.colors;
const { const {
width, width,
@ -554,7 +553,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
const offsetY = Math.ceil(height / 2 - barHeight / 2); const offsetY = Math.ceil(height / 2 - barHeight / 2);
if (canvasContext) { if (canvasContext) {
canvasContext.fillStyle = textColorSubtle; canvasContext.fillStyle = textColorSubtleNoOpacity;
this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight); this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight);
} }
} }
@ -612,7 +611,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
minBarHeight, minBarHeight,
} = this.state.canvasParams; } = this.state.canvasParams;
const { textColorSubtle } = this.props.theme.colors; const { textColorSubtleNoOpacity } = this.props.theme.colors;
const numBars = width / (barPadding + barWidth); const numBars = width / (barPadding + barWidth);
@ -668,7 +667,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
const offsetX = Math.ceil(i * (barWidth + barPadding)); const offsetX = Math.ceil(i * (barWidth + barPadding));
const offsetY = Math.ceil(height / 2 - barHeight / 2); const offsetY = Math.ceil(height / 2 - barHeight / 2);
canvasContext.fillStyle = textColorSubtle; canvasContext.fillStyle = textColorSubtleNoOpacity;
this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight); this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight);
} }

@ -49,6 +49,7 @@ export const lightTheme: DefaultTheme = {
// text // text
textColor: black, textColor: black,
textColorSubtle: `${black}99`, textColorSubtle: `${black}99`,
textColorSubtleNoOpacity: '#52514f',
textColorOpposite: white, textColorOpposite: white,
textHighlight: `${black}33`, textHighlight: `${black}33`,
// inbox // inbox
@ -103,6 +104,7 @@ export const darkTheme = {
// text // text
textColor: white, textColor: white,
textColorSubtle: `${white}99`, textColorSubtle: `${white}99`,
textColorSubtleNoOpacity: '#7f7d7d',
textColorOpposite: black, textColorOpposite: black,
textHighlight: `${accentDarkTheme}99`, textHighlight: `${accentDarkTheme}99`,
// inbox // inbox

1
ts/styled.d.ts vendored

@ -35,6 +35,7 @@ declare module 'styled-components' {
// text // text
textColor: string; textColor: string;
textColorSubtle: string; textColorSubtle: string;
textColorSubtleNoOpacity: string;
textColorOpposite: string; textColorOpposite: string;
textHighlight: string; textHighlight: string;
// inbox // inbox

Loading…
Cancel
Save