From cfe067155cb32f8465435fa75430768ee22a091d Mon Sep 17 00:00:00 2001 From: Abhinav Date: Fri, 20 Jan 2023 22:48:58 +0530 Subject: [PATCH] fix build --- src/components/MemberSubscriptionManage.tsx | 2 +- .../Sidebar/SubscriptionCard/contentOverlay/family/index.tsx | 2 +- .../Sidebar/SubscriptionCard/contentOverlay/index.tsx | 2 +- src/components/Sidebar/SubscriptionStatus/index.tsx | 3 +-- src/components/Sidebar/userDetailsSection.tsx | 2 +- src/components/pages/gallery/PlanSelector/card/index.tsx | 3 +-- src/utils/error/index.ts | 2 +- src/utils/strings/englishConstants.tsx | 1 + 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/MemberSubscriptionManage.tsx b/src/components/MemberSubscriptionManage.tsx index ea5b71506..a1948f74e 100644 --- a/src/components/MemberSubscriptionManage.tsx +++ b/src/components/MemberSubscriptionManage.tsx @@ -3,9 +3,9 @@ import VerticallyCentered, { FlexWrapper } from 'components/Container'; import { AppContext } from 'pages/_app'; import React, { useContext, useEffect } from 'react'; import billingService from 'services/billingService'; -import { getFamilyPlanAdmin } from 'utils/billing'; import { preloadImage } from 'utils/common'; import constants from 'utils/strings/constants'; +import { getFamilyPlanAdmin } from 'utils/user/family'; import DialogTitleWithCloseButton from './DialogBox/TitleWithCloseButton'; export function MemberSubscriptionManage({ open, userDetails, onClose }) { diff --git a/src/components/Sidebar/SubscriptionCard/contentOverlay/family/index.tsx b/src/components/Sidebar/SubscriptionCard/contentOverlay/family/index.tsx index 59d900545..46d0b155c 100644 --- a/src/components/Sidebar/SubscriptionCard/contentOverlay/family/index.tsx +++ b/src/components/Sidebar/SubscriptionCard/contentOverlay/family/index.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; import { UserDetails } from 'types/user'; -import { isPartOfFamily } from 'utils/billing'; +import { isPartOfFamily } from 'utils/user/family'; import StorageSection from '../storageSection'; import { FamilyUsageSection } from './usageSection'; diff --git a/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx b/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx index 241557a9a..0838cc8c1 100644 --- a/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx +++ b/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx @@ -1,9 +1,9 @@ import { IndividualSubscriptionCardContent } from './individual'; import { FamilySubscriptionCardContent } from './family'; import React from 'react'; -import { hasNonAdminFamilyMembers } from 'utils/billing'; import { Overlay, SpaceBetweenFlex } from 'components/Container'; import { UserDetails } from 'types/user'; +import { hasNonAdminFamilyMembers } from 'utils/user/family'; interface Iprops { userDetails: UserDetails; diff --git a/src/components/Sidebar/SubscriptionStatus/index.tsx b/src/components/Sidebar/SubscriptionStatus/index.tsx index 4b7206c60..c71e2ae76 100644 --- a/src/components/Sidebar/SubscriptionStatus/index.tsx +++ b/src/components/Sidebar/SubscriptionStatus/index.tsx @@ -2,9 +2,7 @@ import { GalleryContext } from 'pages/gallery'; import React, { MouseEventHandler, useContext, useMemo } from 'react'; import { hasPaidSubscription, - isFamilyAdmin, isOnFreePlan, - isPartOfFamily, hasExceededStorageQuota, isSubscriptionActive, isSubscriptionCancelled, @@ -15,6 +13,7 @@ import { UserDetails } from 'types/user'; import constants from 'utils/strings/constants'; import { Typography } from '@mui/material'; import billingService from 'services/billingService'; +import { isPartOfFamily, isFamilyAdmin } from 'utils/user/family'; export default function SubscriptionStatus({ userDetails, diff --git a/src/components/Sidebar/userDetailsSection.tsx b/src/components/Sidebar/userDetailsSection.tsx index 47fa8e0d1..8e1f01abb 100644 --- a/src/components/Sidebar/userDetailsSection.tsx +++ b/src/components/Sidebar/userDetailsSection.tsx @@ -9,7 +9,7 @@ import SubscriptionStatus from './SubscriptionStatus'; import { Box, Skeleton } from '@mui/material'; import { MemberSubscriptionManage } from '../MemberSubscriptionManage'; import { GalleryContext } from 'pages/gallery'; -import { isPartOfFamily, isFamilyAdmin } from 'utils/billing'; +import { isPartOfFamily, isFamilyAdmin } from 'utils/user/family'; export default function UserDetailsSection({ sidebarView }) { const galleryContext = useContext(GalleryContext); diff --git a/src/components/pages/gallery/PlanSelector/card/index.tsx b/src/components/pages/gallery/PlanSelector/card/index.tsx index 2d8ed195a..f582cc345 100644 --- a/src/components/pages/gallery/PlanSelector/card/index.tsx +++ b/src/components/pages/gallery/PlanSelector/card/index.tsx @@ -11,8 +11,6 @@ import { hasMobileSubscription, getLocalUserSubscription, hasPaidSubscription, - getTotalFamilyUsage, - isPartOfFamily, isSubscriptionActive, } from 'utils/billing'; import { reverseString } from 'utils/common'; @@ -28,6 +26,7 @@ import { getLocalUserDetails } from 'utils/user'; import { PLAN_PERIOD } from 'constants/gallery'; import FreeSubscriptionPlanSelectorCard from './free'; import PaidSubscriptionPlanSelectorCard from './paid'; +import { isPartOfFamily, getTotalFamilyUsage } from 'utils/user/family'; interface Props { closeModal: any; diff --git a/src/utils/error/index.ts b/src/utils/error/index.ts index 5cc27235d..8ba24e1d5 100644 --- a/src/utils/error/index.ts +++ b/src/utils/error/index.ts @@ -49,7 +49,7 @@ export enum CustomError { REQUEST_TIMEOUT = 'request taking too long', HIDDEN_COLLECTION_SYNC_FILE_ATTEMPTED = 'hidden collection sync file attempted', UNKNOWN_ERROR = 'Something went wrong, please try again', - NOT_FILE_OWNER = 'You cannot delete files in a shared album', + NOT_FILE_OWNER = 'not file owner', } export function parseUploadErrorCodes(error) { diff --git a/src/utils/strings/englishConstants.tsx b/src/utils/strings/englishConstants.tsx index b3609bf9c..34077a257 100644 --- a/src/utils/strings/englishConstants.tsx +++ b/src/utils/strings/englishConstants.tsx @@ -642,6 +642,7 @@ const englishConstants = { LEAVE_SHARED_ALBUM_TITLE: 'Leave shared album?', LEAVE_SHARED_ALBUM_MESSAGE: 'You will leave the album, and it will stop being visible to you.', + NOT_FILE_OWNER: 'You cannot delete files in a shared album', CONFIRM_REMOVE_MESSAGE: () => ( <>

Are you sure you want to remove these files from the album?