Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue