Skip to content
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 @@ -68,7 +68,6 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin

const paidGroupPolicy = Object.values(allPolicies ?? {}).find((policy) => isPaidGroupPolicy(policy) && isPolicyAdmin(policy, session?.email));
const {isOffline} = useNetwork();
const [width, setWidth] = useState(0);
const [isLoading, setIsLoading] = useState(false);

const features: Feature[] = useMemo(() => {
Expand Down Expand Up @@ -324,8 +323,6 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
});
}, []);

const gap = styles.gap3.gap;

const renderItem = useCallback(
(item: Feature) => {
const isSelected = selectedFeatures.includes(item.id);
Expand All @@ -338,7 +335,12 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
accessibilityLabel={item.title}
accessible={false}
hoverStyle={!isSelected ? styles.hoveredComponentBG : undefined}
style={[styles.onboardingInterestedFeaturesItem, isSmallScreenWidth ? styles.flexBasis100 : {maxWidth: (width - gap) / 2}, isSelected && styles.activeComponentBG]}
style={[
styles.onboardingInterestedFeaturesItem,
// 48.5% handles the gap between columns and keeps items aligned when the scrollbar appears
isSmallScreenWidth ? styles.flexBasis100 : {flexBasis: '48.5%', maxWidth: '48.5%'},
isSelected && styles.activeComponentBG,
]}
Comment thread
samranahm marked this conversation as resolved.
sentryLabel={CONST.SENTRY_LABEL.ONBOARDING.INTERESTED_FEATURES_ITEM}
>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.gap3]}>
Expand All @@ -359,7 +361,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
</PressableWithoutFeedback>
);
},
[styles, isSmallScreenWidth, selectedFeatures, handleFeatureSelect, width, gap],
[styles, isSmallScreenWidth, selectedFeatures, handleFeatureSelect],
);

const renderSection = useCallback(
Expand Down Expand Up @@ -399,14 +401,7 @@ function BaseOnboardingInterestedFeatures({shouldUseNativeStyles}: BaseOnboardin
</Text>
</View>

<ScrollView
onLayout={(e) => {
setWidth(e.nativeEvent.layout.width);
}}
style={[onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}
>
{sections.map(renderSection)}
</ScrollView>
<ScrollView style={[onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>{sections.map(renderSection)}</ScrollView>

<FixedFooter style={[styles.pt3, styles.ph5]}>
<Button
Expand Down
1 change: 0 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5035,7 +5035,6 @@ const staticStyles = (theme: ThemeColors) =>
justifyContent: 'space-between',
flexGrow: 1,
flexShrink: 1,
flexBasis: '35%',
},

checkboxWithLabelCheckboxStyle: {
Expand Down
Loading