Skip to content

Commit

Permalink
import cleanup, provide some context for logic
Browse files Browse the repository at this point in the history
  • Loading branch information
4eyes52 committed Sep 25, 2024
1 parent bd34137 commit fdb7f54
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion apps/nextjs/src/app/(app)/games/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Metadata } from "next";
import { GameCard } from "@/app/(app)/games/GameCard";
import { reader } from "@/utils/keystatic";
import { env } from 'env'

import { PageLayout } from "../../_components/PageLayout";

Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/_components/wallet/ExplorerLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
STARKSCAN_TX_URL,
SUPPORTED_L1_CHAIN_ID,
} from "@/constants/env";
import { ExternalLinkIcon, Text } from "lucide-react";
import { ExternalLinkIcon } from "lucide-react";

import type { ChainId } from "@realms-world/constants";
import { Button } from "@realms-world/ui";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shortenHex } from "@/utils/utils";
import { useAccount } from "@starknet-react/core";

import type { buttonVariants } from "@realms-world/ui";
import { Button, Badge } from "@realms-world/ui";
import { Button } from "@realms-world/ui";
import { Loader } from "lucide-react";

export const StarknetLoginButton = ({
Expand Down Expand Up @@ -55,7 +55,7 @@ export const StarknetLoginButton = ({
</span>
</span>
{(isConnected && newTransactionCount) && newTransactionCount > 0 ? <span
className={'bg-green-500 w-[20px] absolute -top-1.5 -right-1.5 rounded-full text-black-600'}
className={'bg-green-600 w-[20px] absolute -top-1.5 -right-1.5 rounded-full text-black'}
>{newTransactionCount}</span> : null}
</Button>
);
Expand Down
4 changes: 1 addition & 3 deletions apps/nextjs/src/app/_components/wallet/WalletSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ export const WalletSheet = () => {
const isStarknetWrongNetwork = isL2Connected &&
chainId !== undefined && BigInt(chainId) !== chain.id;


const { isAccountOpen, toggleAccount } = useUIStore((state) => state);



function usePrevious(isAccountOpen: boolean) {
const ref = useRef<boolean>();
useEffect(() => {
Expand All @@ -57,6 +54,7 @@ export const WalletSheet = () => {
}


//after user closes wallet sheet, reset transactions and transactioncount in localstorage
const previousAccountOpenState = usePrevious(isAccountOpen)
useEffect(() => {
if (isAccountOpen === false && previousAccountOpenState === true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useEffect } from "react";
export const QueryTransactionList = () => {
const { transactions } = useTransactions();
const transactionState = useStore(useTransactionManager, (state) => state);
// after useTransactions fires, update stored transactions in localstorage that useTransactions returns
useEffect(() => {
transactionState?.updateCombinedTransactions(transactions);
}, [transactions]);

Check warning on line 15 in apps/nextjs/src/app/_components/wallet/transactions/TransactionList.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'transactionState'. Either include it or remove the dependency array
Expand All @@ -26,6 +27,7 @@ export const QueryTransactionList = () => {


export const LocalStorageTransactionList = () => {
// if newTransactioncount is 0, use localstorage transactions instead
const { transactions } = useLocalStorageTransactions();
return (
<div className="mt-2 flex h-full w-full flex-grow flex-col border-b p-2">
Expand Down

0 comments on commit fdb7f54

Please sign in to comment.