Skip to content

Commit

Permalink
πŸ—οΈ [CHORE] : Rework new Arch folder (#7359)
Browse files Browse the repository at this point in the history
* [CHORE] : Rework new Arch folder

* Fix unimported
  • Loading branch information
mcayuelas-ledger committed Jul 18, 2024
1 parent 31171ce commit 53e9dd4
Show file tree
Hide file tree
Showing 153 changed files with 111 additions and 101 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-bears-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Rework new Arch folder
5 changes: 3 additions & 2 deletions apps/ledger-live-desktop/.unimportedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"src/generate-cryptoassets-md.test.ts",
"src/generate-cryptoassets-md.ts",

"src/newArch/Collectibles/**",
"src/newArch/WalletSync/**",
"src/newArch/features/Collectibles/**",
"src/newArch/features/AnalyticsOptInPrompt/**",
"src/newArch/features/WalletSync/**",
"src/newArch/components/ContextMenu/**",
"src/newArch/components/BreadCrumb/**"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components";
import { Route } from "react-router-dom";
import AccountCrumb from "~/renderer/components/Breadcrumb/AccountCrumb";
import AssetCrumb from "~/renderer/components/Breadcrumb/AssetCrumb";
import NFTCrumb from "LLD/Collectibles/Nfts/BreadCrumb";
import NFTCrumb from "LLD/features/Collectibles/Nfts/BreadCrumb";
import MarketCrumb from "~/renderer/components/Breadcrumb/MarketCrumb";
const Wrapper = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useHistory } from "react-router-dom";
import ContextMenuItem from "./Item";
import { setDrawer } from "~/renderer/drawers/Provider";
import { Account } from "@ledgerhq/types-live";
import { CollectibleType } from "../../Collectibles/types/Collectibles";
import { createContextMenuItems } from "./createContextMenuItems";
import { CollectibleType } from "LLD/features/Collectibles/types/Collectibles";

type Props = {
account: Account;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IconsLegacy } from "@ledgerhq/react-ui";
import { openModal } from "~/renderer/actions/modals";
import { CollectibleType, CollectibleTypeEnum } from "../../Collectibles/types/Collectibles";
import { Account } from "@ledgerhq/types-live";
import { Dispatch } from "redux";
import { TFunction } from "i18next";
import { RouteComponentProps } from "react-router-dom";
import { CollectibleType, CollectibleTypeEnum } from "LLD/features/Collectibles/types/Collectibles";

type Props = {
account: Account;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from "react";
import { useAnalyticsOptInPrompt } from "LLD/AnalyticsOptInPrompt/hooks/useCommonLogic";
import { useAnalyticsOptInPrompt } from "LLD/features/AnalyticsOptInPrompt/hooks/useCommonLogic";
import { EntryPoint } from "../types/AnalyticsOptInPromptNavigator";

export const useDisplayOnPortfolioAnalytics = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
import {
EntryPoint,
FieldKeySwitch,
} from "LLD/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
} from "LLD/features/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import { track } from "~/renderer/analytics/segment";
import { useAnalyticsOptInPrompt } from "./useCommonLogic";
import { ABTestingVariants } from "@ledgerhq/types-live";
import { steps } from "LLD/AnalyticsOptInPrompt/const/steps";
import { steps } from "LLD/features/AnalyticsOptInPrompt/const/steps";

interface UseVariantAProps {
onSubmit?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
setShareAnalytics,
setSharePersonalizedRecommendations,
} from "~/renderer/actions/settings";
import { steps } from "LLD/AnalyticsOptInPrompt/const/steps";
import { steps } from "LLD/features/AnalyticsOptInPrompt/const/steps";

interface UseVariantBProps {
entryPoint: EntryPoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { useTranslation } from "react-i18next";
import { Box, Text } from "@ledgerhq/react-ui";
import styled, { useTheme } from "styled-components";
import RevokeInfoField from "LLD/AnalyticsOptInPrompt/screens/components/RevokeInfoField";
import RevokeInfoField from "LLD/features/AnalyticsOptInPrompt/screens/components/RevokeInfoField";
import { TrackingInfoList } from "./components";

const BodyBox = styled(Box)`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Footer } from "LLD/AnalyticsOptInPrompt/screens/components";
import { Footer } from "LLD/features/AnalyticsOptInPrompt/screens/components";
import { useTranslation } from "react-i18next";
import { Flex, Link, Button } from "@ledgerhq/react-ui";
import { useTheme } from "styled-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { MainBody } from "./components";
import { HeaderTitle } from "LLD/AnalyticsOptInPrompt/screens/components";
import { HeaderTitle } from "LLD/features/AnalyticsOptInPrompt/screens/components";
import { Flex } from "@ledgerhq/react-ui";
import { useLocation } from "react-router";
import Track from "~/renderer/analytics/Track";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useCallback, useState } from "react";
import { Box, Text, Flex, Switch } from "@ledgerhq/react-ui";
import styled, { useTheme } from "styled-components";
import { useTranslation } from "react-i18next";
import RevokeInfoField from "LLD/AnalyticsOptInPrompt/screens/components/RevokeInfoField";
import { FieldKeySwitch } from "LLD/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import RevokeInfoField from "LLD/features/AnalyticsOptInPrompt/screens/components/RevokeInfoField";
import { FieldKeySwitch } from "LLD/features/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";

const BodyBox = styled(Box)`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Flex } from "@ledgerhq/react-ui";
import React from "react";
import { useTranslation } from "react-i18next";
import { Footer } from "LLD/AnalyticsOptInPrompt/screens/components";
import { Footer } from "LLD/features/AnalyticsOptInPrompt/screens/components";

interface ManagePreferencesFooterProps {
onShareClick?: (value: boolean) => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from "react";
import { ManagePreferencesBody } from "./components";
import { HeaderTitle } from "LLD/AnalyticsOptInPrompt/screens/components";
import { HeaderTitle } from "LLD/features/AnalyticsOptInPrompt/screens/components";
import { Flex } from "@ledgerhq/react-ui";
import { FieldKeySwitch } from "LLD/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import { FieldKeySwitch } from "LLD/features/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import Track from "~/renderer/analytics/Track";

interface ManagePreferencesProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";
import Main from "LLD/AnalyticsOptInPrompt/screens/VariantA/Main";
import ManagePreferences from "LLD/AnalyticsOptInPrompt/screens/VariantA/ManagePreferences";
import { ManagePreferencesFooter } from "LLD/AnalyticsOptInPrompt/screens/VariantA/ManagePreferences/components";
import { MainFooter } from "LLD/AnalyticsOptInPrompt/screens/VariantA/Main/components";
import useVariantA from "LLD/AnalyticsOptInPrompt/hooks/useVariantA";
import { EntryPoint } from "LLD/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import Main from "LLD/features/AnalyticsOptInPrompt/screens/VariantA/Main";
import ManagePreferences from "LLD/features/AnalyticsOptInPrompt/screens/VariantA/ManagePreferences";
import { ManagePreferencesFooter } from "LLD/features/AnalyticsOptInPrompt/screens/VariantA/ManagePreferences/components";
import { MainFooter } from "LLD/features/AnalyticsOptInPrompt/screens/VariantA/Main/components";
import useVariantA from "LLD/features/AnalyticsOptInPrompt/hooks/useVariantA";
import { EntryPoint } from "LLD/features/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";

interface VariantAProps {
onSubmit?: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Flex } from "@ledgerhq/react-ui";
import { Header } from "./components";
import { Body } from "LLD/AnalyticsOptInPrompt/screens/VariantB/components";
import { Body } from "LLD/features/AnalyticsOptInPrompt/screens/VariantB/components";
import React from "react";
import { useLocation } from "react-router";
import Track from "~/renderer/analytics/Track";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Flex } from "@ledgerhq/react-ui";
import { Header } from "./components";
import { Body } from "LLD/AnalyticsOptInPrompt/screens/VariantB/components";
import { Body } from "LLD/features/AnalyticsOptInPrompt/screens/VariantB/components";
import React from "react";
import Track from "~/renderer/analytics/Track";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { HeaderTitle, RevokeInfoField } from "LLD/AnalyticsOptInPrompt/screens/components";
import { HeaderTitle, RevokeInfoField } from "LLD/features/AnalyticsOptInPrompt/screens/components";
import { Flex, Text, Box } from "@ledgerhq/react-ui";
import { useTranslation } from "react-i18next";
import styled, { useTheme } from "styled-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Footer } from "LLD/AnalyticsOptInPrompt/screens/components";
import { Footer } from "LLD/features/AnalyticsOptInPrompt/screens/components";
import { useTranslation } from "react-i18next";
import { Flex, Button } from "@ledgerhq/react-ui";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import AnalyticsScreen from "./Analytics";
import RecommandationsScreen from "./PersonalRecommendations";
import { useVariantB } from "LLD/AnalyticsOptInPrompt/hooks/useVariantB";
import Footer from "LLD/AnalyticsOptInPrompt/screens/VariantB/components/Footer";
import { useVariantB } from "LLD/features/AnalyticsOptInPrompt/hooks/useVariantB";
import Footer from "LLD/features/AnalyticsOptInPrompt/screens/VariantB/components/Footer";
import { Flex } from "@ledgerhq/react-ui";
import { EntryPoint } from "../../types/AnalyticsOptInPromptNavigator";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { memo } from "react";
import { ABTestingVariants } from "@ledgerhq/types-live";
import { SideDrawer } from "~/renderer/components/SideDrawer";
import { useTheme } from "styled-components";
import { EntryPoint } from "LLD/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import VariantA from "LLD/AnalyticsOptInPrompt/screens/VariantA";
import VariantB from "LLD/AnalyticsOptInPrompt/screens/VariantB";
import { EntryPoint } from "LLD/features/AnalyticsOptInPrompt/types/AnalyticsOptInPromptNavigator";
import VariantA from "LLD/features/AnalyticsOptInPrompt/screens/VariantA";
import VariantB from "LLD/features/AnalyticsOptInPrompt/screens/VariantB";
import Box from "~/renderer/components/Box";
import { withV3StyleProvider } from "~/renderer/styles/StyleProviderV3";
import { useDrawerLogic } from "../hooks/useDrawerLogic";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
import { ExternalViewerButton } from "LLD/Collectibles/components/DetailDrawer/components";
import { ExternalViewerButton } from "LLD/features/Collectibles/components/DetailDrawer/components";
import { useTranslation } from "react-i18next";
import Text from "~/renderer/components/Text";
import Button from "~/renderer/components/Button";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useCallback } from "react";
import { NFTMetadata } from "@ledgerhq/types-live";
import { DetailDrawer } from "LLD/Collectibles/components/DetailDrawer";
import useNftDetailDrawer from "LLD/Collectibles/hooks/useNftDetailDrawer";
import useCollectibles from "LLD/Collectibles/hooks/useCollectibles";
import { NftsDetailDrawerProps } from "LLD/Collectibles/types/Nfts";
import { CollectibleTypeEnum } from "LLD/Collectibles/types/Collectibles";
import { DetailDrawer } from "LLD/features/Collectibles/components/DetailDrawer";
import useNftDetailDrawer from "LLD/features/Collectibles/hooks/useNftDetailDrawer";
import useCollectibles from "LLD/features/Collectibles/hooks/useCollectibles";
import { NftsDetailDrawerProps } from "LLD/features/Collectibles/types/Nfts";
import { CollectibleTypeEnum } from "LLD/features/Collectibles/types/Collectibles";
import Actions from "./Actions";

const NftDetailDrawer = ({ account, tokenId, isOpened, setIsOpened }: NftsDetailDrawerProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from "react";
import styled from "styled-components";
import { useTranslation } from "react-i18next";
import { CollectibleTypeEnum, CollectibleType } from "LLD/Collectibles/types/Collectibles";
import { CollectibleTypeEnum, CollectibleType } from "LLD/features/Collectibles/types/Collectibles";
import Text from "~/renderer/components/Text";
import LabelWithExternalIcon from "~/renderer/components/LabelWithExternalIcon";
import { supportLinkByTokenType } from "~/config/urls";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import { Media, Skeleton } from "../../index";
import { Box, Text } from "@ledgerhq/react-ui";
import { rgba } from "~/renderer/styles/helpers";
import styled from "styled-components";
import { isNFTRow, isOrdinalsRow, isRareSatsRow } from "LLD/Collectibles/utils/typeGuardsChecker";
import { RowProps as Props } from "LLD/Collectibles/types/Collection";
import {
isNFTRow,
isOrdinalsRow,
isRareSatsRow,
} from "LLD/features/Collectibles/utils/typeGuardsChecker";
import { RowProps as Props } from "LLD/features/Collectibles/types/Collection";
import TokenTitle from "./TokenTitle";

const Container = styled(Box)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { memo } from "react";
import { useNftCollectionMetadata } from "@ledgerhq/live-nft-react";
import { Account, ProtoNFT } from "@ledgerhq/types-live";
import NFTCollectionContextMenu from "~/renderer/components/ContextMenu/NFTCollectionContextMenu";
import { Skeleton } from "LLD/Collectibles/components";
import { Skeleton } from "LLD/features/Collectibles/components";
import styled from "styled-components";
import { IconsLegacy } from "@ledgerhq/react-ui";
import { FieldStatus } from "LLD/Collectibles/types/DetailDrawer";
import { FieldStatus } from "LLD/features/Collectibles/types/DetailDrawer";

const Dots = styled.div`
justify-content: flex-end;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Text from "~/renderer/components/Text";
import { Skeleton } from "LLD/Collectibles/components/index";
import { HeaderTextProps } from "LLD/Collectibles/types/DetailDrawer";
import { Skeleton } from "LLD/features/Collectibles/components/index";
import { HeaderTextProps } from "LLD/features/Collectibles/types/DetailDrawer";

const CollectionNameComponent: React.FC<HeaderTextProps> = ({ isLoading, text }) => (
<Text ff="Inter|SemiBold" fontSize={5} lineHeight="18px" color="neutral.c70" pb={2}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo } from "react";
import styled from "styled-components";
import { CopyableFieldProps } from "LLD/Collectibles/types/DetailDrawer";
import { CopyableFieldProps } from "LLD/features/Collectibles/types/DetailDrawer";
import { GradientHover } from "~/renderer/drawers/OperationDetails/styledComponents";
import CopyWithFeedback from "~/renderer/components/CopyWithFeedback";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo } from "react";
import { Skeleton } from "LLD/Collectibles/components/Skeleton";
import { DetailFieldProps } from "LLD/Collectibles/types/DetailDrawer";
import { Skeleton } from "LLD/features/Collectibles/components/Skeleton";
import { DetailFieldProps } from "LLD/features/Collectibles/types/DetailDrawer";
import { CopyableField } from ".";
import Text from "~/renderer/components/Text";
import styled from "styled-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useCallback, memo, ReactElement } from "react";
import styled from "styled-components";
import { useHistory } from "react-router-dom";
import { ExternalViewerButtonProps, ItemType } from "LLD/Collectibles/types/DetailDrawer";
import { ExternalViewerButtonProps, ItemType } from "LLD/features/Collectibles/types/DetailDrawer";
import Box from "~/renderer/components/Box";
import Button from "~/renderer/components/Button";
import DropDownSelector, { DropDownItem } from "~/renderer/components/DropDownSelector";
import IconExternal from "~/renderer/icons/ExternalLink";
import useNftLinks from "LLD/Collectibles/hooks/useNftLinks";
import useNftLinks from "LLD/features/Collectibles/hooks/useNftLinks";
import { setDrawer } from "~/renderer/drawers/Provider";
import { Icons } from "@ledgerhq/react-ui";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
import ZoomInIcon from "~/renderer/icons/ZoomIn";
import { Skeleton } from "LLD/Collectibles/components";
import { Skeleton } from "LLD/features/Collectibles/components";

const ImageContainer = styled.div`
position: relative;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { memo } from "react";
import { createPortal } from "react-dom";
import { PanAndZoomProps, PanAndZoomBodyProps } from "LLD/Collectibles/types/DetailDrawer";
import { Media } from "LLD/Collectibles/components/index";
import { PanAndZoomProps, PanAndZoomBodyProps } from "LLD/features/Collectibles/types/DetailDrawer";
import { Media } from "LLD/features/Collectibles/components/index";
import PrismaZoom from "react-prismazoom";
import IconCross from "~/renderer/icons/Cross";
import styled from "styled-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useMemo } from "react";
import Text from "~/renderer/components/Text";
import styled from "styled-components";
import { Skeleton } from "LLD/Collectibles/components/index";
import { FieldStatus, TagProps } from "LLD/Collectibles/types/DetailDrawer";
import { Skeleton } from "LLD/features/Collectibles/components/index";
import { FieldStatus, TagProps } from "LLD/features/Collectibles/types/DetailDrawer";

const PropertiesContainer = styled.div<{ isNewDesign?: boolean }>`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { HeaderTextProps } from "LLD/Collectibles/types/DetailDrawer";
import { HeaderTextProps } from "LLD/features/Collectibles/types/DetailDrawer";
import Text from "~/renderer/components/Text";
import { Skeleton } from "LLD/Collectibles/components/index";
import { Skeleton } from "LLD/features/Collectibles/components/index";

const styles: React.CSSProperties = {
WebkitLineClamp: 3,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { ReactElement } from "react";
import { CollectionName, DetailField, Tag, Title, MediaContainer } from "./components";
import { PanAndZoom } from "./components/PanAndZoom";
import { Media } from "LLD/Collectibles/components";
import { Media } from "LLD/features/Collectibles/components";
import { SideDrawer } from "~/renderer/components/SideDrawer";
import styled from "styled-components";
import { PositionProps, LayoutProps, SpaceProps, position, layout, space } from "styled-system";
import { DetailDrawerProps, FieldStatus } from "LLD/Collectibles/types/DetailDrawer";
import { createCollectibleObject } from "LLD/Collectibles/utils/createCollectibleObject";
import { DetailDrawerProps, FieldStatus } from "LLD/features/Collectibles/types/DetailDrawer";
import { createCollectibleObject } from "LLD/features/Collectibles/utils/createCollectibleObject";
import { useTranslation } from "react-i18next";
import { CollectibleTypeEnum } from "LLD/Collectibles/types/Collectibles";
import { CollectibleTypeEnum } from "LLD/features/Collectibles/types/Collectibles";

type ChildComponentProps = {
children: ReactElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { ImageProps } from "LLD/Collectibles/types/Media";
import { ImageProps } from "LLD/features/Collectibles/types/Media";
import styled from "styled-components";
import { Skeleton, Placeholder } from "LLD/Collectibles/components";
import { Skeleton, Placeholder } from "LLD/features/Collectibles/components";
/**
* Nb: This image component can be used for small listings, large gallery rendering,
* and even tokens without an image where it will fallback to a generative image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import { VideoProps } from "LLD/Collectibles/types/Media";
import { Skeleton } from "LLD/Collectibles/components";
import { VideoProps } from "LLD/features/Collectibles/types/Media";
import { Skeleton } from "LLD/features/Collectibles/components";
import styled from "styled-components";

const Wrapper = styled.div<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { MediaProps } from "LLD/Collectibles/types/Media";
import { Placeholder, Image, Video } from "LLD/Collectibles/components";
import { MediaProps } from "LLD/features/Collectibles/types/Media";
import { Placeholder, Image, Video } from "LLD/features/Collectibles/components";

const MediaComponent: React.FC<MediaProps> = props => {
const Component = props.contentType === "video" && !props.useFallback ? Video : Image;
Expand Down
Loading

0 comments on commit 53e9dd4

Please sign in to comment.