Skip to content

Commit

Permalink
refactor: memoized value
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <[email protected]>
  • Loading branch information
bryce-mcmath committed Dec 16, 2024
1 parent d4482d0 commit aed2b67
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/screens/Splash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@ const Splash = () => {
}
}

const secondaryCallToActionIcon = useMemo(
() =>
reported ? (
<Icon style={{ marginRight: 8 }} name={'check-circle'} size={18} color={ColorPallet.semantic.success} />
) : undefined,
[reported, ColorPallet.semantic.success]
)

return (
<SafeAreaView style={styles.screenContainer}>
<ScrollView contentContainerStyle={styles.scrollContentContainer}>
Expand All @@ -394,7 +402,7 @@ const Splash = () => {
onCallToActionPressed={handleErrorCallToActionPressed}
secondaryCallToActionTitle={reported ? t('Error.Reported') : t('Error.ReportThisProblem')}
secondaryCallToActionDisabled={reported}
secondaryCallToActionIcon={reported ? <Icon style={{ marginRight: 8 }} name={'check-circle'} size={18} color={ColorPallet.semantic.success} /> : undefined}
secondaryCallToActionIcon={secondaryCallToActionIcon}
secondaryCallToActionPressed={initError ? report : undefined}
showVersionFooter
/>
Expand Down

0 comments on commit aed2b67

Please sign in to comment.