mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
* (lint) MOB-1063 enforce trailing commas * autofix trailing commas * manually fix newly introduced maxlen violations * add trailing comma convention to i18n build
43 lines
966 B
JavaScript
43 lines
966 B
JavaScript
// @flow
|
|
|
|
import {
|
|
WarningSheet,
|
|
} from "components/SharedComponents";
|
|
import type { Node } from "react";
|
|
import React from "react";
|
|
import useTranslation from "sharedHooks/useTranslation";
|
|
|
|
type Props = {
|
|
setShowDiscardSheet: Function,
|
|
hidden?: boolean,
|
|
onDiscard: Function
|
|
}
|
|
|
|
const DiscardChangesSheet = ( {
|
|
setShowDiscardSheet,
|
|
onDiscard,
|
|
hidden,
|
|
}: Props ): Node => {
|
|
const { t } = useTranslation( );
|
|
|
|
return (
|
|
<WarningSheet
|
|
onPressClose={( ) => setShowDiscardSheet( false )}
|
|
headerText={t( "DISCARD-PHOTOS--question" )}
|
|
text={t( "By-exiting-your-photos-will-not-be-saved" )}
|
|
secondButtonText={t( "CANCEL" )}
|
|
handleSecondButtonPress={( ) => setShowDiscardSheet( false )}
|
|
buttonText={t( "DISCARD" )}
|
|
hidden={hidden}
|
|
confirm={( ) => {
|
|
setShowDiscardSheet( false );
|
|
if ( onDiscard ) {
|
|
onDiscard();
|
|
}
|
|
}}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default DiscardChangesSheet;
|