-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ (llm) new accounts and assets lists portfolio (#8663)
- Loading branch information
1 parent
042e25a
commit 8223e21
Showing
26 changed files
with
1,435 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"live-mobile": minor | ||
"@ledgerhq/native-ui": minor | ||
--- | ||
|
||
Create a new tabSelector component inside native ui. Rename the existing one in DrawerTabSelector since it's used only in a drawer. Integration of the new assets/accounts lists in wallet screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
apps/ledger-live-mobile/src/screens/Portfolio/TabSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { memo } from "react"; | ||
import { Box, Flex } from "@ledgerhq/native-ui"; | ||
import Animated from "react-native-reanimated"; | ||
import { TabSelector } from "@ledgerhq/native-ui"; | ||
import AssetsListView from "LLM/features/Assets/components/AssetsListView"; | ||
import AccountsListView from "LLM/features/Accounts/components/AccountsListView"; | ||
import { ScreenName } from "~/const"; | ||
import { LayoutChangeEvent } from "react-native"; | ||
|
||
export const TAB_OPTIONS = { | ||
Assets: "Assets", | ||
Accounts: "Accounts", | ||
} as const; | ||
|
||
type BaseAnimationStyle = { | ||
transform: { | ||
translateX: number; | ||
}[]; | ||
opacity: number; | ||
}; | ||
|
||
type TabSectionProps = { | ||
t: (key: string) => string; | ||
handleToggle: (value: string) => void; | ||
handleLayout: (event: LayoutChangeEvent) => void; | ||
assetsAnimatedStyle: BaseAnimationStyle; | ||
accountsAnimatedStyle: BaseAnimationStyle; | ||
maxItemsToDysplay: number; | ||
}; | ||
|
||
const TabSection: React.FC<TabSectionProps> = ({ | ||
t, | ||
handleToggle, | ||
handleLayout, | ||
assetsAnimatedStyle, | ||
accountsAnimatedStyle, | ||
maxItemsToDysplay, | ||
}) => ( | ||
<> | ||
<Box height={40} mb={16}> | ||
<TabSelector labels={[t("assets.title"), t("accounts.title")]} onToggle={handleToggle} /> | ||
</Box> | ||
<Flex | ||
flexDirection="row" | ||
overflow="hidden" | ||
onLayout={handleLayout} | ||
width="200%" | ||
testID="portfolio-assets-layout" | ||
> | ||
<Animated.View style={[{ flex: 1 }, assetsAnimatedStyle]}> | ||
<AssetsListView | ||
sourceScreenName={ScreenName.Portfolio} | ||
limitNumberOfAssets={maxItemsToDysplay} | ||
/> | ||
</Animated.View> | ||
<Animated.View style={[{ flex: 1 }, accountsAnimatedStyle]}> | ||
<AccountsListView | ||
sourceScreenName={ScreenName.Portfolio} | ||
limitNumberOfAccounts={maxItemsToDysplay} | ||
/> | ||
</Animated.View> | ||
</Flex> | ||
</> | ||
); | ||
|
||
export default memo(TabSection); |
Oops, something went wrong.