Skip to content

Commit

Permalink
Merge pull request #219 from aesirxio/develop
Browse files Browse the repository at this point in the history
Deploy to master
  • Loading branch information
NguyenBao10 authored Jul 12, 2024
2 parents 896c9f4 + d7d8418 commit 87df9b5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"socket.io-client": "^4.7.2",
"viem": "^1.0.0",
"bowser": "^2.11.0",
"wagmi": "^1.4.13",
"wagmi": "^1.3.2",
"yup": "^1.3.2"
},
"tsup": {
Expand Down
9 changes: 8 additions & 1 deletion src/SSOButton/Providers/Concordium/sign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,15 @@ const SignMessageConcordium = ({
const nationality: string =
accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes
?.nationality;
const countryOfResidence: string =
accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes
?.countryOfResidence;
if (!nationality) {
statement[0].attributeTag = 'countryOfResidence';
if (countryOfResidence) {
statement[0].attributeTag = 'countryOfResidence';
} else {
statement[0].attributeTag = 'idDocIssuer';
}
}
const proof = await provider.requestIdProof(account ?? '', statement, challenge);
const re = await verifyProof(challenge, proof);
Expand Down
28 changes: 26 additions & 2 deletions src/SSOButton/Providers/CreateAccount/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ const CreateAccount = ({
isRequireEmail,
hideDefaultProduct = false,
isRequireConcordium = false,
alertButton = {
isShow: false,
handleClick: undefined,
alertWarning: undefined,
},
}: any) => {
const [sending, setSending] = useState(false);
const [captcha, setCaptcha] = useState<any>();
Expand Down Expand Up @@ -428,8 +433,15 @@ const CreateAccount = ({
const nationality: string =
accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes
?.nationality;
const countryOfResidence: string =
accountInfo?.accountCredentials[0]?.value?.contents?.commitments?.cmmAttributes
?.countryOfResidence;
if (!nationality) {
statement[0].attributeTag = 'countryOfResidence';
if (countryOfResidence) {
statement[0].attributeTag = 'countryOfResidence';
} else {
statement[0].attributeTag = 'idDocIssuer';
}
}
const proof = await provider.requestIdProof(
walletState?.accountAddress ?? '',
Expand Down Expand Up @@ -595,7 +607,10 @@ const CreateAccount = ({
);
})}
</Row>
<p className="fst-italic mb-3 fs-7">Disclaimer : The ID @Username is public</p>
<p className="fst-italic mb-3 fs-7">
Disclaimer: The ID @Username is public and helps anonymize and pseudonymize data to
protect your privacy.
</p>
<Form.Check className="mb-10px fs-7" type="checkbox" id="check-subsribe">
<Form.Check.Input type="checkbox" required />
<Form.Check.Label>
Expand Down Expand Up @@ -685,6 +700,14 @@ const CreateAccount = ({
>
{sending ? 'Sending' : 'Send inquiry'}
</Button>
) : alertButton?.isShow && alertButton?.handleClick ? (
<Button
onClick={alertButton?.handleClick}
variant="success"
className="fw-semibold text-white px-4 py-13px lh-sm w-100"
>
Send inquiry
</Button>
) : (
<div key={product?.sku}>
<Button
Expand Down Expand Up @@ -728,6 +751,7 @@ const CreateAccount = ({
</Button>
</div>
)}
{alertButton?.alertWarning && alertButton?.alertWarning}
</>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/SSOConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { Col, Row } from 'react-bootstrap';
import Concordium from './Concordium';
import { useUserContext, UserContextProvider } from '../SSOButton/Providers/user';
import MetaMask from './MetaMask';
import { useGlobalContext, GlobalContextProvider } from '../SSOButton/Providers/global';
import { connectWallet, removeWallet } from '../utils/index';
import DeleteModal from './DeleteModal';
Expand All @@ -13,6 +12,7 @@ import Social from './Social';
import Web3ContextProvider from '../SSOButton/Providers/web3';
import { Spinner } from '../components/Spinner';
import { notify } from '../components/Toast';
const MetaMask = React.lazy(() => import('./MetaMask'));

const SSO = () => {
return (
Expand Down

0 comments on commit 87df9b5

Please sign in to comment.