mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 09:17:20 +00:00
Ta-da. Back button. (#254)
This commit is contained in:
@@ -82,6 +82,11 @@ export default class App extends Component<Props, State> {
|
||||
return this.snackbar.showSnackbar(message, options);
|
||||
}
|
||||
|
||||
@bind
|
||||
private onBack() {
|
||||
this.setState({ file: undefined });
|
||||
}
|
||||
|
||||
render({}: Props, { file, Compress }: State) {
|
||||
return (
|
||||
<div id="app" class={style.app}>
|
||||
@@ -89,7 +94,7 @@ export default class App extends Component<Props, State> {
|
||||
{(!file)
|
||||
? <Intro onFile={this.onIntroPickFile} showSnack={this.showSnack} />
|
||||
: (Compress)
|
||||
? <Compress file={file} showSnack={this.showSnack} />
|
||||
? <Compress file={file} showSnack={this.showSnack} onBack={this.onBack} />
|
||||
: <loading-spinner class={style.appLoader}/>
|
||||
}
|
||||
<snack-bar ref={linkRef(this, 'snackbar')} />
|
||||
|
||||
Reference in New Issue
Block a user