Skip to content

Commit

Permalink
fixed merge conflicts and renamed exports (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikestarrdev authored Sep 6, 2023
1 parent b914098 commit 839a905
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
4 changes: 1 addition & 3 deletions src/features/common/LineBreak.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { twJoin } from "tailwind-merge";
interface LineBreakProps {
className?: string;
}
const LineBreak: FC<LineBreakProps> = ({ className }) => {
export const LineBreak: FC<LineBreakProps> = ({ className }) => {
return (
<hr
className={twJoin([
Expand All @@ -14,5 +14,3 @@ const LineBreak: FC<LineBreakProps> = ({ className }) => {
/>
);
};

export default LineBreak;
2 changes: 1 addition & 1 deletion src/features/staking/StakeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { twJoin } from "tailwind-merge";
import { useAccount, useNetwork } from "wagmi";
import { useTokenBalances } from "../../hooks/useTokenBalances";
import { Button } from "../common/Button";
import StakingModal from "./StakingModal";
import { StakingModal } from "./StakingModal";

export const StakeButton = ({}: {}) => {
const { address, isConnected } = useAccount();
Expand Down
7 changes: 2 additions & 5 deletions src/features/staking/StakingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { FC, RefObject, useState } from "react";
import { useForm } from "react-hook-form";
import { ImSpinner8 } from "react-icons/im";
import { VscChromeClose } from "react-icons/vsc";
import { useForm } from "react-hook-form";
import { twJoin } from "tailwind-merge";
import { useTokenBalances } from "../../hooks/useTokenBalances";
import { Button } from "../common/Button";
import { useApproveAst } from "./hooks/useApproveAst";
import { useAstAllowance } from "./hooks/useAstAllowance";
import { useStakeAst } from "./hooks/useStakeAst";
import { useUnstakeSast } from "./hooks/useUnstakeSast";
import ApproveSuccess from "./subcomponents/ApproveSuccess";
import { ApproveSuccess } from "./subcomponents/ApproveSuccess";
import { ManageStake } from "./subcomponents/ManageStake";
import { StakeOrUnstake } from "./types/StakingTypes";
import {
Expand All @@ -25,7 +24,7 @@ interface StakingModalInterface {
chainId: number;
}

const StakingModal: FC<StakingModalInterface> = ({
export const StakingModal: FC<StakingModalInterface> = ({
stakingModalRef,
chainId,
}) => {
Expand Down Expand Up @@ -172,5 +171,3 @@ const StakingModal: FC<StakingModalInterface> = ({
</dialog>
);
};

export default StakingModal;
4 changes: 1 addition & 3 deletions src/features/staking/subcomponents/ApproveSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ApproveSuccessProps {
transactionHashUnstake?: string | undefined;
}

const ApproveSuccess: FC<ApproveSuccessProps> = ({
export const ApproveSuccess: FC<ApproveSuccessProps> = ({
stakeOrUnstake,
amount,
chainId,
Expand Down Expand Up @@ -61,5 +61,3 @@ const ApproveSuccess: FC<ApproveSuccessProps> = ({
</div>
);
};

export default ApproveSuccess;
8 changes: 4 additions & 4 deletions src/features/staking/subcomponents/ManageStake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { twJoin } from "tailwind-merge";
import AirSwapLogo from "../../../assets/airswap-logo.svg";
import { useTokenBalances } from "../../../hooks/useTokenBalances";
import { Button } from "../../common/Button";
import LineBreak from "../../common/LineBreak";
import { LineBreak } from "../../common/LineBreak";
import { StakeOrUnstake, Status } from "../types/StakingTypes";
import { StakableBar } from "./StakableBar";
import { NumberInput } from "./NumberInput";
import { StakableBar } from "./StakableBar";

interface ManageStakeProps {
formReturn: UseFormReturn<FieldValues>;
Expand Down Expand Up @@ -71,7 +71,7 @@ export const ManageStake: FC<ManageStakeProps> = ({
<div className="flex flex-col text-right uppercase">
<div>
<NumberInput
astBalance={astBalance}
astBalance={astBalance.toString()}
formReturn={formReturn}
name="stakingAmount"
/>
Expand All @@ -81,4 +81,4 @@ export const ManageStake: FC<ManageStakeProps> = ({
</div>
</>
);
};
};
5 changes: 2 additions & 3 deletions src/features/staking/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UseFormSetValue } from "react-hook-form";
import { FieldValues, UseFormSetValue } from "react-hook-form";
import { WriteContractResult } from "wagmi/actions";
import { StakeOrUnstake, Status } from "../types/StakingTypes";

Expand Down Expand Up @@ -60,7 +60,6 @@ export const buttonLoadingSpinner = ({
}
};

// TODO: fix this
export const modalHeadline = ({
statusStake,
statusUnstake,
Expand Down Expand Up @@ -112,7 +111,7 @@ export const handleButtonActions = ({
approve: (() => Promise<WriteContractResult>) | undefined;
stake: (() => void) | undefined;
unstake: (() => void) | undefined;
setValue: UseFormSetValue<{ stakingAmount: number }>;
setValue: UseFormSetValue<FieldValues>;
}) => {
const stakeMode = stakeOrUnstake === StakeOrUnstake.STAKE;

Expand Down

0 comments on commit 839a905

Please sign in to comment.