diff options
author | Piotr P <piotr.palek@housecallpro.com> | 2024-04-27 14:23:29 +0200 |
---|---|---|
committer | Piotr P <piotr.palek@housecallpro.com> | 2024-04-27 14:31:51 +0200 |
commit | beddddcb579b7bd0a6f4d7d2a014a92a5399f3c6 (patch) | |
tree | 5820aa0777dc1769678c17f3fae749dbf9bbe32e /src | |
parent | bc956803b800715ae2ebbc2105b44c9dc335863b (diff) | |
download | voidsky-beddddcb579b7bd0a6f4d7d2a014a92a5399f3c6.tar.zst |
hide alternative ratio buttons when using custom ratio
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/modals/crop-image/CropImage.web.tsx | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/view/com/modals/crop-image/CropImage.web.tsx b/src/view/com/modals/crop-image/CropImage.web.tsx index a359ed44d..10cae2f17 100644 --- a/src/view/com/modals/crop-image/CropImage.web.tsx +++ b/src/view/com/modals/crop-image/CropImage.web.tsx @@ -117,36 +117,40 @@ export function Component({ maximumValue={3} containerStyle={styles.slider} /> - <TouchableOpacity - onPress={doSetAs(AspectRatio.Wide)} - accessibilityRole="button" - accessibilityLabel={_(msg`Wide`)} - accessibilityHint={_(msg`Sets image aspect ratio to wide`)}> - <RectWideIcon - size={24} - style={as === AspectRatio.Wide ? s.blue3 : pal.text} - /> - </TouchableOpacity> - <TouchableOpacity - onPress={doSetAs(AspectRatio.Tall)} - accessibilityRole="button" - accessibilityLabel={_(msg`Tall`)} - accessibilityHint={_(msg`Sets image aspect ratio to tall`)}> - <RectTallIcon - size={24} - style={as === AspectRatio.Tall ? s.blue3 : pal.text} - /> - </TouchableOpacity> - <TouchableOpacity - onPress={doSetAs(AspectRatio.Square)} - accessibilityRole="button" - accessibilityLabel={_(msg`Square`)} - accessibilityHint={_(msg`Sets image aspect ratio to square`)}> - <SquareIcon - size={24} - style={as === AspectRatio.Square ? s.blue3 : pal.text} - /> - </TouchableOpacity> + {as === AspectRatio.Custom ? null : ( + <> + <TouchableOpacity + onPress={doSetAs(AspectRatio.Wide)} + accessibilityRole="button" + accessibilityLabel={_(msg`Wide`)} + accessibilityHint={_(msg`Sets image aspect ratio to wide`)}> + <RectWideIcon + size={24} + style={as === AspectRatio.Wide ? s.blue3 : pal.text} + /> + </TouchableOpacity> + <TouchableOpacity + onPress={doSetAs(AspectRatio.Tall)} + accessibilityRole="button" + accessibilityLabel={_(msg`Tall`)} + accessibilityHint={_(msg`Sets image aspect ratio to tall`)}> + <RectTallIcon + size={24} + style={as === AspectRatio.Tall ? s.blue3 : pal.text} + /> + </TouchableOpacity> + <TouchableOpacity + onPress={doSetAs(AspectRatio.Square)} + accessibilityRole="button" + accessibilityLabel={_(msg`Square`)} + accessibilityHint={_(msg`Sets image aspect ratio to square`)}> + <SquareIcon + size={24} + style={as === AspectRatio.Square ? s.blue3 : pal.text} + /> + </TouchableOpacity> + </> + )} </View> <View style={styles.btns}> <TouchableOpacity |