diff --git a/package.json b/package.json index 80ff33fa43..1553bfedca 100644 --- a/package.json +++ b/package.json @@ -24,11 +24,13 @@ "firebase": "^10.7.1", "formik": "^2.2.1", "google-libphonenumber": "^3.2.28", + "http-status-codes": "^2.2.0", "i18next": "^21.9.1", "immer": "^9.0.16", + "immutable": "^4.2.0", "is-hotkey": "^0.2.0", "jszip": "^3.7.1", - "lodash-es": "^4.17.21", + "lodash": "^4.17.20", "millify": "^3.5.2", "moment": "^2.29.1", "node-sass": "^4.14.1", diff --git a/src/pages/OldCommon/components/CommonDetailContainer/AddDiscussionComponent/AddDiscussionComponent.tsx b/src/pages/OldCommon/components/CommonDetailContainer/AddDiscussionComponent/AddDiscussionComponent.tsx index 7ba21e358d..7037f4c722 100644 --- a/src/pages/OldCommon/components/CommonDetailContainer/AddDiscussionComponent/AddDiscussionComponent.tsx +++ b/src/pages/OldCommon/components/CommonDetailContainer/AddDiscussionComponent/AddDiscussionComponent.tsx @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from "react-redux"; import { MultiValue, SingleValue } from "react-select"; import classNames from "classnames"; import { Formik } from "formik"; -import { omit } from "lodash-es"; +import { omit } from "lodash"; import * as Yup from "yup"; import { createDiscussion } from "@/pages/OldCommon/store/actions"; import { getCommonGovernanceCircles } from "@/pages/OldCommon/store/api"; diff --git a/src/pages/OldCommon/components/CommonDetailContainer/CommonWhitepaper/components/WhitepaperMembers/helpers.ts b/src/pages/OldCommon/components/CommonDetailContainer/CommonWhitepaper/components/WhitepaperMembers/helpers.ts index a4a9d32cd5..0ebc73d352 100644 --- a/src/pages/OldCommon/components/CommonDetailContainer/CommonWhitepaper/components/WhitepaperMembers/helpers.ts +++ b/src/pages/OldCommon/components/CommonDetailContainer/CommonWhitepaper/components/WhitepaperMembers/helpers.ts @@ -1,4 +1,4 @@ -import { lowerCase, startCase } from "lodash-es"; +import { lowerCase, startCase } from "lodash"; import { GovernanceActions } from "@/shared/constants"; import { AllowedActions } from "@/shared/models"; import { commonTypeText } from "@/shared/utils"; diff --git a/src/pages/OldCommon/components/CommonListContainer/EditRulesModal/EditSteps/Rules/Rules.tsx b/src/pages/OldCommon/components/CommonListContainer/EditRulesModal/EditSteps/Rules/Rules.tsx index c89e57d31b..813a6cc3de 100644 --- a/src/pages/OldCommon/components/CommonListContainer/EditRulesModal/EditSteps/Rules/Rules.tsx +++ b/src/pages/OldCommon/components/CommonListContainer/EditRulesModal/EditSteps/Rules/Rules.tsx @@ -8,7 +8,7 @@ import { intersectionBy, isEmpty, isEqual, -} from "lodash-es"; +} from "lodash"; import { Button, Separator } from "@/shared/components"; import { Form, RulesArray } from "@/shared/components/Form/Formik"; import { ModalFooter, ModalHeaderContent } from "@/shared/components/Modal"; diff --git a/src/pages/common/components/ChatComponent/ChatComponent.tsx b/src/pages/common/components/ChatComponent/ChatComponent.tsx index 17a20c1415..de1e7796fd 100644 --- a/src/pages/common/components/ChatComponent/ChatComponent.tsx +++ b/src/pages/common/components/ChatComponent/ChatComponent.tsx @@ -11,7 +11,7 @@ import { useDispatch, useSelector } from "react-redux"; import { useDebounce, useMeasure, useScroll } from "react-use"; import classNames from "classnames"; import isHotkey from "is-hotkey"; -import { debounce, delay, omit } from "lodash-es"; +import { debounce, delay, omit } from "lodash"; import { v4 as uuidv4 } from "uuid"; import { selectUser } from "@/pages/Auth/store/selectors"; import { ChatService, DiscussionMessageService, FileService } from "@/services"; diff --git a/src/pages/common/components/ChatComponent/utils/getLastNonUserMessage.ts b/src/pages/common/components/ChatComponent/utils/getLastNonUserMessage.ts index 8b2f163a06..1653bea56f 100644 --- a/src/pages/common/components/ChatComponent/utils/getLastNonUserMessage.ts +++ b/src/pages/common/components/ChatComponent/utils/getLastNonUserMessage.ts @@ -1,4 +1,4 @@ -import { findLast } from "lodash-es"; +import findLast from "lodash/findLast"; import { checkIsUserDiscussionMessage, DiscussionMessage, diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewDiscussionCreation/components/DiscussionFormPersist/DiscussionFormPersist.tsx b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewDiscussionCreation/components/DiscussionFormPersist/DiscussionFormPersist.tsx index 757fda4bcb..b04e921852 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewDiscussionCreation/components/DiscussionFormPersist/DiscussionFormPersist.tsx +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewDiscussionCreation/components/DiscussionFormPersist/DiscussionFormPersist.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, useMemo } from "react"; import { useDispatch } from "react-redux"; import { useFormikContext } from "formik"; -import { debounce } from "lodash-es"; +import debounce from "lodash/debounce"; import { NewDiscussionCreationFormValues } from "@/shared/interfaces"; import { commonActions } from "@/store/states"; diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalFormPersist/ProposalFormPersist.tsx b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalFormPersist/ProposalFormPersist.tsx index d9eba8e16f..5b69531cd2 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalFormPersist/ProposalFormPersist.tsx +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/ProposalFormPersist/ProposalFormPersist.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, useMemo } from "react"; import { useDispatch } from "react-redux"; import { useFormikContext } from "formik"; -import { debounce } from "lodash-es"; +import debounce from "lodash/debounce"; import { NewProposalCreationFormValues } from "@/shared/interfaces"; import { commonActions } from "@/store/states"; diff --git a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/VotingSettings/VotingSettings.tsx b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/VotingSettings/VotingSettings.tsx index e7c798b503..fb7d9dcd3a 100644 --- a/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/VotingSettings/VotingSettings.tsx +++ b/src/pages/common/components/CommonTabPanels/components/FeedTab/components/NewProposalCreation/components/VotingSettings/VotingSettings.tsx @@ -1,5 +1,5 @@ import React, { FC, useMemo } from "react"; -import { flattenDeep, uniq } from "lodash-es"; +import { flattenDeep, uniq } from "lodash"; import { ProposalsTypes } from "@/shared/constants"; import { Circles, Governance } from "@/shared/models"; import { diff --git a/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx b/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx index 1fa0fd3c3f..5ae93d5034 100644 --- a/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx +++ b/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx @@ -7,7 +7,7 @@ import React, { } from "react"; import { useSelector } from "react-redux"; import { useUpdateEffect } from "react-use"; -import { debounce } from "lodash-es"; +import { debounce } from "lodash"; import { selectUser } from "@/pages/Auth/store/selectors"; import { DiscussionService } from "@/services"; import { DeletePrompt, GlobalOverlay, ReportModal } from "@/shared/components"; diff --git a/src/pages/common/components/DiscussionFeedCard/components/UnlinkStreamModal/UnlinkStreamModal.tsx b/src/pages/common/components/DiscussionFeedCard/components/UnlinkStreamModal/UnlinkStreamModal.tsx index 0cc50eec3b..76f0886970 100644 --- a/src/pages/common/components/DiscussionFeedCard/components/UnlinkStreamModal/UnlinkStreamModal.tsx +++ b/src/pages/common/components/DiscussionFeedCard/components/UnlinkStreamModal/UnlinkStreamModal.tsx @@ -2,7 +2,7 @@ import React, { FC, useRef, useState } from "react"; import { useSelector } from "react-redux"; import { CancelTokenSource } from "axios"; import classNames from "classnames"; -import { isError } from "lodash-es"; +import { isError } from "lodash"; import { selectUser } from "@/pages/Auth/store/selectors"; import { CommonFeedService, @@ -71,11 +71,7 @@ const UnlinkStreamModal: FC = (props) => { cancelTokenRef.current = null; } setIsUnlinking(false); - setErrorText( - isError(error) - ? (error as Record)?.message - : "Something went wrong...", - ); + setErrorText(isError(error) ? error.message : "Something went wrong..."); } }; diff --git a/src/pages/common/components/ProposalFeedCard/ProposalFeedCard.tsx b/src/pages/common/components/ProposalFeedCard/ProposalFeedCard.tsx index 49f2262a70..3396b0756b 100644 --- a/src/pages/common/components/ProposalFeedCard/ProposalFeedCard.tsx +++ b/src/pages/common/components/ProposalFeedCard/ProposalFeedCard.tsx @@ -7,7 +7,7 @@ import React, { } from "react"; import { useSelector } from "react-redux"; import { useUpdateEffect } from "react-use"; -import { debounce } from "lodash-es"; +import { debounce } from "lodash"; import { selectUser } from "@/pages/Auth/store/selectors"; import { useCommonMember, useProposalUserVote } from "@/pages/OldCommon/hooks"; import { ProposalService } from "@/services"; diff --git a/src/pages/commonFeed/components/FeedLayout/utils/splitViewSize.ts b/src/pages/commonFeed/components/FeedLayout/utils/splitViewSize.ts index 02ab48a817..f9f1c48adc 100644 --- a/src/pages/commonFeed/components/FeedLayout/utils/splitViewSize.ts +++ b/src/pages/commonFeed/components/FeedLayout/utils/splitViewSize.ts @@ -1,4 +1,4 @@ -import { debounce } from "lodash-es"; +import { debounce } from "lodash"; import { StorageKey } from "@/shared/constants"; export const saveChatSize = debounce((size: number) => { diff --git a/src/pages/commonFeed/components/HeaderContent/hooks/useSearchFeedItems.ts b/src/pages/commonFeed/components/HeaderContent/hooks/useSearchFeedItems.ts index f36438b64d..a75080246c 100644 --- a/src/pages/commonFeed/components/HeaderContent/hooks/useSearchFeedItems.ts +++ b/src/pages/commonFeed/components/HeaderContent/hooks/useSearchFeedItems.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from "react"; -import { debounce } from "lodash-es"; +import { debounce } from "lodash"; import { QueryParamKey } from "@/shared/constants"; import { ToggleState, useQueryParams, useToggle } from "@/shared/hooks"; import { addQueryParam, deleteQueryParam } from "@/shared/utils"; diff --git a/src/pages/commonFeed/hooks/useCommonData/index.ts b/src/pages/commonFeed/hooks/useCommonData/index.ts index a93847385f..655be3d88e 100644 --- a/src/pages/commonFeed/hooks/useCommonData/index.ts +++ b/src/pages/commonFeed/hooks/useCommonData/index.ts @@ -1,5 +1,5 @@ import { RefObject, useCallback, useRef, useState } from "react"; -import { last } from "lodash-es"; +import { last } from "lodash"; import { CommonFeedService, CommonService, diff --git a/src/services/Common.ts b/src/services/Common.ts index a62be3d7ed..7429ff78d6 100644 --- a/src/services/Common.ts +++ b/src/services/Common.ts @@ -1,4 +1,4 @@ -import { isEqual } from "lodash-es"; +import { isEqual } from "lodash"; import { getCommonState, updateCommonState, diff --git a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx index 832fe196c6..8b4b56a0bf 100644 --- a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx +++ b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx @@ -8,7 +8,7 @@ import React, { } from "react"; import { useDispatch } from "react-redux"; import classNames from "classnames"; -import { isEmpty } from "lodash-es"; +import { isEmpty } from "lodash"; import { Element } from "slate"; import { useLongPress } from "use-long-press"; import * as oldCommonActions from "@/pages/OldCommon/store/actions"; diff --git a/src/shared/components/Chat/ChatMessage/DMChatMessage.tsx b/src/shared/components/Chat/ChatMessage/DMChatMessage.tsx index 8ae0a45475..99f8c2affa 100644 --- a/src/shared/components/Chat/ChatMessage/DMChatMessage.tsx +++ b/src/shared/components/Chat/ChatMessage/DMChatMessage.tsx @@ -9,7 +9,7 @@ import React, { import { useDispatch } from "react-redux"; import { usePrevious } from "react-use"; import classNames from "classnames"; -import { isEmpty, isEqual } from "lodash-es"; +import { isEmpty, isEqual } from "lodash"; import { Element } from "slate"; import { useLongPress } from "use-long-press"; import { ChatService, Logger } from "@/services"; diff --git a/src/shared/components/Chat/ChatMessage/components/Reactions/Reactions.tsx b/src/shared/components/Chat/ChatMessage/components/Reactions/Reactions.tsx index 4c8e4f2849..2e9585e4b5 100644 --- a/src/shared/components/Chat/ChatMessage/components/Reactions/Reactions.tsx +++ b/src/shared/components/Chat/ChatMessage/components/Reactions/Reactions.tsx @@ -7,7 +7,7 @@ import React, { useState, } from "react"; import { useSelector } from "react-redux"; -import { isEmpty } from "lodash-es"; +import { isEmpty } from "lodash"; import { selectUser } from "@/pages/Auth/store/selectors"; import { Logger } from "@/services"; import { UserAvatar } from "@/shared/components/UserAvatar"; diff --git a/src/shared/components/Dropdown/Dropdown.tsx b/src/shared/components/Dropdown/Dropdown.tsx index 83cec6cdcc..8f7e34c686 100644 --- a/src/shared/components/Dropdown/Dropdown.tsx +++ b/src/shared/components/Dropdown/Dropdown.tsx @@ -19,7 +19,7 @@ import { closeMenu, } from "react-aria-menubutton"; import classNames from "classnames"; -import { isEqual } from "lodash-es"; +import { isEqual } from "lodash"; import { v4 as uuidv4 } from "uuid"; import { useChatContentContext } from "@/pages/common/components/CommonContent/context"; import { Loader } from "@/shared/components"; diff --git a/src/shared/components/FilesCarousel/AllFilesCarousel/AllFilesCarousel.tsx b/src/shared/components/FilesCarousel/AllFilesCarousel/AllFilesCarousel.tsx index 8481447703..8b032dc891 100644 --- a/src/shared/components/FilesCarousel/AllFilesCarousel/AllFilesCarousel.tsx +++ b/src/shared/components/FilesCarousel/AllFilesCarousel/AllFilesCarousel.tsx @@ -9,14 +9,14 @@ import React, { ForwardRefRenderFunction, } from "react"; import classNames from "classnames"; -import throttle from "lodash-es/throttle"; import { Swiper, SwiperSlide } from "swiper/react"; import SwiperClass from "swiper/types/swiper-class"; +import throttle from "lodash/throttle"; import DownloadIcon from "../../../icons/download.icon"; import LeftArrowIcon from "../../../icons/leftArrow.icon"; import RightArrowIcon from "../../../icons/rightArrow.icon"; -import { DocInfo } from "../../../models"; import { saveZip } from "../../../utils"; +import { DocInfo } from "../../../models"; import { ButtonIcon } from "../../ButtonIcon"; import { InvoiceTile } from "../../InvoiceTile"; import { getSwiperConfig } from "./helpers"; @@ -45,8 +45,10 @@ const AllFilesCarousel: ForwardRefRenderFunction< initialDocIndex, onDocClick, } = props; - const [swiperWrapperRef, setSwiperWrapperRef] = - useState(null); + const [ + swiperWrapperRef, + setSwiperWrapperRef, + ] = useState(null); const [{ isBeginning, isEnd }, setSlideState] = useState<{ isBeginning: boolean; isEnd: boolean; @@ -57,7 +59,7 @@ const AllFilesCarousel: ForwardRefRenderFunction< const swiperClientWidth = swiperWrapperRef?.clientWidth || 0; const swiperConfig = useMemo( () => getSwiperConfig(payoutDocs.length, swiperClientWidth), - [payoutDocs.length, swiperClientWidth], + [payoutDocs.length, swiperClientWidth] ); const handleSlideChange = useCallback( @@ -68,17 +70,17 @@ const AllFilesCarousel: ForwardRefRenderFunction< : { isBeginning, isEnd, - }, + } ); }, - [], + [] ); const handleSwiper = useCallback( (swiper: SwiperClass) => { swiperRef.current = swiper; handleSlideChange(swiper); }, - [handleSlideChange], + [handleSlideChange] ); const handleLeftClick = () => { @@ -129,14 +131,14 @@ const AllFilesCarousel: ForwardRefRenderFunction< swiperRef.current?.slideTo(index); }, }), - [], + [] ); const contentWrapperClassName = classNames( "all-files-carousel-wrapper__content-wrapper", { "all-files-carousel-wrapper__content-wrapper--without-actions": false, - }, + } ); return ( @@ -157,8 +159,7 @@ const AllFilesCarousel: ForwardRefRenderFunction<