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

@@ -60,6 +60,7 @@ interface EncodedImage {
interface Props {
file: File | Fileish;
showSnack: SnackBarElement['showSnackbar'];
onBack: () => void;
}
interface State {
@@ -415,7 +416,7 @@ export default class Compress extends Component<Props, State> {
this.setState({ images });
}
render({ }: Props, { loading, images, source, mobileView }: State) {
render({ onBack }: Props, { loading, images, source, mobileView }: State) {
const [leftImage, rightImage] = images;
const [leftImageData, rightImageData] = images.map(i => i.data);
@@ -460,6 +461,7 @@ export default class Compress extends Component<Props, State> {
rightCompressed={rightImageData}
leftImgContain={leftImage.preprocessorState.resize.fitMethod === 'cover'}
rightImgContain={rightImage.preprocessorState.resize.fitMethod === 'cover'}
onBack={onBack}
/>
{mobileView
? (