Skip to content

Commit

Permalink
tax alert bottom sheet update
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunpandiaraja committed Oct 20, 2023
1 parent 23e9da3 commit 7a9dce2
Showing 4 changed files with 63 additions and 2 deletions.
22 changes: 20 additions & 2 deletions ui_components/home/Send.tsx
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ import { useWagmi } from "../../utils/wagmi/WagmiContext";
import ReactTyped from "react-typed";
import { createSafe } from "@instadapp/avocado";
import { Button } from "../shared";
import BottomSheet from "../bottom-sheet";
import { TaxAlertBottomSheet } from ".";

export interface ILoadChestComponent {
provider?: any;
@@ -62,7 +64,14 @@ export const SendTx: FC<ILoadChestComponent> = (props) => {
const [showActivity, setShowActivity] = useState(false);
const [chestLoadingText, setChestLoadingText] = useState("");
const [toAddress, setToAddress] = useState("");
const [openBottomSheet, setOpenBottomSheet] = useState(false);

const handleOpenBottomSheet = () => {
setOpenBottomSheet(true);
};
const handleCloseBottomSheet = () => {
setOpenBottomSheet(false);
};
const handleToggle = () => {
setToggle(!toggle);
};
@@ -165,7 +174,7 @@ export const SendTx: FC<ILoadChestComponent> = (props) => {
name="usdValue"
inputMode="decimal"
type="text"
className={`p-3 heading3_bold border border-secondary-700 bg-transparent placeholder-grey rounded-xl block w-full focus:outline-none focus:ring-transparent`}
className={`p-3 heading3_bold border border-secondary-700 bg-transparent placeholder-grey rounded-xl block w-full focus:outline-none focus:ring-transparent`}
placeholder="$0"
value={value}
onChange={(e) => {
@@ -230,12 +239,13 @@ export const SendTx: FC<ILoadChestComponent> = (props) => {
<input
type="text"
id="first_name"
className="border border-secondary-100 text-gray-900 text-sm rounded-lg block w-full p-3"
className=" border border-secondary-700 text-gray-900 text-sm rounded-xl placeholder-grey block w-full p-3 focus:outline-none focus:ring-transparent"
placeholder="Enter recipient address"
value={toAddress}
onChange={(e) => {
setToAddress(e.target.value);
}}
// onClick={handleOpenBottomSheet}
/>
</div>
</>
@@ -264,6 +274,14 @@ export const SendTx: FC<ILoadChestComponent> = (props) => {
/>
</div>
</div>
<BottomSheet
isOpen={openBottomSheet}
onClose={() => {
setOpenBottomSheet(false);
}}
>
<TaxAlertBottomSheet handleCloseBottomSheet={handleCloseBottomSheet} />
</BottomSheet>
</div>
);
};
37 changes: 37 additions & 0 deletions ui_components/home/TaxAlertBottomSheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { icons } from "../../utils/images";

import Image from "next/image";
import { Button } from "../shared";

export default function TaxAlertBottomSheet(props: any) {
const { handleCloseBottomSheet } = props;
return (
<div className="px-4 py-5">
<div className="flex items-center justify-between mb-5">
<p className="paragraph_semibold text-text-900">Tax alert</p>
<Image
onClick={handleCloseBottomSheet}
src={icons.close}
alt="close"
className="cursor-pointer"
/>
</div>
<p className="supportText_regular text-text-500 mb-9">
Your transaction amount exceeds ₹10,000. A 10% tax will be applied to
all transactions above ₹10,000.
</p>
<div className="flex items-center justify-between gap-4">
<Button
className={`!rounded-full !text-base !w-[388px] mx-auto py-2`}
variant={"ghost"}
label="Cancel"
/>
<Button
className={`!bg-purple !rounded-full !text-base !w-[388px] mx-auto py-2`}
variant={"primary"}
label="Continue"
/>
</div>
</div>
);
}
2 changes: 2 additions & 0 deletions ui_components/home/index.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import TokenListItem from "./TokenListItem";
import ActivitiesListItem from "./ActivitiesListItem";
import KYCStatus from "./KYCStatus";
import ReceiveQR from "./ReceiveQR";
import TaxAlertBottomSheet from "./TaxAlertBottomSheet";

export {
WalletActionCard,
@@ -14,4 +15,5 @@ export {
ActivitiesListItem,
KYCStatus,
ReceiveQR,
TaxAlertBottomSheet,
};
4 changes: 4 additions & 0 deletions ui_components/shared/Button.tsx
Original file line number Diff line number Diff line change
@@ -31,6 +31,10 @@ const Button: FC<IButtonProps> = ({
variant === "primary"
? "bg-white text-secondary-100 font-bold text-sm"
: ""
} ${
variant === "ghost"
? "bg-transparent text-text-900 font-semibold text-base border border-purple"
: ""
} ${className ? className : ""}`}
disabled={disabled}
onClick={onClick}

0 comments on commit 7a9dce2

Please sign in to comment.