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: [IOPLT-989] Add proper configuration of threshold value to the ForceScrollDownView component #6787

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
68 changes: 0 additions & 68 deletions ts/components/animations/ScaleInOutAnimation.tsx

This file was deleted.

22 changes: 10 additions & 12 deletions ts/features/fims/singleSignOn/components/FimsSuccessBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
IOStyles,
IOVisualCostants,
ListItemHeader,
useFooterActionsInlineMeasurements,
useIOTheme,
VSpacer
} from "@pagopa/io-app-design-system";
Expand Down Expand Up @@ -50,6 +51,11 @@ export const FimsFlowSuccessBody = ({
const store = useIOStore();
const serviceId = consents.service_id as ServiceId;

const {
footerActionsInlineMeasurements,
handleFooterActionsInlineMeasurements
} = useFooterActionsInlineMeasurements();

const servicePot = useAutoFetchingServiceByIdPot(serviceId);
const serviceData = pot.toUndefined(servicePot);
const privacyUrl = serviceData?.service_metadata?.privacy_url;
Expand Down Expand Up @@ -100,19 +106,10 @@ export const FimsFlowSuccessBody = ({
return (
<ForceScrollDownView
scrollEnabled
threshold={150}
contentContainerStyle={{
minHeight: "100%"
}}
threshold={footerActionsInlineMeasurements.safeBottomAreaHeight}
contentContainerStyle={{ flexGrow: 1 }}
>
<View
style={[
IOStyles.horizontalContentPadding,
{
flexGrow: 1
}
]}
>
<View style={IOStyles.horizontalContentPadding}>
<VSpacer size={24} />
<HStack space={8} style={{ alignItems: "center" }}>
{/* TODO: We need to add a variant of `Avatar` that
Expand Down Expand Up @@ -148,6 +145,7 @@ export const FimsFlowSuccessBody = ({
<VSpacer size={32} />
</View>
<FooterActions
onMeasure={handleFooterActionsInlineMeasurements}
fixed={false}
actions={{
type: "TwoButtons",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
FooterActions,
ForceScrollDownView,
useFooterActionsInlineMeasurements,
VSpacer
} from "@pagopa/io-app-design-system";
import { RouteProp, useRoute } from "@react-navigation/native";
Expand Down Expand Up @@ -33,6 +34,11 @@ type InitiativeDetailsScreenParamsRouteProps = RouteProp<
export const InitiativeDetailsScreen = () => {
const { params } = useRoute<InitiativeDetailsScreenParamsRouteProps>();

const {
footerActionsInlineMeasurements,
handleFooterActionsInlineMeasurements
} = useFooterActionsInlineMeasurements();

const { useActorRef, useSelector } = IdPayOnboardingMachineContext;
const machine = useActorRef();

Expand Down Expand Up @@ -78,7 +84,7 @@ export const InitiativeDetailsScreen = () => {

return (
<ForceScrollDownView
threshold={50}
threshold={footerActionsInlineMeasurements.safeBottomAreaHeight}
contentContainerStyle={styles.scrollContainer}
>
<View style={styles.container}>
Expand All @@ -92,6 +98,7 @@ export const InitiativeDetailsScreen = () => {
{onboardingPrivacyAdvice}
</View>
<FooterActions
onMeasure={handleFooterActionsInlineMeasurements}
key={"continue"}
fixed={false}
actions={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ForceScrollDownView,
H2,
IOVisualCostants,
useFooterActionsInlineMeasurements,
VSpacer
} from "@pagopa/io-app-design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
Expand Down Expand Up @@ -89,6 +90,11 @@ const ContentView = ({ credentialType, credential }: ContentViewProps) => {
[credentialType]
);

const {
footerActionsInlineMeasurements,
handleFooterActionsInlineMeasurements
} = useFooterActionsInlineMeasurements();

useFocusEffect(() => {
trackCredentialPreview(mixPanelCredential);
});
Expand Down Expand Up @@ -136,7 +142,8 @@ const ContentView = ({ credentialType, credential }: ContentViewProps) => {

return (
<ForceScrollDownView
contentContainerStyle={styles.scrollView}
contentContainerStyle={{ flexGrow: 1 }}
threshold={footerActionsInlineMeasurements.safeBottomAreaHeight}
onThresholdCrossed={trackScrollToBottom}
>
<View style={styles.container}>
Expand All @@ -149,6 +156,7 @@ const ContentView = ({ credentialType, credential }: ContentViewProps) => {
<ItwCredentialPreviewClaimsList data={credential} />
</View>
<FooterActions
onMeasure={handleFooterActionsInlineMeasurements}
fixed={false}
actions={{
type: "TwoButtons",
Expand All @@ -173,9 +181,6 @@ const ContentView = ({ credentialType, credential }: ContentViewProps) => {
};

const styles = StyleSheet.create({
scrollView: {
flexGrow: 1
},
container: {
flex: 1,
marginHorizontal: IOVisualCostants.appMarginDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ForceScrollDownView,
H2,
ListItemHeader,
useFooterActionsInlineMeasurements,
VSpacer
} from "@pagopa/io-app-design-system";
import { useRoute } from "@react-navigation/native";
Expand Down Expand Up @@ -100,6 +101,11 @@ const ContentView = ({ credentialType, eid }: ContentViewProps) => {
generateDynamicUrlSelector(state, "io_showcase", ITW_IPZS_PRIVACY_URL_BODY)
);

const {
footerActionsInlineMeasurements,
handleFooterActionsInlineMeasurements
} = useFooterActionsInlineMeasurements();

const machineRef = ItwCredentialIssuanceMachineContext.useActorRef();
const isIssuing =
ItwCredentialIssuanceMachineContext.useSelector(selectIsIssuing);
Expand Down Expand Up @@ -140,7 +146,10 @@ const ContentView = ({ credentialType, eid }: ContentViewProps) => {
};

return (
<ForceScrollDownView onThresholdCrossed={trackScrollToBottom}>
<ForceScrollDownView
threshold={footerActionsInlineMeasurements.safeBottomAreaHeight}
onThresholdCrossed={trackScrollToBottom}
>
<ContentWrapper>
<VSpacer size={24} />
<ItwDataExchangeIcons
Expand Down Expand Up @@ -192,6 +201,7 @@ const ContentView = ({ credentialType, eid }: ContentViewProps) => {
/>
</ContentWrapper>
<FooterActions
onMeasure={handleFooterActionsInlineMeasurements}
fixed={false}
actions={{
type: "TwoButtons",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Icon,
IOStyles,
IOVisualCostants,
useFooterActionsInlineMeasurements,
VStack
} from "@pagopa/io-app-design-system";
import * as O from "fp-ts/lib/Option";
Expand Down Expand Up @@ -80,6 +81,11 @@ const ContentView = ({ eid }: ContentViewProps) => {
[eid.credentialType]
);

const {
footerActionsInlineMeasurements,
handleFooterActionsInlineMeasurements
} = useFooterActionsInlineMeasurements();

useFocusEffect(
useCallback(() => {
trackCredentialPreview(mixPanelCredential);
Expand Down Expand Up @@ -134,7 +140,10 @@ const ContentView = ({ eid }: ContentViewProps) => {
}, [navigation, dismissDialog]);

return (
<ForceScrollDownView contentContainerStyle={styles.scroll}>
<ForceScrollDownView
threshold={footerActionsInlineMeasurements.safeBottomAreaHeight}
contentContainerStyle={styles.scroll}
>
<VStack space={24} style={styles.contentWrapper}>
<HStack space={8} style={IOStyles.alignCenter}>
<Icon name="legalValue" color="blueIO-500" />
Expand All @@ -148,6 +157,7 @@ const ContentView = ({ eid }: ContentViewProps) => {
</View>
</VStack>
<FooterActions
onMeasure={handleFooterActionsInlineMeasurements}
fixed={false}
actions={{
type: "TwoButtons",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ForceScrollDownView,
H2,
ListItemHeader,
useFooterActionsInlineMeasurements,
VStack
} from "@pagopa/io-app-design-system";
import { View, StyleSheet } from "react-native";
Expand Down Expand Up @@ -51,6 +52,11 @@ const ItwRemoteClaimsDisclosureScreen = () => {
const ContentView = () => {
useHeaderSecondLevel({ title: "" });

const {
footerActionsInlineMeasurements,
handleFooterActionsInlineMeasurements
} = useFooterActionsInlineMeasurements();

const [selectedOptionalClaims, setSelectedOptionalClaims] = useState<
Array<string>
>([]);
Expand Down Expand Up @@ -125,7 +131,9 @@ const ContentView = () => {
);

return (
<ForceScrollDownView>
<ForceScrollDownView
threshold={footerActionsInlineMeasurements.safeBottomAreaHeight}
>
<ContentWrapper>
<VStack space={24}>
<ItwDataExchangeIcons
Expand Down Expand Up @@ -184,6 +192,7 @@ const ContentView = () => {
</VStack>
</ContentWrapper>
<FooterActions
onMeasure={handleFooterActionsInlineMeasurements}
fixed={false}
actions={{
type: "TwoButtons",
Expand Down
Loading