Skip to content

Commit 1a8d66e

Browse files
committed
fix: style error message
1 parent 84605c6 commit 1a8d66e

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,19 @@ import { wrapWithToast } from "utils/wrapWithToast";
2525
import { ethAddressPattern } from "utils/validateAddress";
2626
import { useQueryRefetch } from "hooks/useQueryRefetch";
2727
import { useNavigateAndScrollTop } from "hooks/useNavigateAndScrollTop";
28+
import ClosedCircleIcon from "components/StyledIcons/ClosedCircleIcon";
2829

2930
const StyledButton = styled(Button)``;
3031

32+
const ErrorMessage = styled.div`
33+
display: flex;
34+
align-items: center;
35+
gap: 12px;
36+
justify-content: center;
37+
margin: 4px;
38+
color: ${({ theme }) => theme.error};
39+
`;
40+
3141
const DepositPaymentButton: React.FC = () => {
3242
const {
3343
escrowTitle,
@@ -174,15 +184,16 @@ const DepositPaymentButton: React.FC = () => {
174184
};
175185

176186
return (
177-
<>
187+
<div>
178188
<StyledButton
179189
isLoading={isSending}
180190
disabled={isSending || !!error}
191+
tooltip={error}
181192
text={isNativeTransaction || isApproved ? "Deposit the Payment" : "Approve Token"}
182193
onClick={isNativeTransaction || isApproved ? handleCreateTransaction : handleApproveToken}
183194
/>
184-
<p>{error}</p>
185-
</>
195+
{error ? <ErrorMessage><ClosedCircleIcon /> {error}</ErrorMessage> : null}
196+
</div>
186197
);
187198
};
188199

0 commit comments

Comments
 (0)