Skip to content

Commit

Permalink
Merge branch 'feat/wallet-selector' into EVM
Browse files Browse the repository at this point in the history
  • Loading branch information
netpoe committed Nov 26, 2023
2 parents 5ba641b + 4b99088 commit 54e6ea6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 60 deletions.
5 changes: 0 additions & 5 deletions app/src/context/wallet-selector/WalletSelectorContext.ts

This file was deleted.

30 changes: 0 additions & 30 deletions app/src/context/wallet-selector/WalletSelectorContext.types.ts

This file was deleted.

This file was deleted.

9 changes: 2 additions & 7 deletions app/src/ui/pulse/prompt-input-card/PromptInputCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Field, Form as RFForm } from "react-final-form";
import { useState } from "react";
import { useTranslation } from "next-i18next";
import { useAccount } from "wagmi";
import { useNearWalletSelectorContext } from "context/near/wallet-selector/useNearWalletSelectorContext";

import { Card } from "ui/card/Card";
import { Typography } from "ui/typography/Typography";
Expand All @@ -17,6 +16,8 @@ import { useNearPromptWarsMarketContractContext } from "context/near/prompt-wars
import { PromptInputCardProps } from "./PromptInputCard.types";
import styles from "./PromptInputCard.module.scss";

const handleOnDisplayWidgetClick = () => undefined;

export const PromptInputCard: React.FC<PromptInputCardProps> = ({
onSubmit,
className,
Expand All @@ -26,18 +27,12 @@ export const PromptInputCard: React.FC<PromptInputCardProps> = ({
const [isNegativePromptFieldVisible, displayNegativePromptField] = useState(false);
const { isConnected } = useAccount();

const nearWalletSelectorContext = useNearWalletSelectorContext();

const { actions } = useNearPromptWarsMarketContractContext();

const { status, fees, collateralToken } = marketContractValues;

const isDisabled = status !== PromptWarsMarketContractStatus.OPEN;

const handleOnDisplayWidgetClick = () => {
nearWalletSelectorContext.modal?.show();
};

const { t } = useTranslation(["prompt-wars"]);

return (
Expand Down
3 changes: 1 addition & 2 deletions app/src/ui/wallet-selector/WalletSelector.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@
}

&__mobile {
margin-right: -$space-default;
margin-left: -$space-default;
display: block;

&--button {
width: 100%;
Expand Down
9 changes: 1 addition & 8 deletions app/src/ui/wallet-selector/WalletSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,19 @@ export const WalletSelector: React.FC<WalletSelectorProps> = ({ className }) =>
return (
<div className={clsx(styles["wallet-selector"], className)}>
<Button
// color={wallet.actions.isGettingGuestWallet ? "success" : "primary"}
color="primary"
variant="outlined"
onClick={handleOnDisplayWidgetClick}
rightIcon={<Icon name={address ? "icon-power" : "icon-power-crossed"} />}
className={styles["wallet-selector__button"]}
// animate={wallet.actions.isGettingGuestWallet ? "pulse" : undefined}
size="s"
>
{isConnected ? (
<Typography.Text inline truncate flat>
{address}
</Typography.Text>
) : (
<>
{/* {wallet.actions.isGettingGuestWallet
? t("promptWars.walletSelector.isSettingGuestWallet")
: t("promptWars.connectWallet")} */}
{t("promptWars.connectWallet")}
</>
<>{t("promptWars.connectWallet")}</>
)}
</Button>
</div>
Expand Down

0 comments on commit 54e6ea6

Please sign in to comment.