Skip to content

Commit

Permalink
chore: update bitname to lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
itttm127 authored and reinamora137 committed Jan 17, 2025
1 parent ae44f3b commit 830a5e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
6 changes: 0 additions & 6 deletions islands/stamp/details/StampInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ interface DimensionsType {
}

export function StampInfo({ stamp, lowestPriceDispenser }: StampInfoProps) {
console.log("StampInfo received stamp:", {
stamp_mimetype: stamp.stamp_mimetype,
stamp_url: stamp.stamp_url,
full_stamp: stamp,
});

const [fee, setFee] = useState<number>(0);
const handleChangeFee = (newFee: number) => {
setFee(newFee);
Expand Down
17 changes: 10 additions & 7 deletions islands/stamping/src101/register/RegisterContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function RegisterBitnameContent({
const [tosAgreed, setTosAgreed] = useState<boolean>(false);
const { wallet } = walletContext;
const [isExist, setIsExist] = useState(true);
const [checkStatus, setCheckStatus] = useState(false);
const [isOpen, setIsOpen] = useState<boolean>(false);
const [modalData, setModalData] = useState<SRC101Balance | null>(null);

Expand All @@ -74,14 +75,15 @@ export function RegisterBitnameContent({
};

const checkAvailability = async (): Promise<boolean> => {
setCheckStatus(false);
try {
const url =
`/api/v2/src101/77fb147b72a551cf1e2f0b37dccf9982a1c25623a7fe8b4d5efaac566cf63fed/${
btoa(formState.toAddress.replace(".btc", ""))
btoa(formState.toAddress?.toLowerCase().replace(".btc", ""))
}`;
const res = await fetch(url);
const jsonData = await res.json();

setCheckStatus(true);
if (res.status === 200) {
if (jsonData?.data.length) {
setIsExist(true);
Expand Down Expand Up @@ -113,10 +115,11 @@ export function RegisterBitnameContent({
placeholder="Please input your bitname"
value={formState.toAddress?.replace(".btc", "") || ""}
onChange={(e) => {
const value = (e.target as HTMLInputElement).value.replace(
".btc",
"",
);
const value = (e.target as HTMLInputElement).value.toLowerCase()
.replace(
".btc",
"",
);
handleInputChange(
{
target: {
Expand All @@ -138,7 +141,7 @@ export function RegisterBitnameContent({
<div className="flex flex-col justify-center items-start">
{/* message - default:noDisplay / display on user input & onClick - either already registered or available */}
<p className="text-sm mobileLg:text-base font-medium text-[#999999]">
{formState.toAddress
{formState.toAddress && checkStatus
? isExist
? `${formState.toAddress} is already registered`
: `${formState.toAddress} is available`
Expand Down

0 comments on commit 830a5e3

Please sign in to comment.