Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native "MultiselectRemove" icons #7413

Merged
merged 5 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CompletionError = ({ value }: CompletionCheckProps) => {

return (
<CompletionIconBase style={[animationStyle]}>
<IconMultiselectRemove />
<IconMultiselectRemove size='m' />
</CompletionIconBase>
)
}
Expand Down
54 changes: 5 additions & 49 deletions packages/mobile/src/screens/signon/CreatePassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ import { SafeAreaView } from 'react-native-safe-area-context'
import { useDispatch, useSelector } from 'react-redux'
import { useEffectOnce } from 'react-use'

import {
IconArrowRight,
IconCheck,
IconMultiselectRemove
} from '@audius/harmony-native'
import { CompletionCheck, IconArrowRight } from '@audius/harmony-native'
import Button from 'app/components/button'
import LoadingSpinner from 'app/components/loading-spinner'
import { track, make } from 'app/services/analytics'
Expand Down Expand Up @@ -107,28 +103,9 @@ const styles = StyleSheet.create({
flexDirection: 'row',
alignContent: 'flex-start',
marginTop: 16,
gap: 8,
width: '100%'
},
unchecked: {
width: 16,
height: 16,
borderWidth: 2,
borderColor: '#858199',
borderRadius: 12,
marginRight: 13
},
iconCheck: {
position: 'absolute',
width: 16,
height: 16,
zIndex: 2
},
errorIcon: {
position: 'absolute',
width: 16,
height: 16,
zIndex: 2
},
uncheckedDescription: {
color: '#858199',
fontSize: 14,
Expand Down Expand Up @@ -219,38 +196,17 @@ const Checkbox = ({
}).start(() => {})
}

const animatedStyles = [
styles.iconCheck,
{
opacity,
transform: [
{
scale: opacity.interpolate({
inputRange: [0, 1],
outputRange: [0, 1]
})
}
]
}
]

if (met) {
return (
<View style={styles.checkboxContainer}>
<Animated.View style={animatedStyles}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was easier to just use completioncheck than refactor any further 🤷

<IconCheck style={styles.iconCheck} />
</Animated.View>
<View style={styles.unchecked} />
<CompletionCheck value='complete' />
<Text style={styles.uncheckedDescription}>{messages.checks[i]}</Text>
</View>
)
} else if (error) {
return (
<View style={styles.checkboxContainer}>
<Animated.View style={animatedStyles}>
<IconMultiselectRemove style={styles.iconCheck} />
</Animated.View>
<View style={styles.unchecked} />
<CompletionCheck value='error' />
<Text
style={[styles.uncheckedDescription, { color: errorBorderColor }]}
>
Expand All @@ -261,7 +217,7 @@ const Checkbox = ({
} else {
return (
<View style={styles.checkboxContainer}>
<View style={styles.unchecked} />
<CompletionCheck value='incomplete' />
<Text style={styles.uncheckedDescription}>{messages.checks[i]}</Text>
</View>
)
Expand Down
9 changes: 5 additions & 4 deletions packages/mobile/src/screens/signon/ProfileManual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ const useStyles = makeStyles(({ palette }) => ({
},
errorIcon: {
flex: 1,
width: 12,
height: 12,
marginRight: 10,
alignSelf: 'center'
},
Expand Down Expand Up @@ -320,7 +318,7 @@ const ProfileManual = ({ navigation }: ProfileManualProps) => {
if (!handleIsValid && handleError !== '') {
return (
<View style={styles.errorContainer}>
<IconMultiselectRemove style={styles.errorIcon} />
<IconMultiselectRemove style={styles.errorIcon} size='m' />
<Text style={styles.errorText}>
&nbsp;
{messages.errors[messages.errorTypes.indexOf(handleError)]}
Expand All @@ -331,7 +329,10 @@ const ProfileManual = ({ navigation }: ProfileManualProps) => {
} else {
return (
<View style={styles.errorContainer}>
<IconMultiselectRemove style={[styles.errorIcon, { opacity: 0 }]} />
<IconMultiselectRemove
style={[styles.errorIcon, { opacity: 0 }]}
size='m'
/>
<Text style={styles.errorText}>&nbsp;</Text>
</View>
)
Expand Down
15 changes: 8 additions & 7 deletions packages/mobile/src/screens/signon/SignOn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ const styles = StyleSheet.create({
},
errorIcon: {
flex: 1,
width: 12,
height: 12,
marginRight: 10,
alignSelf: 'center'
},
Expand Down Expand Up @@ -456,7 +454,7 @@ const SignOn = ({ navigation }: SignOnProps) => {
<Animated.View
style={[styles.errorContainer, { opacity: errorOpacity }]}
>
<IconMultiselectRemove style={styles.errorIcon} />
<IconMultiselectRemove style={styles.errorIcon} size='m' />
<Text style={styles.errorText}>{errorMessages.requiresOtp}</Text>
</Animated.View>
)
Expand All @@ -465,7 +463,7 @@ const SignOn = ({ navigation }: SignOnProps) => {
<Animated.View
style={[styles.errorContainer, { opacity: errorOpacity }]}
>
<IconMultiselectRemove style={styles.errorIcon} />
<IconMultiselectRemove style={styles.errorIcon} size='m' />
<Text style={styles.errorText}>{errorMessages.default}</Text>
</Animated.View>
)
Expand All @@ -475,7 +473,7 @@ const SignOn = ({ navigation }: SignOnProps) => {
<Animated.View
style={[styles.errorContainer, { opacity: errorOpacity }]}
>
<IconMultiselectRemove style={styles.errorIcon} />
<IconMultiselectRemove style={styles.errorIcon} size='m' />
<Text style={styles.errorText}>{errorMessages.invalidEmail}</Text>
</Animated.View>
)
Expand All @@ -485,14 +483,17 @@ const SignOn = ({ navigation }: SignOnProps) => {
<Animated.View
style={[styles.errorContainer, { opacity: errorOpacity }]}
>
<IconMultiselectRemove style={styles.errorIcon} />
<IconMultiselectRemove style={styles.errorIcon} size='m' />
<Text style={styles.errorText}>{errorMessages.emptyPassword}</Text>
</Animated.View>
)
}
return (
<View style={styles.errorContainer}>
<IconMultiselectRemove style={[styles.errorIcon, { opacity: 0 }]} />
<IconMultiselectRemove
style={[styles.errorIcon, { opacity: 0 }]}
size='m'
/>
<Text />
</View>
)
Expand Down