Ta-da. Back button. (#254)

This commit is contained in:
Jake Archibald
2018-11-09 09:13:32 -08:00
committed by GitHub
parent 71f893cb44
commit 9b572f9541
7 changed files with 47 additions and 13 deletions

View File

@@ -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')} />