From 37b174b1248d4eefff36c906fe568f5cff7a6035 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Mon, 15 Apr 2024 15:02:32 +0530 Subject: [PATCH] successErrorMessage: dynamic margin Signed-off-by: Shivam Purohit --- components/SuccessErrorMessage.tsx | 46 ++++++++++++++++++++++++------ views/Receive.tsx | 7 ++++- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/components/SuccessErrorMessage.tsx b/components/SuccessErrorMessage.tsx index b59bdd386..b772d3d02 100644 --- a/components/SuccessErrorMessage.tsx +++ b/components/SuccessErrorMessage.tsx @@ -9,6 +9,7 @@ interface MessageProps { mainStyle?: any; dismissable?: boolean; onPress?: () => void; + top: number; } const Message = ({ @@ -17,14 +18,20 @@ const Message = ({ link, mainStyle, dismissable, - onPress + onPress, + top }: MessageProps) => { const [isDismissed, setDismissed] = useState(false); if (isDismissed) return; return onPress ? ( {message} @@ -35,7 +42,12 @@ const Message = ({ onPress={() => setDismissed(true)} > {message} @@ -46,13 +58,25 @@ const Message = ({ onPress={() => UrlUtils.goToUrl(link)} > {message} ) : ( - + {message} ); @@ -63,7 +87,8 @@ const SuccessMessage = ({ fontSize, link, dismissable, - onPress + onPress, + top }: MessageProps) => ( ); @@ -80,7 +106,8 @@ const WarningMessage = ({ fontSize, link, dismissable, - onPress + onPress, + top }: MessageProps) => ( ); @@ -97,7 +125,8 @@ const ErrorMessage = ({ fontSize, link, dismissable, - onPress + onPress, + top }: MessageProps) => ( ); diff --git a/views/Receive.tsx b/views/Receive.tsx index ac102139b..e0304d3cc 100644 --- a/views/Receive.tsx +++ b/views/Receive.tsx @@ -1376,12 +1376,15 @@ export default class Receive extends React.Component< > {creatingInvoiceError && ( )} - {error_msg && } + {error_msg && ( + + )} {showLspSettings && ( @@ -1403,6 +1406,7 @@ export default class Receive extends React.Component< !!address && !belowDustLimit && (