Skip to content

Commit

Permalink
feat: update soil color photo buttons (#2714)
Browse files Browse the repository at this point in the history
  • Loading branch information
tm-ruxandra authored Dec 30, 2024
1 parent 85d5921 commit 912fda5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
33 changes: 13 additions & 20 deletions dev-client/src/components/inputs/image/ImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ import {createAssetAsync} from 'expo-media-library';

import {Buffer} from '@craftzdog/react-native-buffer';
import {decode} from 'jpeg-js';
import {Button} from 'native-base';

import {Icon} from 'terraso-mobile-client/components/icons/Icon';
import {ContainedButton} from 'terraso-mobile-client/components/buttons/ContainedButton';
import {
ModalHandle,
ModalTrigger,
Expand Down Expand Up @@ -90,8 +89,6 @@ export const ImagePicker = ({onPick, children, featureName}: Props) => {
ref.current?.onClose();
}, [onPick]);

const onCancel = useCallback(() => ref.current?.onClose(), []);

return (
<StandaloneOverlaySheet trigger={children} ref={ref}>
<Column padding="lg" space="md">
Expand All @@ -103,12 +100,13 @@ export const ImagePicker = ({onPick, children, featureName}: Props) => {
permissionHook={useCameraPermissions}
permissionedAction={onUseCamera}>
{onRequestAction => (
<Button
_text={{textTransform: 'uppercase'}}
<ContainedButton
label={t('image.use_camera')}
size="lg"
stretchToFit={true}
onPress={onRequestAction}
rightIcon={<Icon name="photo-camera" />}>
{t('image.use_camera')}
</Button>
leftIcon="photo-camera"
/>
)}
</PermissionsRequestWrapper>
<PermissionsRequestWrapper
Expand All @@ -119,20 +117,15 @@ export const ImagePicker = ({onPick, children, featureName}: Props) => {
permissionHook={useMediaLibraryPermissions}
permissionedAction={onUseMediaLibrary}>
{onRequestAction => (
<Button
_text={{textTransform: 'uppercase'}}
<ContainedButton
label={t('image.choose_from_gallery')}
size="lg"
stretchToFit={true}
onPress={onRequestAction}
rightIcon={<Icon name="photo-library" />}>
{t('image.choose_from_gallery')}
</Button>
leftIcon="photo-library"
/>
)}
</PermissionsRequestWrapper>
<Button
_text={{textTransform: 'uppercase'}}
variant="outline"
onPress={onCancel}>
{t('general.cancel')}
</Button>
</Column>
</StandaloneOverlaySheet>
);
Expand Down
4 changes: 2 additions & 2 deletions dev-client/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@
}
},
"image": {
"use_camera": "Take Photo",
"choose_from_gallery": "Photo Library"
"use_camera": "Use Camera",
"choose_from_gallery": "Choose from Gallery"
}
}
4 changes: 2 additions & 2 deletions dev-client/src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@
"text_input_label": "Filtrar lista por entrada de búsqueda"
},
"image": {
"use_camera": "Sacar foto",
"choose_from_gallery": "Biblioteca de fotos"
"use_camera": "Use Camera TK",
"choose_from_gallery": "Choose from Gallery TK"
},
"info": {
"title": "Descubre el potencial de tu paisaje",
Expand Down

0 comments on commit 912fda5

Please sign in to comment.