diff --git a/.github/workflows/rn_nexus_upload.yml b/.github/workflows/rn_nexus_upload.yml new file mode 100644 index 0000000000..caf909e71a --- /dev/null +++ b/.github/workflows/rn_nexus_upload.yml @@ -0,0 +1,40 @@ +name: RN - Publish node_modules ZIP to Nexus + +on: + push: + branches: + - master + paths: + - package.json + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + pack-and-upload-js: + runs-on: [ default ] + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.0 + - name: Clean NPM Modules + run: npm cache clean --force + - name: Install yarn + run: npm install --global yarn + - name: Install Node Modules + run: yarn install + - name: Get Version from package.json + id: get-version + shell: bash + run: | + VERSION=$(node -p "require('./package.json').version") + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Create ZIP Archive of /node_modules + run: zip -r node_modules.zip node_modules + - name: Publish ZIP to Nexus + run: curl -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" --upload-file node_modules.zip https://nexus.cmd.navi-tech.in/repository/android-apk-artifacts/react-native/${{ env.VERSION }}.zip diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..8fb2b6aa13 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "IOS"] + path = IOS + url = git@github.com:navi-ios/ios-consumer-app.git diff --git a/App/common/constants/NumericalConstants.ts b/App/common/constants/NumericalConstants.ts index 1ca8134a61..e43a6d7969 100644 --- a/App/common/constants/NumericalConstants.ts +++ b/App/common/constants/NumericalConstants.ts @@ -1,6 +1,7 @@ export const HEADER_LOTTIE_WIDGET_HEIGHT = 180; export const HEADER_LOTTIE_TITLE_HEIGHT = 84; export const BOTTOMSHEET_ANIMATION_DURATION = 200; +export const BOTTOMSHEET_DISMISS_ANIMATION_DURATION = 100; export const INITIAL_Y_VALUE = 0; export const THRESHOLD_Y_BENEFIT = 50; export const SCREEN_MID = 0.5; diff --git a/App/common/constants/StringConstant.ts b/App/common/constants/StringConstant.ts index 1a0c3142f0..0131a053cf 100644 --- a/App/common/constants/StringConstant.ts +++ b/App/common/constants/StringConstant.ts @@ -68,6 +68,13 @@ export enum SeparatorOrientationType { HORIZONTAL = "horizontal", } +export const FontMapping = { + tt_bold: "NaviHeadline-Bold", + tt_regular: "NaviBody-Regular", + tt_semi_bold: "NaviBody-DemiBold", + tt_medium: "NaviHeadline-Reg", +}; + export const UrlConstants = { MIGRATION_BENEFIT_SCREEN_URL: "GI_MIGRATION_BENEFIT", RENEWAL_PLAN_MIGRATION_SCREEN_URL: "GI_RENEWAL_PLAN_MIGRATION_SCREEN", diff --git a/App/common/hooks/useBottomSheet.tsx b/App/common/hooks/useBottomSheet.tsx index db8be26d53..bacbb35183 100644 --- a/App/common/hooks/useBottomSheet.tsx +++ b/App/common/hooks/useBottomSheet.tsx @@ -43,7 +43,7 @@ export const useBottomSheet = ( const replaceBottomSheet = (modalView: ModalView) => { setTimeout(() => { removeBottomSheet(); - }, BOTTOMSHEET_ANIMATION_DURATION); + }, BOTTOMSHEET_DISMISS_ANIMATION_DURATION); // This delay ensures the first bottom sheet closes before the next one appears. setTimeout(() => { addBottomSheet(modalView); }, BOTTOMSHEET_ANIMATION_DURATION); diff --git a/App/common/utilities/MiscUtils.ts b/App/common/utilities/MiscUtils.ts index 8a97bdf04f..f15cf71aeb 100644 --- a/App/common/utilities/MiscUtils.ts +++ b/App/common/utilities/MiscUtils.ts @@ -1,5 +1,5 @@ import { CtaData } from "../interface"; -import { SPACE_UNICODE } from "../constants/StringConstant"; +import { FontMapping, SPACE_UNICODE } from "../constants/StringConstant"; import { AnalyticsEventNameConstants, BASE_SCREEN, @@ -72,6 +72,19 @@ export const getTextWithHtmlSpace = (text?: string) => { return text?.split(" ").join(SPACE_UNICODE); }; +type FontKey = keyof typeof FontMapping; + +export const getMappedFontForIos = (currentFont?: string): string => { + if (!currentFont) { + return ""; + } + const currentFontKey = currentFont as FontKey; + if (FontMapping[currentFontKey]) { + return FontMapping[currentFontKey]; + } + return currentFont; +}; + export const parseString = (value: string) => { switch (value) { case "true": diff --git a/IOS b/IOS new file mode 160000 index 0000000000..6024958f1d --- /dev/null +++ b/IOS @@ -0,0 +1 @@ +Subproject commit 6024958f1d8da7514e02e0fa7a5c50ec8ffb6c41 diff --git a/components/bottomsheet/title-subtitle-with-dropdown-bottom-sheet/TitleSubtitleWithDropdownBottomSheet.tsx b/components/bottomsheet/title-subtitle-with-dropdown-bottom-sheet/TitleSubtitleWithDropdownBottomSheet.tsx index ba1ccbd85e..4d2a6354c4 100644 --- a/components/bottomsheet/title-subtitle-with-dropdown-bottom-sheet/TitleSubtitleWithDropdownBottomSheet.tsx +++ b/components/bottomsheet/title-subtitle-with-dropdown-bottom-sheet/TitleSubtitleWithDropdownBottomSheet.tsx @@ -3,6 +3,7 @@ import { Animated, FlatList, LayoutAnimation, + Platform, ScrollView, TouchableOpacity, View, @@ -17,6 +18,7 @@ import { import { StyledImage } from "../../StyledImage"; import { StyledText } from "../../widgets/styled-text/StyledText"; import styles from "./TitleSubtitleWithDropdownBottomSheetStyles"; +import { OsTypeConstants } from "../../../App/common/constants"; const InfoItemComponent = ({ item }: { item: KeyValueInfoData }) => { return ( @@ -47,7 +49,9 @@ const DropDownComponent = ({ setIsExpanded(value => !value); if (!!dropdownData?.title?.cta?.analyticsEventProperties && isExpanded) sendAsAnalyticsEvent(dropdownData?.title?.cta?.analyticsEventProperties); - LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); + if (Platform.OS === OsTypeConstants.ANDROID) { + LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); + } Animated.timing(rotateAnimation, { toValue: isExpanded ? 0 : 1, duration: 300, diff --git a/components/bottomsheet/top-section-expandable-bottom-sheet/TopSectionExpandableBottomSheet.tsx b/components/bottomsheet/top-section-expandable-bottom-sheet/TopSectionExpandableBottomSheet.tsx index 42099c5749..69b4ec2475 100644 --- a/components/bottomsheet/top-section-expandable-bottom-sheet/TopSectionExpandableBottomSheet.tsx +++ b/components/bottomsheet/top-section-expandable-bottom-sheet/TopSectionExpandableBottomSheet.tsx @@ -4,6 +4,7 @@ import { LayoutAnimation, NativeScrollEvent, NativeSyntheticEvent, + Platform, ScrollView, TouchableOpacity, View, @@ -14,7 +15,10 @@ import Animated, { useSharedValue, } from "react-native-reanimated"; import { commonStyles } from "../../../App/Container/Navi-Insurance/Styles"; -import { INITIAL_Y_VALUE } from "../../../App/common/constants"; +import { + INITIAL_Y_VALUE, + OsTypeConstants, +} from "../../../App/common/constants"; import { sendAsAnalyticsEvent } from "../../../App/common/hooks/useAnalyticsEvent"; import { NaviLinearGradient } from "../../../App/common/hooks/useGradient"; import { @@ -139,7 +143,9 @@ const DropDownComponent = ({ }) => { const [isExpanded, setIsExpanded] = useState(false); const toggleOpen = () => { - LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); + if (Platform.OS === OsTypeConstants.ANDROID) { + LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); + } setIsExpanded(value => !value); dropdownData?.toggleEvent && sendAsAnalyticsEvent(dropdownData?.toggleEvent); diff --git a/components/reusable/cta-button/CtaButton.tsx b/components/reusable/cta-button/CtaButton.tsx index d7a0e43c1e..62c11f6367 100644 --- a/components/reusable/cta-button/CtaButton.tsx +++ b/components/reusable/cta-button/CtaButton.tsx @@ -4,6 +4,9 @@ import { ButtonState } from "../../../App/common/interface/widgets/widgetData/Fo import { LottieFieldData } from "../../../App/common/interface/widgets/widgetData/TitleWidgetData"; import { StyledLottie } from "../../widgets/styled-lottie/StyledLottie"; import styles from "./CtaButtonStyle"; +import { Platform } from "react-native"; +import { OsTypeConstants } from "../../../App/common/constants/BuildConfigConstants"; +import LottieView from "../../widgets/styled-lottie/StyledLottieIos"; const CtaButton = ({ onPress, @@ -23,13 +26,17 @@ const CtaButton = ({ }; return ( {state === ButtonState.LOADING ? ( - + Platform.OS === OsTypeConstants.IOS ? ( + + ) : ( + + ) ) : ( children )} diff --git a/components/widgets/styled-lottie/StyledLottieIos.tsx b/components/widgets/styled-lottie/StyledLottieIos.tsx new file mode 100644 index 0000000000..1195dd207b --- /dev/null +++ b/components/widgets/styled-lottie/StyledLottieIos.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import { requireNativeComponent, ViewStyle } from "react-native"; +import type { StyleProp } from "react-native"; +import styles from "./StyledLottieComponentStyle"; + +type LottieViewProps = { + style?: StyleProp; +}; + +const LottieViewNative = requireNativeComponent("LottieView"); + +const LottieView = () => { + return ; +}; + +export default LottieView; diff --git a/components/widgets/styled-text/StyledText.tsx b/components/widgets/styled-text/StyledText.tsx index 20f5d8fd1d..3bc58f5320 100644 --- a/components/widgets/styled-text/StyledText.tsx +++ b/components/widgets/styled-text/StyledText.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { TouchableOpacity, View } from "react-native"; +import { Platform, TouchableOpacity, View } from "react-native"; import Animated from "react-native-reanimated"; import { GenericActionPayload } from "../../../App/common/actions/GenericAction"; import { CtaData } from "../../../App/common/interface"; @@ -12,6 +12,8 @@ import { import { StyledImage } from "../../StyledImage"; import { StyledLottie } from "../styled-lottie/StyledLottie"; import styles from "./StyledTextComponentStyle"; +import { OsTypeConstants } from "../../../App/common/constants"; +import { getMappedFontForIos } from "../../../App/common/utilities/MiscUtils"; export const StyledText = ({ textFieldData, @@ -25,6 +27,12 @@ export const StyledText = ({ actionPayloadList: GenericActionPayload | undefined, ) => void; }) => { + if (Platform.OS === OsTypeConstants.IOS) { + textFieldData.textStyle = { + ...textFieldData.textStyle, + fontFamily: getMappedFontForIos(textFieldData.textStyle?.fontFamily), + }; + } let text: string = textFieldData.text; let topImage: ImageFieldData | undefined = textFieldData?.textDrawableData?.top; @@ -154,6 +162,12 @@ const TextComponent = ({ textFieldData }: { textFieldData: TextFieldData }) => { textFieldData.substringStyles?.forEach(({ substring, textStyle }, index) => { textFieldString = substringStyleMap?.pop()?.substring || textFieldData.text; + if (Platform.OS === OsTypeConstants.IOS) { + textStyle = { + ...textStyle, + fontFamily: getMappedFontForIos(textStyle?.fontFamily), + }; + } if (substring) { const splitArray = textFieldString.split(substring); const part1: SubstringStyle = {