Skip to content

Commit

Permalink
fix(ui-ux): fix stucked success copy message (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada authored Mar 6, 2023
1 parent ddac426 commit af7490e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions apps/web/src/components/QrAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QRCode from "react-qr-code";
import clsx from "clsx";
import { PropsWithChildren, useState } from "react";
import { PropsWithChildren, useEffect, useState } from "react";
import useCopyToClipboard from "@hooks/useCopyToClipboard";
import Tooltip from "@components/commons/Tooltip";

Expand Down Expand Up @@ -42,6 +42,12 @@ export default function QrAddress({
setShowSuccessCopy(true);
};

useEffect(() => {
if (showSuccessCopy) {
setTimeout(() => setShowSuccessCopy(false), 2000);
}
}, [showSuccessCopy]);

return (
<div className="w-[164px]">
<SuccessCopy
Expand All @@ -59,7 +65,7 @@ export default function QrAddress({
<button
type="button"
className={clsx(
"text-dark-700 text-left break-all focus-visible:outline-none text-center mt-2",
"text-dark-700 break-all focus-visible:outline-none text-center mt-2",
"text-xs cursor-pointer hover:underline"
)}
onClick={() => handleOnCopy(dfcUniqueAddress)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default function StepThreeVerification({
{dfcAddress && (
<div
className={clsx(
"max-w-max mx-auto flex flex-row order-1 mt-6 justify-start border-[0.5px] border-dark-200 rounded",
"relative max-w-max mx-auto flex flex-row order-1 mt-6 justify-start border-[0.5px] border-dark-200 rounded",
"md:w-2/5 md:flex-col md:shrink-0 md:order-none px-6 pt-6 pb-3 md:mt-0"
)}
>
Expand Down

0 comments on commit af7490e

Please sign in to comment.