diff --git a/clients/banking/package.json b/clients/banking/package.json index d5cc30190..4099e1f5a 100644 --- a/clients/banking/package.json +++ b/clients/banking/package.json @@ -24,8 +24,8 @@ "@sentry/react": "7.68.0", "@swan-io/boxed": "1.2.0", "@swan-io/chicane": "1.4.1", - "@swan-io/lake": "2.7.38", - "@swan-io/shared-business": "2.7.38", + "@swan-io/lake": "3.0.0", + "@swan-io/shared-business": "3.0.0", "@urql/exchange-graphcache": "6.3.3", "core-js": "3.32.2", "dayjs": "1.11.9", diff --git a/clients/banking/src/components/CardCancelConfirmationModal.tsx b/clients/banking/src/components/CardCancelConfirmationModal.tsx index 3d9e132c1..20c5149dc 100644 --- a/clients/banking/src/components/CardCancelConfirmationModal.tsx +++ b/clients/banking/src/components/CardCancelConfirmationModal.tsx @@ -1,11 +1,11 @@ import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { colors } from "@swan-io/lake/src/constants/design"; import { useUrqlMutation } from "@swan-io/lake/src/hooks/useUrqlMutation"; import { showToast } from "@swan-io/lake/src/state/toasts"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; import { CancelCardDocument } from "../graphql/partner"; import { t } from "../utils/i18n"; diff --git a/clients/banking/src/components/CardItemMobilePayment.tsx b/clients/banking/src/components/CardItemMobilePayment.tsx index 3797b99b8..3f49d0bd9 100644 --- a/clients/banking/src/components/CardItemMobilePayment.tsx +++ b/clients/banking/src/components/CardItemMobilePayment.tsx @@ -3,7 +3,6 @@ import { Box } from "@swan-io/lake/src/components/Box"; import { FixedListViewEmpty } from "@swan-io/lake/src/components/FixedListView"; import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { LakeTooltip } from "@swan-io/lake/src/components/LakeTooltip"; import { Space } from "@swan-io/lake/src/components/Space"; @@ -13,6 +12,7 @@ import { colors } from "@swan-io/lake/src/constants/design"; import { useUrqlMutation } from "@swan-io/lake/src/hooks/useUrqlMutation"; import { showToast } from "@swan-io/lake/src/state/toasts"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; import dayjs from "dayjs"; import { Fragment, useState } from "react"; diff --git a/clients/banking/src/components/CardItemPhysicalDetails.tsx b/clients/banking/src/components/CardItemPhysicalDetails.tsx index edbf7188f..18d7e8028 100644 --- a/clients/banking/src/components/CardItemPhysicalDetails.tsx +++ b/clients/banking/src/components/CardItemPhysicalDetails.tsx @@ -6,7 +6,6 @@ import { LakeButton, LakeButtonGroup } from "@swan-io/lake/src/components/LakeBu import { LakeCopyButton } from "@swan-io/lake/src/components/LakeCopyButton"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; import { LakeLabel } from "@swan-io/lake/src/components/LakeLabel"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeSelect } from "@swan-io/lake/src/components/LakeSelect"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { LakeTextInput } from "@swan-io/lake/src/components/LakeTextInput"; @@ -22,6 +21,7 @@ import { nullishOrEmptyToUndefined } from "@swan-io/lake/src/utils/nullish"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; import { CountryPicker } from "@swan-io/shared-business/src/components/CountryPicker"; import { GMapAddressSearchInput } from "@swan-io/shared-business/src/components/GMapAddressSearchInput"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { CountryCCA3, allCountries, diff --git a/clients/banking/src/components/CardWizardDelivery.tsx b/clients/banking/src/components/CardWizardDelivery.tsx index f49a91a52..94f5f86ad 100644 --- a/clients/banking/src/components/CardWizardDelivery.tsx +++ b/clients/banking/src/components/CardWizardDelivery.tsx @@ -1,10 +1,10 @@ import { Box } from "@swan-io/lake/src/components/Box"; -import { ChoicePicker } from "@swan-io/lake/src/components/ChoicePicker"; import { Icon } from "@swan-io/lake/src/components/Icon"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { colors } from "@swan-io/lake/src/constants/design"; +import { ChoicePicker } from "@swan-io/shared-business/src/components/ChoicePicker"; import { forwardRef, useImperativeHandle, useState } from "react"; import { StyleSheet, View } from "react-native"; import { match } from "ts-pattern"; diff --git a/clients/banking/src/components/CardWizardFormat.tsx b/clients/banking/src/components/CardWizardFormat.tsx index 6305402d2..888797d4b 100644 --- a/clients/banking/src/components/CardWizardFormat.tsx +++ b/clients/banking/src/components/CardWizardFormat.tsx @@ -1,10 +1,10 @@ import { Box } from "@swan-io/lake/src/components/Box"; -import { ChoicePicker } from "@swan-io/lake/src/components/ChoicePicker"; import { Icon } from "@swan-io/lake/src/components/Icon"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { Tag } from "@swan-io/lake/src/components/Tag"; import { colors } from "@swan-io/lake/src/constants/design"; +import { ChoicePicker } from "@swan-io/shared-business/src/components/ChoicePicker"; import { forwardRef, useImperativeHandle, useState } from "react"; import { StyleSheet, View } from "react-native"; import { match } from "ts-pattern"; diff --git a/clients/banking/src/components/CardWizardGroupedDelivery.tsx b/clients/banking/src/components/CardWizardGroupedDelivery.tsx index 4e8a205fe..7cae2885a 100644 --- a/clients/banking/src/components/CardWizardGroupedDelivery.tsx +++ b/clients/banking/src/components/CardWizardGroupedDelivery.tsx @@ -5,13 +5,13 @@ import { Icon } from "@swan-io/lake/src/components/Icon"; import { LakeAlert } from "@swan-io/lake/src/components/LakeAlert"; import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { Tile } from "@swan-io/lake/src/components/Tile"; import { colors } from "@swan-io/lake/src/constants/design"; import { isNotNullish } from "@swan-io/lake/src/utils/nullish"; import { GetNode } from "@swan-io/lake/src/utils/types"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { CountryCCA3 } from "@swan-io/shared-business/src/constants/countries"; import { forwardRef, Fragment, useImperativeHandle, useState } from "react"; import { StyleSheet, View } from "react-native"; diff --git a/clients/banking/src/components/CardWizardIndividualDelivery.tsx b/clients/banking/src/components/CardWizardIndividualDelivery.tsx index acc3a41f8..25ffe930b 100644 --- a/clients/banking/src/components/CardWizardIndividualDelivery.tsx +++ b/clients/banking/src/components/CardWizardIndividualDelivery.tsx @@ -3,13 +3,13 @@ import { Box } from "@swan-io/lake/src/components/Box"; import { Fill } from "@swan-io/lake/src/components/Fill"; import { LakeAlert } from "@swan-io/lake/src/components/LakeAlert"; import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { Tile } from "@swan-io/lake/src/components/Tile"; import { colors } from "@swan-io/lake/src/constants/design"; import { isNotNullish } from "@swan-io/lake/src/utils/nullish"; import { GetNode } from "@swan-io/lake/src/utils/types"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { CountryCCA3 } from "@swan-io/shared-business/src/constants/countries"; import { forwardRef, useImperativeHandle, useState } from "react"; import { StyleSheet, View } from "react-native"; diff --git a/clients/banking/src/components/CardWizardProduct.tsx b/clients/banking/src/components/CardWizardProduct.tsx index ad294276e..ae7a1635e 100644 --- a/clients/banking/src/components/CardWizardProduct.tsx +++ b/clients/banking/src/components/CardWizardProduct.tsx @@ -1,10 +1,10 @@ import { Box } from "@swan-io/lake/src/components/Box"; -import { ChoicePicker } from "@swan-io/lake/src/components/ChoicePicker"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { Tag } from "@swan-io/lake/src/components/Tag"; import { colors } from "@swan-io/lake/src/constants/design"; +import { ChoicePicker } from "@swan-io/shared-business/src/components/ChoicePicker"; import { CSSProperties, forwardRef, useEffect, useImperativeHandle, useState } from "react"; import { StyleSheet, View } from "react-native"; import { match } from "ts-pattern"; diff --git a/clients/banking/src/components/CardWizardSettings.tsx b/clients/banking/src/components/CardWizardSettings.tsx index 7fe11196b..1802fd0af 100644 --- a/clients/banking/src/components/CardWizardSettings.tsx +++ b/clients/banking/src/components/CardWizardSettings.tsx @@ -1,6 +1,5 @@ import { Result } from "@swan-io/boxed"; import { Box } from "@swan-io/lake/src/components/Box"; -import { ChoicePicker } from "@swan-io/lake/src/components/ChoicePicker"; import { Icon, IconName } from "@swan-io/lake/src/components/Icon"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; import { LakeLabel } from "@swan-io/lake/src/components/LakeLabel"; @@ -22,6 +21,7 @@ import { } from "@swan-io/lake/src/constants/design"; import { useResponsive } from "@swan-io/lake/src/hooks/useResponsive"; import { emptyToUndefined, isNullish } from "@swan-io/lake/src/utils/nullish"; +import { ChoicePicker } from "@swan-io/shared-business/src/components/ChoicePicker"; import { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from "react"; import { StyleSheet, View } from "react-native"; import { match } from "ts-pattern"; diff --git a/clients/banking/src/components/ConfirmModal.tsx b/clients/banking/src/components/ConfirmModal.tsx deleted file mode 100644 index c2115ca38..000000000 --- a/clients/banking/src/components/ConfirmModal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { Box } from "@swan-io/lake/src/components/Box"; -import { IconName } from "@swan-io/lake/src/components/Icon"; -import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; -import { LakeText } from "@swan-io/lake/src/components/LakeText"; -import { Space } from "@swan-io/lake/src/components/Space"; -import { ColorVariants } from "@swan-io/lake/src/constants/design"; -import { StyleSheet } from "react-native"; -import { t } from "../utils/i18n"; - -const styles = StyleSheet.create({ - confirmButton: { - flex: 1, - }, -}); - -type Props = { - visible: boolean; - title: string; - message?: string; - confirmText: string; - cancelText?: string; - color?: ColorVariants; - icon: IconName; - loading?: boolean; - onConfirm: () => void; - onCancel: () => void; -}; - -export const ConfirmModal = ({ - visible, - title, - message, - confirmText, - cancelText, - color = "partner", - icon, - loading, - onConfirm, - onCancel, -}: Props) => { - return ( - - {message != null && {message}} - - - - - - {cancelText ?? t("common.cancel")} - - - - - - {confirmText} - - - - ); -}; diff --git a/clients/banking/src/components/MembershipCancelConfirmationModal.tsx b/clients/banking/src/components/MembershipCancelConfirmationModal.tsx index 068a999f4..14ed73e00 100644 --- a/clients/banking/src/components/MembershipCancelConfirmationModal.tsx +++ b/clients/banking/src/components/MembershipCancelConfirmationModal.tsx @@ -1,11 +1,11 @@ import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Space } from "@swan-io/lake/src/components/Space"; import { colors } from "@swan-io/lake/src/constants/design"; import { useUrqlMutation } from "@swan-io/lake/src/hooks/useUrqlMutation"; import { showToast } from "@swan-io/lake/src/state/toasts"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; import { DisableAccountMembershipDocument } from "../graphql/partner"; import { t } from "../utils/i18n"; diff --git a/clients/banking/src/components/MembershipDetailRights.tsx b/clients/banking/src/components/MembershipDetailRights.tsx index 08748e50a..e19005c51 100644 --- a/clients/banking/src/components/MembershipDetailRights.tsx +++ b/clients/banking/src/components/MembershipDetailRights.tsx @@ -8,6 +8,7 @@ import { useUrqlMutation } from "@swan-io/lake/src/hooks/useUrqlMutation"; import { showToast } from "@swan-io/lake/src/state/toasts"; import { identity } from "@swan-io/lake/src/utils/function"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; +import { ConfirmModal } from "@swan-io/shared-business/src/components/ConfirmModal"; import { CountryCCA3 } from "@swan-io/shared-business/src/constants/countries"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; import { useState } from "react"; @@ -23,7 +24,6 @@ import { } from "../graphql/partner"; import { t } from "../utils/i18n"; import { Router } from "../utils/routes"; -import { ConfirmModal } from "./ConfirmModal"; import { MembershipCancelConfirmationModal } from "./MembershipCancelConfirmationModal"; const styles = StyleSheet.create({ diff --git a/clients/banking/src/components/MembershipInvitationLinkModal.tsx b/clients/banking/src/components/MembershipInvitationLinkModal.tsx index 2c1f5eff2..c3012dcc1 100644 --- a/clients/banking/src/components/MembershipInvitationLinkModal.tsx +++ b/clients/banking/src/components/MembershipInvitationLinkModal.tsx @@ -1,9 +1,9 @@ import { Option } from "@swan-io/boxed"; import { Box } from "@swan-io/lake/src/components/Box"; import { LakeLabel } from "@swan-io/lake/src/components/LakeLabel"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeTextInput } from "@swan-io/lake/src/components/LakeTextInput"; import { Space } from "@swan-io/lake/src/components/Space"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { P, match } from "ts-pattern"; import { useQuery } from "urql"; import { MembershipDetailDocument } from "../graphql/partner"; diff --git a/clients/banking/src/components/MembershipsArea.tsx b/clients/banking/src/components/MembershipsArea.tsx index 2c589d264..c1442437d 100644 --- a/clients/banking/src/components/MembershipsArea.tsx +++ b/clients/banking/src/components/MembershipsArea.tsx @@ -4,7 +4,6 @@ import { Box } from "@swan-io/lake/src/components/Box"; import { PlainListViewPlaceholder } from "@swan-io/lake/src/components/FixedListView"; import { FocusTrapRef } from "@swan-io/lake/src/components/FocusTrap"; import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { ListRightPanel } from "@swan-io/lake/src/components/ListRightPanel"; import { LoadingView } from "@swan-io/lake/src/components/LoadingView"; @@ -14,6 +13,7 @@ import { commonStyles } from "@swan-io/lake/src/constants/commonStyles"; import { breakpoints, colors, spacings } from "@swan-io/lake/src/constants/design"; import { useUrqlPaginatedQuery } from "@swan-io/lake/src/hooks/useUrqlQuery"; import { isNotNullish } from "@swan-io/lake/src/utils/nullish"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { Suspense, useCallback, useEffect, useMemo, useRef } from "react"; import { StyleSheet, View } from "react-native"; import { P, match } from "ts-pattern"; diff --git a/clients/banking/src/components/RecurringTransferList.tsx b/clients/banking/src/components/RecurringTransferList.tsx index 8287fa729..452b8dc19 100644 --- a/clients/banking/src/components/RecurringTransferList.tsx +++ b/clients/banking/src/components/RecurringTransferList.tsx @@ -17,7 +17,6 @@ import { Icon } from "@swan-io/lake/src/components/Icon"; import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; import { LakeLabel } from "@swan-io/lake/src/components/LakeLabel"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { ListRightPanel, ListRightPanelContent } from "@swan-io/lake/src/components/ListRightPanel"; import { ColumnConfig, PlainListView } from "@swan-io/lake/src/components/PlainListView"; @@ -38,6 +37,7 @@ import { showToast } from "@swan-io/lake/src/state/toasts"; import { isNotNullish } from "@swan-io/lake/src/utils/nullish"; import { GetNode } from "@swan-io/lake/src/utils/types"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; import dayjs from "dayjs"; import { useCallback, useMemo, useState } from "react"; diff --git a/clients/banking/src/components/SupportingDocumentsForm.tsx b/clients/banking/src/components/SupportingDocumentsForm.tsx index ed47321af..22e0a0537 100644 --- a/clients/banking/src/components/SupportingDocumentsForm.tsx +++ b/clients/banking/src/components/SupportingDocumentsForm.tsx @@ -1,10 +1,8 @@ import { Dict } from "@swan-io/boxed"; -import { FileTile } from "@swan-io/lake/src/components/FileTile"; import { Form } from "@swan-io/lake/src/components/Form"; import { Icon } from "@swan-io/lake/src/components/Icon"; import { LakeButton, LakeButtonGroup } from "@swan-io/lake/src/components/LakeButton"; import { LakeLabel } from "@swan-io/lake/src/components/LakeLabel"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { LakeTooltip } from "@swan-io/lake/src/components/LakeTooltip"; import { Space } from "@swan-io/lake/src/components/Space"; @@ -16,6 +14,8 @@ import { showToast } from "@swan-io/lake/src/state/toasts"; import { isNotNullish, isNullish } from "@swan-io/lake/src/utils/nullish"; import { GetNode } from "@swan-io/lake/src/utils/types"; import { filterRejectionsToPromise, parseOperationResult } from "@swan-io/lake/src/utils/urql"; +import { FileTile } from "@swan-io/shared-business/src/components/FileTile"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { UploadArea, UploadFileStatus } from "@swan-io/shared-business/src/components/UploadArea"; import { MAX_SUPPORTING_DOCUMENT_UPLOAD_SIZE } from "@swan-io/shared-business/src/constants/uploads"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; diff --git a/clients/banking/src/components/TransactionsArea.tsx b/clients/banking/src/components/TransactionsArea.tsx index 970d940ba..574dedecf 100644 --- a/clients/banking/src/components/TransactionsArea.tsx +++ b/clients/banking/src/components/TransactionsArea.tsx @@ -1,7 +1,6 @@ import { Option } from "@swan-io/boxed"; import { Box } from "@swan-io/lake/src/components/Box"; import { LakeHeading } from "@swan-io/lake/src/components/LakeHeading"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { ResponsiveContainer } from "@swan-io/lake/src/components/ResponsiveContainer"; import { Space } from "@swan-io/lake/src/components/Space"; @@ -9,6 +8,7 @@ import { TabView } from "@swan-io/lake/src/components/TabView"; import { commonStyles } from "@swan-io/lake/src/constants/commonStyles"; import { breakpoints, negativeSpacings, spacings } from "@swan-io/lake/src/constants/design"; import { isNotEmpty } from "@swan-io/lake/src/utils/nullish"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { useState } from "react"; import { StyleSheet, View } from "react-native"; import { match } from "ts-pattern"; diff --git a/clients/banking/src/components/TransferRecurringWizardSchedule.tsx b/clients/banking/src/components/TransferRecurringWizardSchedule.tsx index 6aa6b5fee..91dc0a6bf 100644 --- a/clients/banking/src/components/TransferRecurringWizardSchedule.tsx +++ b/clients/banking/src/components/TransferRecurringWizardSchedule.tsx @@ -1,5 +1,4 @@ import { Box } from "@swan-io/lake/src/components/Box"; -import { DatePicker, isDateInRange } from "@swan-io/lake/src/components/DatePicker"; import { LakeButton, LakeButtonGroup } from "@swan-io/lake/src/components/LakeButton"; import { LakeLabel } from "@swan-io/lake/src/components/LakeLabel"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; @@ -11,6 +10,7 @@ import { Switch } from "@swan-io/lake/src/components/Switch"; import { Tile } from "@swan-io/lake/src/components/Tile"; import { commonStyles } from "@swan-io/lake/src/constants/commonStyles"; import { colors } from "@swan-io/lake/src/constants/design"; +import { DatePicker, isDateInRange } from "@swan-io/shared-business/src/components/DatePicker"; import { monthNames, weekDayNames } from "@swan-io/shared-business/src/utils/date"; import dayjs from "dayjs"; import { StyleSheet, View } from "react-native"; diff --git a/clients/banking/src/components/TransferRegularWizardSchedule.tsx b/clients/banking/src/components/TransferRegularWizardSchedule.tsx index 913a12b43..a4e6a747a 100644 --- a/clients/banking/src/components/TransferRegularWizardSchedule.tsx +++ b/clients/banking/src/components/TransferRegularWizardSchedule.tsx @@ -1,6 +1,5 @@ import { AsyncData, Result } from "@swan-io/boxed"; import { Box } from "@swan-io/lake/src/components/Box"; -import { DatePicker, isDateInRange } from "@swan-io/lake/src/components/DatePicker"; import { LakeAlert } from "@swan-io/lake/src/components/LakeAlert"; import { LakeButton, LakeButtonGroup } from "@swan-io/lake/src/components/LakeButton"; import { LakeLabelledCheckbox } from "@swan-io/lake/src/components/LakeCheckbox"; @@ -14,6 +13,7 @@ import { Tile } from "@swan-io/lake/src/components/Tile"; import { commonStyles } from "@swan-io/lake/src/constants/commonStyles"; import { animations, colors } from "@swan-io/lake/src/constants/design"; import { useUrqlQuery } from "@swan-io/lake/src/hooks/useUrqlQuery"; +import { DatePicker, isDateInRange } from "@swan-io/shared-business/src/components/DatePicker"; import { monthNames, weekDayNames } from "@swan-io/shared-business/src/utils/date"; import dayjs from "dayjs"; import { electronicFormat } from "iban"; diff --git a/clients/banking/src/pages/AccountDetailsVirtualIbansPage.tsx b/clients/banking/src/pages/AccountDetailsVirtualIbansPage.tsx index 84e985915..957a374d2 100644 --- a/clients/banking/src/pages/AccountDetailsVirtualIbansPage.tsx +++ b/clients/banking/src/pages/AccountDetailsVirtualIbansPage.tsx @@ -8,7 +8,6 @@ import { SimpleHeaderCell, } from "@swan-io/lake/src/components/FixedListViewCells"; import { LakeButton, LakeButtonGroup } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { ColumnConfig, PlainListView } from "@swan-io/lake/src/components/PlainListView"; import { ResponsiveContainer } from "@swan-io/lake/src/components/ResponsiveContainer"; @@ -22,6 +21,7 @@ import { useUrqlPaginatedQuery } from "@swan-io/lake/src/hooks/useUrqlQuery"; import { showToast } from "@swan-io/lake/src/state/toasts"; import { GetEdge } from "@swan-io/lake/src/utils/types"; import { filterRejectionsToPromise, parseOperationResult } from "@swan-io/lake/src/utils/urql"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { translateError } from "@swan-io/shared-business/src/utils/i18n"; import { useMemo } from "react"; import { StyleSheet, View } from "react-native"; diff --git a/clients/banking/src/utils/i18n.ts b/clients/banking/src/utils/i18n.ts index 7c2f32e54..8721262b4 100644 --- a/clients/banking/src/utils/i18n.ts +++ b/clients/banking/src/utils/i18n.ts @@ -1,7 +1,7 @@ import { createIntl, createIntlCache } from "@formatjs/intl"; -import { DateFormat } from "@swan-io/lake/src/components/DatePicker"; import { memoize } from "@swan-io/lake/src/utils/function"; import { getRifmProps } from "@swan-io/lake/src/utils/rifm"; +import { DateFormat } from "@swan-io/shared-business/src/components/DatePicker"; import { LANGUAGE_FALLBACK, getLanguagesHelpers, diff --git a/clients/banking/src/utils/validations.ts b/clients/banking/src/utils/validations.ts index 1a4dc7d7c..197194b63 100644 --- a/clients/banking/src/utils/validations.ts +++ b/clients/banking/src/utils/validations.ts @@ -1,5 +1,5 @@ import { Lazy } from "@swan-io/boxed"; -import { DatePickerDate } from "@swan-io/lake/src/components/DatePicker"; +import { DatePickerDate } from "@swan-io/shared-business/src/components/DatePicker"; import { isValidVatNumber } from "@swan-io/shared-business/src/utils/validation"; import dayjs from "dayjs"; import { Validator } from "react-ux-form"; diff --git a/clients/onboarding/package.json b/clients/onboarding/package.json index 2a9551cd7..15b1e1ab2 100644 --- a/clients/onboarding/package.json +++ b/clients/onboarding/package.json @@ -24,8 +24,8 @@ "@sentry/react": "7.68.0", "@swan-io/boxed": "1.2.0", "@swan-io/chicane": "1.4.1", - "@swan-io/lake": "2.7.38", - "@swan-io/shared-business": "2.7.38", + "@swan-io/lake": "3.0.0", + "@swan-io/shared-business": "3.0.0", "@urql/exchange-graphcache": "6.3.3", "core-js": "3.32.2", "dayjs": "1.11.9", diff --git a/clients/onboarding/src/components/ConfirmModal.tsx b/clients/onboarding/src/components/ConfirmModal.tsx deleted file mode 100644 index c2115ca38..000000000 --- a/clients/onboarding/src/components/ConfirmModal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { Box } from "@swan-io/lake/src/components/Box"; -import { IconName } from "@swan-io/lake/src/components/Icon"; -import { LakeButton } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; -import { LakeText } from "@swan-io/lake/src/components/LakeText"; -import { Space } from "@swan-io/lake/src/components/Space"; -import { ColorVariants } from "@swan-io/lake/src/constants/design"; -import { StyleSheet } from "react-native"; -import { t } from "../utils/i18n"; - -const styles = StyleSheet.create({ - confirmButton: { - flex: 1, - }, -}); - -type Props = { - visible: boolean; - title: string; - message?: string; - confirmText: string; - cancelText?: string; - color?: ColorVariants; - icon: IconName; - loading?: boolean; - onConfirm: () => void; - onCancel: () => void; -}; - -export const ConfirmModal = ({ - visible, - title, - message, - confirmText, - cancelText, - color = "partner", - icon, - loading, - onConfirm, - onCancel, -}: Props) => { - return ( - - {message != null && {message}} - - - - - - {cancelText ?? t("common.cancel")} - - - - - - {confirmText} - - - - ); -}; diff --git a/clients/onboarding/src/pages/company/OnboardingCompanyDocuments.tsx b/clients/onboarding/src/pages/company/OnboardingCompanyDocuments.tsx index 72140c714..29189ac12 100644 --- a/clients/onboarding/src/pages/company/OnboardingCompanyDocuments.tsx +++ b/clients/onboarding/src/pages/company/OnboardingCompanyDocuments.tsx @@ -5,13 +5,13 @@ import { breakpoints } from "@swan-io/lake/src/constants/design"; import { useBoolean } from "@swan-io/lake/src/hooks/useBoolean"; import { useUrqlMutation } from "@swan-io/lake/src/hooks/useUrqlMutation"; import { filterRejectionsToResult } from "@swan-io/lake/src/utils/urql"; +import { ConfirmModal } from "@swan-io/shared-business/src/components/ConfirmModal"; import { Document, SupportingDocument, SupportingDocumentPurpose, } from "@swan-io/shared-business/src/components/SupportingDocument"; import { ReactNode } from "react"; -import { ConfirmModal } from "../../components/ConfirmModal"; import { OnboardingFooter } from "../../components/OnboardingFooter"; import { OnboardingStepContent } from "../../components/OnboardingStepContent"; import { StepTitle } from "../../components/StepTitle"; diff --git a/clients/onboarding/src/pages/company/OnboardingCompanyOwnership.tsx b/clients/onboarding/src/pages/company/OnboardingCompanyOwnership.tsx index 51d86f2d1..b3a3e0889 100644 --- a/clients/onboarding/src/pages/company/OnboardingCompanyOwnership.tsx +++ b/clients/onboarding/src/pages/company/OnboardingCompanyOwnership.tsx @@ -5,7 +5,6 @@ import { Fill } from "@swan-io/lake/src/components/Fill"; import { Grid } from "@swan-io/lake/src/components/Grid"; import { Icon } from "@swan-io/lake/src/components/Icon"; import { LakeButton, LakeButtonGroup } from "@swan-io/lake/src/components/LakeButton"; -import { LakeModal } from "@swan-io/lake/src/components/LakeModal"; import { LakeText } from "@swan-io/lake/src/components/LakeText"; import { Link } from "@swan-io/lake/src/components/Link"; import { Pressable } from "@swan-io/lake/src/components/Pressable"; @@ -28,6 +27,8 @@ import { BeneficiaryFormStep, validateUbo, } from "@swan-io/shared-business/src/components/BeneficiaryForm"; +import { ConfirmModal } from "@swan-io/shared-business/src/components/ConfirmModal"; +import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal"; import { CountryCCA3, getCCA3forCCA2, @@ -40,7 +41,6 @@ import { useEffect, useRef, useState } from "react"; import { StyleSheet } from "react-native"; import { P, match } from "ts-pattern"; import { v4 as uuid } from "uuid"; -import { ConfirmModal } from "../../components/ConfirmModal"; import { OnboardingFooter } from "../../components/OnboardingFooter"; import { OnboardingStepContent } from "../../components/OnboardingStepContent"; import { StepTitle } from "../../components/StepTitle"; diff --git a/yarn.lock b/yarn.lock index 4f12d98dd..ed103b484 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2484,10 +2484,10 @@ history "^5.3.0" use-sync-external-store "^1.2.0" -"@swan-io/lake@2.7.38": - version "2.7.38" - resolved "https://registry.yarnpkg.com/@swan-io/lake/-/lake-2.7.38.tgz#993c3b5ab76fc01be5d3c9d1724002b412d09f03" - integrity sha512-xVNCCMYwvuQ9VpuRaoVmJ5OxGcxZUG6h7B48W4DXmajvjTMgryy6hqsSL27qDSXLy+LBpXm45EPk5YfWEzm57Q== +"@swan-io/lake@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@swan-io/lake/-/lake-3.0.0.tgz#74963552fb13133c8afcdf0f748cf23adde896ef" + integrity sha512-9irv7uoxvMnZjjfjae1clTRGaiS/T1K4VJ7eDnY34tJAwhfKXt3Ar2r0O1ewI4ZZNW7c6PKWBiZZyHAj4rHfiA== dependencies: "@popperjs/core" "^2.11.8" "@react-three/drei" "^9.83.9" @@ -2510,10 +2510,10 @@ urql "^4.0.5" uuid "^9.0.1" -"@swan-io/shared-business@2.7.38": - version "2.7.38" - resolved "https://registry.yarnpkg.com/@swan-io/shared-business/-/shared-business-2.7.38.tgz#3904591af49d92db4dc442ba6b6ac3c66da1e33d" - integrity sha512-QuOvxYDj+Pmf7/WHy49aBwKb6txyBAEkqXCkk1zH1y1zlzCe76IMA7AuK2NYFmDyt1alWpP/J9FKNtuoIuQ2mQ== +"@swan-io/shared-business@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@swan-io/shared-business/-/shared-business-3.0.0.tgz#19c650cc7de84dea631fbe378b1b31bf015e6e91" + integrity sha512-wQCx17pl/s+ywuE5JrBUntgxDn7hiw68pY3te6FGYEU5THy3uVvcI/+y9Rp85/oqSCkreI0qe+qVIJ6kHYd+Gg== dependencies: "@formatjs/intl" "^2.9.2" "@googlemaps/js-api-loader" "1.16.2"