Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Nov 24, 2023
1 parent 51697c2 commit 1f3fffc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/react-kit/src/components/wallet/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ export default function ConnectButton({
account && Sentry.setTag("wallet_address", account?.address);

return (
<div
style={{ display: "flex", gap: 12, padding: "10px 0" }}
{...rest}
>
<div style={{ display: "flex", gap: 12 }} {...rest}>
<InnerProvider>
<InnerContext.Consumer>
{({ isMagicLoggedIn, chainId, globalAccount, disconnect }) => {
Expand Down
4 changes: 4 additions & 0 deletions packages/react-kit/src/components/widgets/finance/Finance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ export default function Finance({
);
}, [pageCount, pageIndex]);

if (!address) {
return <p style={{ textAlign: "center" }}>Please connect your wallet</p>;
}

if (!isFundsInitialized || isLoadingSellerData || isLoadingExchangesTokens) {
return <Loading />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ import { useDisconnect } from "../../../hooks/connection/useDisconnect";
import { ethers } from "ethers";
dayjs.extend(isBetween);

const StyledConnectButton = styled(ConnectButton)`
padding: 10px;
`;

const Wrapper = styled.div`
text-align: center;
`;
Expand Down Expand Up @@ -92,6 +96,13 @@ function WithSellerData(WrappedComponent: React.ComponentType<Props>) {
</Wrapper>
);
}
if (address && !sellerIdToUse) {
return (
<p style={{ textAlign: "center" }}>
Connect a wallet that has a seller account
</p>
);
}
const forcedAccount =
sellerId && !sellerRoles.isAssistant ? seller?.assistant : "";
if (
Expand Down Expand Up @@ -171,7 +182,7 @@ export function FinanceWidget({
<ModalProvider>
{!parentOrigin && (
<Grid justifyContent="flex-end">
<ConnectButton showChangeWallet />
<StyledConnectButton showChangeWallet />
</Grid>
)}
<Component sellerId={sellerId ?? undefined} />
Expand Down

0 comments on commit 1f3fffc

Please sign in to comment.