Skip to content

Commit

Permalink
chore: organize file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturHoncharuk committed Dec 5, 2024
1 parent fb1bf36 commit c700518
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/screens/Wallets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ export const HomeScreen = () => {
const { setWallet } = useWalletStore();
const { tokens: _sendFundsTokens, onSetTokens } = useSendFundsStore();

const { data: accounts } = useAllAccounts();
const [headerHeight, setHeaderHeight] = useState(0);
const [scrollIdx, setScrollIdx] = useState(0);

const hideThreshold = headerHeight + 24;
const hideThresholdQuarter = hideThreshold / 4;

const offsetScrollY = useSharedValue(0);
const activeTabIndex = useSharedValue(0);

const { data: accounts } = useAllAccounts();
const selectedAccount = accounts.length > 0 ? accounts[scrollIdx] : null;
const { data: selectedAccountBalance, refetch: refetchAmbBalance } =
useBalanceOfAddress(selectedAccount?.address || '');
Expand Down Expand Up @@ -89,14 +97,6 @@ export const HomeScreen = () => {
return ethers.utils.parseEther(selectedAccountBalance.wei).isZero();
}, [selectedAccountBalance.wei]);

const [headerHeight, setHeaderHeight] = useState(0);

const hideThreshold = headerHeight + 24;
const hideThresholdQuarter = hideThreshold / 4;

const offsetScrollY = useSharedValue(0);
const activeTabIndex = useSharedValue(0);

const onTransactionsScrollEvent = useAnimatedScrollHandler({
onScroll: (event) => {
const { y: scrollY } = event.contentOffset;
Expand Down Expand Up @@ -167,6 +167,7 @@ export const HomeScreen = () => {

const onChangeActiveTabIndex = useCallback(
(index: number) => {
cancelAnimation(offsetScrollY);
activeTabIndex.value = index;
offsetScrollY.value = 0;
},
Expand Down

0 comments on commit c700518

Please sign in to comment.