Skip to content

Commit

Permalink
fix offline indicator styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cdOut committed Apr 4, 2024
1 parent da9a6c7 commit 9d96aec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/FormAlertWithSubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function FormAlertWithSubmitButton({
errorMessageStyle,
}: FormAlertWithSubmitButtonProps) {
const styles = useThemeStyles();
const style = [!footerContent ? {} : styles.mb3, buttonStyles];
const style = [!footerContent ? {} : (styles.mb3, buttonStyles)];

return (
<FormAlertWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
return errors;
};

const PersonalDetailsFooterInstance = <OfflineIndicator />;

return (
<View style={[styles.h100, styles.defaultModalContainer, shouldUseNativeStyles && styles.pt8]}>
<HeaderWithBackButton
Expand All @@ -88,6 +90,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
<FormProvider
style={[styles.flexGrow1, shouldUseNarrowLayout && styles.mt5, shouldUseNarrowLayout ? styles.mh8 : styles.mh5]}
formID={ONYXKEYS.FORMS.ONBOARDING_PERSONAL_DETAILS_FORM}
footerContent={isSmallScreenWidth && PersonalDetailsFooterInstance}
validate={validate}
onSubmit={saveAndNavigate}
submitButtonText={translate('common.continue')}
Expand Down Expand Up @@ -131,7 +134,6 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
/>
</View>
</FormProvider>
{isSmallScreenWidth && <OfflineIndicator />}
</KeyboardAvoidingView>
</View>
);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, on
const [error, setError] = useState(false);
const theme = useTheme();

const PurposeFooterInstance = <OfflineIndicator />;

useEffect(() => {
setSelectedPurpose(onboardingPurposeSelected ?? undefined);
}, [onboardingPurposeSelected]);
Expand Down Expand Up @@ -142,6 +144,7 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, on
</ScrollView>
<FormAlertWithSubmitButton
enabledWhenOffline
footerContent={isSmallScreenWidth && PurposeFooterInstance}
buttonText={translate('common.continue')}
onSubmit={() => {
if (!selectedPurpose) {
Expand All @@ -155,7 +158,6 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, on
isAlertVisible={error || Boolean(errorMessage)}
containerStyles={[styles.w100, styles.mb5, styles.mh0, paddingHorizontal]}
/>
{isSmallScreenWidth && <OfflineIndicator />}
</View>
)}
</SafeAreaConsumer>
Expand Down

0 comments on commit 9d96aec

Please sign in to comment.