Skip to content

Commit

Permalink
fix(mobile): Bring back FinishSetupList
Browse files Browse the repository at this point in the history
  • Loading branch information
voloshinskii committed Apr 11, 2024
1 parent d0e6bb9 commit d667852
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/mobile/src/tabs/Wallet/WalletScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { MainStackRouteNames } from '$navigation';
import { WalletActionButtons } from './components/WalletActionButtons/WalletActionButtons';
import { WalletContentList } from './components/WalletContentList';
import { usePreparedWalletContent } from './content-providers/utils/usePreparedWalletContent';
import { FinishSetupList } from './components/FinishSetupList';

export const WalletScreen = memo(({ navigation }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -73,6 +74,11 @@ export const WalletScreen = memo(({ navigation }) => {

const isWatchOnly = wallet && wallet.isWatchOnly;

const ListFooter = useMemo(
() => (isWatchOnly ? null : <FinishSetupList />),
[isWatchOnly],
);

const ListHeader = useMemo(
() => (
<View style={styles.mainSection}>
Expand Down Expand Up @@ -168,6 +174,7 @@ export const WalletScreen = memo(({ navigation }) => {
<WalletContentList
walletContent={preparedContent}
ListHeaderComponent={ListHeader}
ListFooterComponent={ListFooter}
handleRefresh={handleRefresh}
isRefreshing={isRefreshing}
isFocused={isFocused}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useTheme } from '$hooks/useTheme';
import { HideableAmount } from '$core/HideableAmount/HideableAmount';
import { Text } from '@tonkeeper/uikit';
import { CellItemToRender } from '../content-providers/utils/types';
import { FinishSetupList } from './FinishSetupList';

const RenderItem = ({ item }: { item: CellItemToRender }) => {
const renderLeftContent = () => {
Expand Down Expand Up @@ -102,6 +103,7 @@ interface WalletContentListProps {
isRefreshing: boolean;
isFocused: boolean;
ListHeaderComponent?: React.ReactElement;
ListFooterComponent?: React.ReactElement | null;
}

export const WalletContentList = memo<WalletContentListProps>((props) => {
Expand All @@ -115,6 +117,7 @@ export const WalletContentList = memo<WalletContentListProps>((props) => {
</View>
)}
ListHeaderComponent={props.ListHeaderComponent}
ListFooterComponent={props.ListFooterComponent}
renderItem={RenderItem}
data={props.walletContent}
refreshControl={
Expand Down

0 comments on commit d667852

Please sign in to comment.