Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 #8

Merged
merged 57 commits into from
Nov 19, 2022
Merged

v1 #8

Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1c5d6c9
vercel tab animation
zkSoju Nov 14, 2022
a3de88d
add decimals to mint
zkSoju Nov 14, 2022
b2ce233
useBalance hook
zkSoju Nov 14, 2022
931c1ad
fix padding
zkSoju Nov 14, 2022
37856d4
wip setup l2 sync
zkSoju Nov 14, 2022
47305f2
hardcode lz fees and chainid
zkSoju Nov 14, 2022
458b843
add l1 sync hooks
zkSoju Nov 14, 2022
aab034a
equal size tabs
zkSoju Nov 14, 2022
05ddf8e
cap at 6 decimals
zkSoju Nov 14, 2022
099ab60
Update InteractButton.tsx
zkSoju Nov 14, 2022
85f7fc3
add insufficient balance error handling
zkSoju Nov 14, 2022
ae5bbca
add error handling to swap tab
zkSoju Nov 14, 2022
ff9f70a
dove supremacy
zkSoju Nov 14, 2022
80adc06
hide slider on mouse leave
zkSoju Nov 14, 2022
641a7aa
damm:provide: adapats amount0/1 depending on the other
exp-table Nov 14, 2022
2e9b32e
damm: providing liquidity works
exp-table Nov 14, 2022
0a1ff31
damm:withdraw: halfway
exp-table Nov 14, 2022
c4c40bc
fix types ?
zkSoju Nov 14, 2022
2933814
damm: display correct reserves
exp-table Nov 14, 2022
640027d
damm: withdraw hook + function works
exp-table Nov 14, 2022
6142b1d
amm: supports swapping
exp-table Nov 15, 2022
f711bff
amm: burn vouchers tab
exp-table Nov 15, 2022
695b6ef
useApproveToken hook and use BigNumberish for hooks (#2)
zkSoju Nov 15, 2022
27b8c3e
Update SwapTabContent.tsx
zkSoju Nov 15, 2022
df7a17d
fix stirng | number ambiguity
exp-table Nov 15, 2022
af218a8
Fixed input with balance + renamed useAMM + WIP for correct LP withdr…
exp-table Nov 15, 2022
a3c4c42
damm: withdrawing handles decimals
exp-table Nov 15, 2022
f0d657f
fix swap tokens and approvals
zkSoju Nov 15, 2022
90a7f6d
hide approval if no amount entered
zkSoju Nov 15, 2022
165b292
toast + trigger toast for core hooks
zkSoju Nov 16, 2022
83bfea3
fixed swap inversion
exp-table Nov 16, 2022
c7262b7
voucher toast + watch for new blocks
zkSoju Nov 16, 2022
eec0930
add block explorer redirect for toast
zkSoju Nov 16, 2022
5fb267f
shorten toast msg
zkSoju Nov 16, 2022
ec25c76
polygon amm replacing avax
exp-table Nov 16, 2022
aa6444d
bug executes swap auto
exp-table Nov 16, 2022
ca81759
updated wagmi and rainbowkit version
exp-table Nov 16, 2022
2d27dea
add sdk entities (#3)
zkSoju Nov 16, 2022
0979525
Burn sync check
exp-table Nov 16, 2022
a8835b3
added reserves for amm
exp-table Nov 17, 2022
6f1accd
Merge pull request #5 from exp-table/polygon
exp-table Nov 17, 2022
5e1515f
temporary convert wrapper for vouchers burn
exp-table Nov 17, 2022
6fb51d0
amm: shows available marked tokens on damm
exp-table Nov 17, 2022
4ec5ba7
updated contracts.ts
exp-table Nov 17, 2022
e9c688b
Overhaul state and hooks with SDK types/constants and zustand (#4)
zkSoju Nov 18, 2022
8004e94
clear fields after chain change
zkSoju Nov 18, 2022
26b20c2
don't need to format independent fields
zkSoju Nov 18, 2022
4770990
fix withdraw field
zkSoju Nov 18, 2022
cbfdd6d
Make callback hooks async and trigger toasts (#6)
zkSoju Nov 19, 2022
f3b5a07
view virt reserves from any tab
zkSoju Nov 19, 2022
0dc02f1
Merge branch 'damn-hooks' of https://github.com/exp-table/damm-fronte…
zkSoju Nov 19, 2022
0d7d200
swap: hardcode routing to match swap args
zkSoju Nov 19, 2022
b21e404
restyle
zkSoju Nov 19, 2022
eb7ce80
advance slider
zkSoju Nov 19, 2022
591cbb6
Update globals.css
zkSoju Nov 19, 2022
b820019
move tabs
zkSoju Nov 19, 2022
2d0f445
Single tab (#7)
zkSoju Nov 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update InteractButton.tsx
  • Loading branch information
zkSoju committed Nov 14, 2022
commit 099ab60270269f1d8e461dc7dc7d5b34bfb5ffbf
25 changes: 16 additions & 9 deletions components/InteractButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,32 @@ const InteractButton = ({
text,
expectedChainId,
onClick,
error = undefined,
}: {
text: string;
expectedChainId: number;
error?: string;
onClick: () => void;
}) => {
const { address } = useAccount();
const { chain } = useNetwork();

return (
<>
{address ? (
chain?.id === expectedChainId ? (
<Button onClick={onClick} text={text} />
) : (
<Button disabled text="Wrong Network" />
)
) : (
<InteractConnectButton />
)}
{(() => {
if (address) {
if (chain?.id !== expectedChainId) {
return <Button disabled text="Wrong Network" />;
}
if (error) {
return <Button disabled text={error} />;
}

return <Button onClick={onClick} text={text} />;
} else {
return <CustomConnectButton />;
}
})()}
</>
);
};
Expand Down