Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
KannuSingh committed Feb 19, 2025
1 parent 7eca001 commit 65c6562
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 177 deletions.
2 changes: 1 addition & 1 deletion advanced/dapps/smart-sessions-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"typescript": "^5",
"typescript-eslint": "^8.2.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ createAppKit({
defaultNetwork: baseSepolia,
projectId: ConstantsUtil.ProjectId,
features: {
email: true,
email: true,
socials: [],
emailShowWallets: false,
emailShowWallets: false,
analytics: true,
},
allWallets: 'HIDE',
allWallets: "HIDE",
themeMode: "light",
termsConditionsUrl: "https://reown.com/terms-of-service",
privacyPolicyUrl: "https://reown.com/privacy-policy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function DCAForm() {
const [isLoading, setLoading] = React.useState(false);
const isSupported = useMemo(
() => isSmartSessionSupported(),
[status, address]
[status, address],
);

const isWalletConnecting =
Expand All @@ -67,7 +67,7 @@ function DCAForm() {

const intervalInMilliseconds = calculateInterval(
strategyWithTimestamp.investmentInterval,
strategyWithTimestamp.intervalUnit
strategyWithTimestamp.intervalUnit,
);

const expirationTime =
Expand All @@ -79,7 +79,7 @@ function DCAForm() {
strategy={strategyWithTimestamp}
key={Date.now()}
/>,
{ duration: expirationTime - strategyWithTimestamp.createdTimestamp }
{ duration: expirationTime - strategyWithTimestamp.createdTimestamp },
);
} catch (e) {
toast("Error", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ function PositionSquare({
isAvailable?: boolean;
}) {
const isWinningSquare = gameState.winningLine?.includes(index);
const isDisabled = loading ||
!!gameState.board[index] ||
!!gameState.winner ||
!gameState.isXNext // Disable when it's not player's turn
const isDisabled =
loading ||
!!gameState.board[index] ||
!!gameState.winner ||
!gameState.isXNext; // Disable when it's not player's turn

const baseClasses = `
Expand All @@ -30,11 +31,11 @@ function PositionSquare({
rounded-lg
transition-all duration-200
relative
${isWinningSquare ? 'bg-yellow-50' : 'bg-gray-50'}
${!isDisabled && !gameState.board[index] ? 'hover:bg-gray-100 cursor-pointer' : 'cursor-not-allowed'}
${isAvailable ? 'bg-blue-50' : ''}
${isWinningSquare ? "bg-yellow-50" : "bg-gray-50"}
${!isDisabled && !gameState.board[index] ? "hover:bg-gray-100 cursor-pointer" : "cursor-not-allowed"}
${isAvailable ? "bg-blue-50" : ""}
border border-gray-200
${isDisabled && !gameState.board[index] ? 'text-gray-300' : 'text-gray-400'}
${isDisabled && !gameState.board[index] ? "text-gray-300" : "text-gray-400"}
`;

return (
Expand All @@ -45,29 +46,20 @@ function PositionSquare({
aria-label={`Square ${index + 1}`}
>
{!gameState.board[index] ? (
<span className="text-inherit">
{index + 1}
</span>
<span className="text-inherit">{index + 1}</span>
) : gameState.board[index] === "X" ? (
<Cross1Icon
width={32}
height={32}
className="text-green-500"
/>
<Cross1Icon width={32} height={32} className="text-green-500" />
) : (
<CircleIcon
width={32}
height={32}
className="text-red-500"
/>
<CircleIcon width={32} height={32} className="text-red-500" />
)}
</button>
);
}

export default React.memo(PositionSquare, (prevProps, nextProps) => {
return (
prevProps.gameState.board[prevProps.index] === nextProps.gameState.board[nextProps.index] &&
prevProps.gameState.board[prevProps.index] ===
nextProps.gameState.board[nextProps.index] &&
prevProps.loading === nextProps.loading &&
prevProps.isSystemThinking === nextProps.isSystemThinking &&
prevProps.isAvailable === nextProps.isAvailable &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ function TicTacToeInner() {
</CardHeader>
<CardContent className="p-4">
<p className="text-base text-gray-700 leading-relaxed">
Players take turns placing their marks in empty squares. The first to
align three marks in a row—vertically, horizontally, or diagonally—wins.
If all squares are filled and no one has three in a row, the game ends in
a tie.
Players take turns placing their marks in empty squares. The first
to align three marks in a row—vertically, horizontally, or
diagonally—wins. If all squares are filled and no one has three in a
row, the game ends in a tie.
</p>
</CardContent>
<CardFooter className="p-4 justify-center">
Expand Down Expand Up @@ -179,4 +179,4 @@ export default function TicTacToe() {

if (!hasMounted) return null;
return <TicTacToeInner />;
}
}
Loading

0 comments on commit 65c6562

Please sign in to comment.