Apply prettier formatting

This commit is contained in:
Michael Weimann 2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
1576 changed files with 65385 additions and 62478 deletions

View file

@ -18,7 +18,7 @@ import React, { CSSProperties } from "react";
import classNames from "classnames";
interface WaveformCSSProperties extends CSSProperties {
'--barHeight': number;
"--barHeight": number;
}
interface IProps {
@ -26,8 +26,7 @@ interface IProps {
progress: number; // percent complete, 0-1, default 100%
}
interface IState {
}
interface IState {}
/**
* A simple waveform component. This renders bars (centered vertically) for each
@ -43,22 +42,28 @@ export default class Waveform extends React.PureComponent<IProps, IState> {
};
public render() {
return <div className='mx_Waveform'>
{ this.props.relHeights.map((h, i) => {
const progress = this.props.progress;
const isCompleteBar = (i / this.props.relHeights.length) <= progress && progress > 0;
const classes = classNames({
'mx_Waveform_bar': true,
'mx_Waveform_bar_100pct': isCompleteBar,
});
return <span
key={i}
style={{
"--barHeight": h,
} as WaveformCSSProperties}
className={classes}
/>;
}) }
</div>;
return (
<div className="mx_Waveform">
{this.props.relHeights.map((h, i) => {
const progress = this.props.progress;
const isCompleteBar = i / this.props.relHeights.length <= progress && progress > 0;
const classes = classNames({
mx_Waveform_bar: true,
mx_Waveform_bar_100pct: isCompleteBar,
});
return (
<span
key={i}
style={
{
"--barHeight": h,
} as WaveformCSSProperties
}
className={classes}
/>
);
})}
</div>
);
}
}