From d4caee6e017d7506778467d5764a4cc38bc6fa7c Mon Sep 17 00:00:00 2001 From: Leo Joseph <58416454+rleojoseph@users.noreply.github.com> Date: Wed, 15 Mar 2023 16:11:42 +0900 Subject: [PATCH] [No Ticket] UniqueID Interface changes in sample app (#245) * UniqueID Interface changes * Prettier --- js-miniapp-sample/src/pages/uuid-sdk.js | 62 +++++++++++++++++-- .../src/services/uuid/actions.js | 22 ++++++- .../src/services/uuid/reducers.js | 17 +++++ js-miniapp-sample/src/services/uuid/types.js | 4 ++ 4 files changed, 100 insertions(+), 5 deletions(-) diff --git a/js-miniapp-sample/src/pages/uuid-sdk.js b/js-miniapp-sample/src/pages/uuid-sdk.js index 0c8bc144d..f8d304047 100644 --- a/js-miniapp-sample/src/pages/uuid-sdk.js +++ b/js-miniapp-sample/src/pages/uuid-sdk.js @@ -11,16 +11,21 @@ import { CopyToClipboard } from 'react-copy-to-clipboard'; import { connect } from 'react-redux'; import GreyCard from '../components/GreyCard'; -import { setMessagingUniqueId, setMauid } from '../services/uuid/actions'; +import { + setMessagingUniqueId, + setMauid, + setUniqueId, +} from '../services/uuid/actions'; const useStyles = makeStyles((theme) => ({ card: { width: '100%', - height: '250px', + height: 'auto', marginTop: '40px', + display: 'grid', }, content: { - height: '16%', + height: 'auto', justifyContent: 'center', display: 'flex', flexDirection: 'column', @@ -39,10 +44,13 @@ const useStyles = makeStyles((theme) => ({ })); type UUIDProps = { + uniqueId: string, messagingUniqueId: string, mauid: string, + uniqueIdError: string, messagingUniqueIdError: string, mauidError: string, + getUniqueId: Function, getMessagingUniqueId: Function, getMauid: Function, }; @@ -64,12 +72,55 @@ const UuidFetcher = (props: UUIDProps) => { return ( + + {props.uniqueId ?? props.uniqueIdError ?? 'Not Available'} + + + + + + + { + setCopyStatus({ success: false, error: false }); + }} + message="Copied to clipboard !!" + /> + { + setCopyStatus({ success: false, error: false }); + }} + message="Failed to copy!" + /> + {props.messagingUniqueId ?? props.messagingUniqueIdError ?? 'Not Available'} -