mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 16:57:26 +00:00
Ta-da. Back button. (#254)
This commit is contained in:
@@ -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
|
||||
? (
|
||||
|
||||
Reference in New Issue
Block a user