Skip to content

Commit

Permalink
Add crop icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Neuteboom committed Jun 23, 2024
1 parent 1ca473b commit 72de88d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Icon = ({ name, color, size, testID, style, rotation }: IconProps):
const icon = iconStyle === 'light' ? Icons[name].light : Icons[name].solid
const iconColor = color ?? theme.color.primary
const iconSize = size ?? theme.icon.size.large
const transform = rotation ? { rotate: 42 } : undefined
const transform = rotation ? { rotate: rotation } : undefined

return <FontAwesomeIcon icon={icon} color={iconColor} size={iconSize} testID={testID} transform={transform} />
}
17 changes: 13 additions & 4 deletions src/components/Lightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const getLightboxFooterComponent =
content?: React.ReactNode,
style?: LightboxStyle,
onPressDelete?: () => void,
onPressCrop?: () => void,
) =>
() => (
<SafeAreaView style={styles.lightboxFooterContainer}>
Expand All @@ -57,15 +58,23 @@ const getLightboxFooterComponent =
</View>
)}
{content && <View style={styles.footerItem}>{content}</View>}
{onPressDelete && (
<View style={styles.buttonsContainer}>

<View style={styles.buttonsContainer}>
{onPressDelete && (
<View style={styles.buttonContainer}>
<TouchableOpacity onPress={onPressDelete} hitSlop={hitSlop}>
<Icon name="trash-alt" color={theme.color.white} size={20} testID="delete-photo" />
</TouchableOpacity>
</View>
</View>
)}
)}
{onPressCrop && (
<View style={styles.buttonContainer}>
<TouchableOpacity onPress={onPressCrop} hitSlop={hitSlop}>
<Icon name="crop-alt" color={theme.color.white} size={20} testID="crop-photo" />
</TouchableOpacity>
</View>
)}
</View>
</View>
</SafeAreaView>
)
Expand Down

0 comments on commit 72de88d

Please sign in to comment.