Skip to content

Commit

Permalink
Merge pull request #97 from lunguyenhat/develop
Browse files Browse the repository at this point in the history
Tier2
  • Loading branch information
lunguyenhat authored Jul 14, 2023
2 parents 94909b7 + d54c66d commit 9531999
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Components/Consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ConsentComponent = ({ endpoint }: any) => {

const handleAgree = async () => {
try {
if (level > 1) {
if (level > 2) {
setLoading('connect');
const address = await provider.connect();
setLoading('sign');
Expand Down
19 changes: 16 additions & 3 deletions src/Components/Terms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,33 @@ const terms = [
logos: [aesirx],
},
{
level: 3,
level: 2,
tier: 'Tier 2',
name: 'AesirX WEB3 ID',
levelname: 'Medium',
content:
'Ideal for personalized online experiences & secure consent management across sessions & platforms.',
term: 'You consent to data use across multiple sess`ions.',
upgrade: 'Upgrade to Tier 3 Consent - High ',
upgradetext:
'& add on Wallet-Based Decentralized Consent to give explicit consent for data collection & processing for the most secure, private & personalized experience.',
logos: [aesirx, web3id],
},
{
level: 3,
tier: 'Tier 3',
name: 'Decentralized Wallet',
levelname: 'High',
content: 'Utilize your Web3 Wallet for greater control over your data.',
term: 'You consent for your data to be used, which can be revoked at any time you choose.',
upgrade: 'Upgrade to Tier 3 Consent - Super Advanced (our highest tier!)',
upgrade: 'Upgrade to Tier 4 Consent - Super Advanced (our highest tier!)',
upgradetext:
' & add on AesirX WEB3 ID to give explicit consent for data collection & processing for the most secure, private & personalized experience.',
logos: [aesirx, web3id],
},
{
level: 4,
tier: 'Tier 3',
tier: 'Tier 4',
name: 'Combined Wallet + AesirX WEB3 ID',
levelname: 'Super Advanced',
content:
Expand Down
8 changes: 5 additions & 3 deletions src/Hooks/useConsentStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const useConsentStatus = (endpoint?: string) => {
useEffect(() => {
(async () => {
try {
let l = 1;
let l = level;
const provider = await detectConcordiumProvider(100);

if (provider) {
Expand Down Expand Up @@ -80,15 +80,17 @@ const useConsentStatus = (endpoint?: string) => {
setWeb3ID(web3ID);
}
} catch (error) {
setLevel(1);
setLevel(level ?? 1);
console.error(error);
}
})();
}, [level]);

const handleLevel = useCallback(
async (_level: number) => {
if (_level === 3) {
if (_level === 2) {
setLevel(_level);
} else if (_level === 3) {
try {
await detectConcordiumProvider(100);
setLevel(_level);
Expand Down

0 comments on commit 9531999

Please sign in to comment.