Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Update GoodID and claim flow #128

Open
wants to merge 180 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
6306783
add: goodid credentials db and veramo types
L03TJ3 Feb 21, 2024
395fc47
add goodid context and (wip) credentials hook
L03TJ3 Feb 21, 2024
e514376
add: story example for goodid
L03TJ3 Feb 21, 2024
eaec88e
fix: veramo types for next packages
L03TJ3 Feb 21, 2024
3713ae5
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Feb 23, 2024
2b492fa
fix: use outbound key as primary
L03TJ3 Feb 27, 2024
7c03881
use updated expected credential schema types
L03TJ3 Feb 27, 2024
681a6dd
use put instead of add for creating credential
L03TJ3 Mar 5, 2024
eeebaa0
add: deleteCredential
L03TJ3 Mar 5, 2024
4939576
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Mar 10, 2024
f050787
update context with react prop types
L03TJ3 Mar 10, 2024
05beb0f
remove no longer needed test resolver
L03TJ3 Mar 10, 2024
6b2e78e
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Mar 12, 2024
0d1bb39
define new db schema using certificates definition
L03TJ3 Mar 12, 2024
38dfe5a
- update to certificates hook to match naming/db schema
L03TJ3 Mar 12, 2024
3922e30
Update GoodId context to new hook/types
L03TJ3 Mar 12, 2024
7193179
update goodid story, yarn lock
L03TJ3 Mar 12, 2024
8b322ef
remove veramo deps and references
L03TJ3 Mar 12, 2024
3c97722
add: use simple certificates table collection
L03TJ3 Mar 12, 2024
c752b38
update certificate schema / use of multiEntryIndex
L03TJ3 Mar 12, 2024
5f9925c
wip: apply suggested changes
L03TJ3 Mar 14, 2024
5265c8a
Revert "wip: apply suggested changes"
L03TJ3 Mar 15, 2024
23e64cd
apply exact solution
L03TJ3 Mar 15, 2024
397fabc
remove not used story
L03TJ3 Mar 15, 2024
51d034d
Update packages/sdk-v2/src/sdk/goodid/hooks/useCertificates.ts
johnsmith-gooddollar Mar 15, 2024
bddc880
Update packages/sdk-v2/src/sdk/goodid/db/createDb.ts
johnsmith-gooddollar Mar 15, 2024
6fc954a
add missing schema update after revert
L03TJ3 Mar 15, 2024
7c53df7
Create CertificatesExample.stories.tsx
johnsmith-gooddollar Mar 15, 2024
26e1ea0
Merge branch '116-credential-storage' of github.com:GoodDollar/GoodWe…
L03TJ3 Mar 15, 2024
a4e4869
Update packages/sdk-v2/src/sdk/goodid/hooks/useCertificates.ts
johnsmith-gooddollar Mar 15, 2024
d4c5fa0
Update packages/sdk-v2/src/stories/goodid/CertificatesExample.stories…
johnsmith-gooddollar Mar 15, 2024
cd6a12e
final implementation, updated storybook
johnsmith-gooddollar Mar 15, 2024
db41581
Merge branch '116-credential-storage' of github.com:GoodDollar/GoodWe…
L03TJ3 Mar 20, 2024
f9969ad
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Mar 20, 2024
4071a47
fix: types and story delete flow
L03TJ3 Mar 20, 2024
c241aee
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Mar 20, 2024
bc0b729
116 goodid card (#129)
L03TJ3 Mar 20, 2024
833572e
remove unused deps/resolutions
L03TJ3 Mar 21, 2024
83d1935
apply pr suggestions
L03TJ3 Mar 21, 2024
c65ed8e
Apply suggestions from code review
johnsmith-gooddollar Mar 22, 2024
c113083
fix: lock
L03TJ3 Mar 26, 2024
072faa2
chore: align ctix quote with eslint
L03TJ3 Mar 26, 2024
e92d61e
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Mar 26, 2024
a0d1b07
fix: goodid card labels
L03TJ3 Mar 26, 2024
81e9236
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Mar 28, 2024
ef3d45e
add show all types in useAggregatedCertificates
johnsmith-gooddollar Mar 29, 2024
86a8cee
fix: yarn lock
L03TJ3 Apr 2, 2024
ce8aac6
fix: yarn.lock
L03TJ3 Apr 2, 2024
71f4835
type fix
L03TJ3 Apr 2, 2024
054ca0b
115 onboard screen (#130)
L03TJ3 Apr 2, 2024
ad7d86e
fix: type
L03TJ3 Apr 3, 2024
239667e
wip: aggregated certificates hook for goodid card
L03TJ3 Apr 3, 2024
095a36f
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Apr 8, 2024
fa333cf
fix: sdk-v2 self dependency
L03TJ3 Apr 10, 2024
7631248
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Apr 10, 2024
d7a00e6
fix: lock
L03TJ3 Apr 10, 2024
efea670
Dev version beta.d7a00e6 released
L03TJ3 Apr 10, 2024
12a766c
trigger vercel deployment
L03TJ3 Apr 10, 2024
dbe713b
wip: test sdk-v2 build:release for beta package
L03TJ3 Apr 10, 2024
a5fd111
Dev version beta.dbe713b released
L03TJ3 Apr 10, 2024
dd8ebb5
trigger vercel deployment
L03TJ3 Apr 11, 2024
3a778e2
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Apr 15, 2024
9c05cd6
[GoodID] 122 Redtent Offer (#141)
sirpy Apr 15, 2024
efda7af
fix: lock
L03TJ3 Apr 15, 2024
fc9ba26
Dev version beta.efda7af released
L03TJ3 Apr 15, 2024
1264168
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Apr 17, 2024
813b5f1
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Apr 18, 2024
5ff8bdb
fix: yarn.lock
L03TJ3 Apr 18, 2024
349c906
122: redtent UI (#148)
L03TJ3 Apr 25, 2024
2c55f4c
fix: yarnlock
L03TJ3 Apr 25, 2024
c3f844b
Dev version beta.2c55f4c released
L03TJ3 Apr 25, 2024
5730cb5
117 segmentation (#136)
L03TJ3 Apr 29, 2024
c7ba600
fix: circular deps, fix: exports for good-id components
L03TJ3 May 6, 2024
f8f20a4
Dev version beta.c7ba600 released
L03TJ3 May 6, 2024
c4682c7
fix: broken sdk-v2 dev release, revert to previous
L03TJ3 May 6, 2024
46e3b1e
152 segmentation dispute (#154)
L03TJ3 May 17, 2024
245950a
124 check available offers (#158)
L03TJ3 May 17, 2024
201d7d7
155 onboard changes (#167)
L03TJ3 Jun 10, 2024
04a2c90
Dev version beta.201d7d7 released
L03TJ3 Jun 10, 2024
2a595b9
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Jun 25, 2024
954e157
fix: verify unique modal (dapp)
L03TJ3 Jun 26, 2024
83c0986
Dev version beta.954e157 released
L03TJ3 Jun 26, 2024
916d09c
145: goodid details (#169)
L03TJ3 Jul 2, 2024
36c2495
159 redtent video modals (#170)
L03TJ3 Jul 2, 2024
55a9746
Dev version beta.36c24955 released
L03TJ3 Jul 2, 2024
f0fc9a1
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Jul 16, 2024
ba2fadc
Dev version beta.f0fc9a19 released
L03TJ3 Jul 16, 2024
ba70dfa
fix: handle partial success when requesting certificates
L03TJ3 Jul 16, 2024
e183c80
Dev version beta.ba70dfad released
L03TJ3 Jul 16, 2024
c5783e2
add configurable env to segmentation flow story
L03TJ3 Jul 17, 2024
6889de2
Dev version beta.c5783e2f released
L03TJ3 Jul 17, 2024
329d88b
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Jul 17, 2024
c1a238f
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Jul 17, 2024
8e467cd
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Aug 6, 2024
75b0cce
Dev version beta.8e467cd1 released
L03TJ3 Aug 6, 2024
80712d0
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Aug 12, 2024
dd05238
Dev version beta.80712d00 released
L03TJ3 Aug 12, 2024
5779254
add: pool criteria for dev-env flow
L03TJ3 Aug 20, 2024
a82516e
Dev version beta.5779254c released
L03TJ3 Aug 20, 2024
957e3e0
168 gooddesign localization (#171)
L03TJ3 Aug 26, 2024
fa7b854
Merge branch 'master' into 116-credential-storage
sirpy Sep 4, 2024
16b891c
fix: extract certificates
sirpy Sep 4, 2024
0b9bebc
add: bump versions
sirpy Sep 4, 2024
4bd6bec
Fixes:
L03TJ3 Sep 6, 2024
e637626
fix: use data-permission
L03TJ3 Sep 6, 2024
abb32d9
Dev version beta.e637626f released
L03TJ3 Sep 6, 2024
62e07ae
fix: redtentthanks next button
L03TJ3 Sep 6, 2024
fa18582
Dev version beta.62e07aeb released
L03TJ3 Sep 6, 2024
3cd8d0f
[Goodid] add new claim flow (#162)
L03TJ3 Sep 18, 2024
f604325
Dev version beta.3cd8d0fc released
L03TJ3 Sep 18, 2024
c5b1daf
fix: navigation, img, copy
L03TJ3 Sep 19, 2024
c81c523
Dev version beta.c5b1dafc released
L03TJ3 Sep 19, 2024
6e632f1
fix: disputeValues should refresh
L03TJ3 Sep 20, 2024
bfa74e5
Dev version beta.6e632f16 released
L03TJ3 Sep 20, 2024
7b8a2c2
bump goodcollective-sdk
L03TJ3 Sep 20, 2024
b7ddd6f
Dev version beta.7b8a2c20 released
L03TJ3 Sep 20, 2024
9fb694c
fix: document not defined on android
L03TJ3 Sep 20, 2024
57c1029
Dev version beta.9fb694c7 released
L03TJ3 Sep 20, 2024
ac2b3a4
wip: goodid fixes for android
L03TJ3 Sep 21, 2024
1fdee33
Dev version beta.ac2b3a4d released
L03TJ3 Sep 21, 2024
b6b260b
Fixes include:
L03TJ3 Sep 24, 2024
603d9eb
Dev version beta.b6b260b1 released
L03TJ3 Sep 24, 2024
4ea5e45
fix:
L03TJ3 Sep 25, 2024
0e451dc
Dev version beta.4ea5e456 released
L03TJ3 Sep 25, 2024
49c2374
wip: fixes for android support
L03TJ3 Sep 25, 2024
c67e7f2
Dev version beta.49c23743 released
L03TJ3 Sep 25, 2024
9d904e3
fix: failed-fv would not return to face-verification screen next time
L03TJ3 Sep 25, 2024
8601384
Dev version beta.9d904e3e released
L03TJ3 Sep 25, 2024
2276411
hotfix-merge: flow-fixes
L03TJ3 Sep 25, 2024
7f5594e
Merge branch '116-credential-storage' of github.com:GoodDollar/GoodWe…
L03TJ3 Sep 25, 2024
5a76e06
Dev version beta.7f5594ed released
L03TJ3 Sep 25, 2024
81fd194
fix: video upload onError flow
L03TJ3 Sep 30, 2024
23e3f37
chore:lingui
L03TJ3 Sep 30, 2024
6be4b57
Dev version beta.23e3f37e released
L03TJ3 Sep 30, 2024
d33b053
fixes include:
L03TJ3 Oct 2, 2024
9e36268
Dev version beta.d33b0532 released
L03TJ3 Oct 2, 2024
f927508
fix: claim-flow with local nav bar, chore style fixes
L03TJ3 Oct 3, 2024
96091f1
Dev version beta.f9275089 released
L03TJ3 Oct 3, 2024
a2b0641
fix: redtent offer styling and shown values
L03TJ3 Oct 4, 2024
de52836
chore: lingui
L03TJ3 Oct 4, 2024
a841f10
chore: lingui
L03TJ3 Oct 4, 2024
df61635
Dev version beta.a841f10d released
L03TJ3 Oct 4, 2024
4fedc7c
chore: lingui
L03TJ3 Oct 4, 2024
1f4f6b8
Dev version beta.4fedc7cd released
L03TJ3 Oct 4, 2024
1985097
fix: also export lastAuthenticated from identity hook
L03TJ3 Oct 7, 2024
2319fac
Dev version beta.1985097e released
L03TJ3 Oct 7, 2024
d00dd87
fix: file-extension for video-upload might be uppercase
L03TJ3 Oct 7, 2024
4359bf7
fix: recent claims list long loading blocking post-claim screen
L03TJ3 Oct 7, 2024
57b3853
fix: wrong icon showing, wip-fix: small delay for showing segmentatio…
L03TJ3 Oct 7, 2024
2b4699b
Dev version beta.57b38532 released
L03TJ3 Oct 7, 2024
085355e
chore: copy update
L03TJ3 Oct 8, 2024
64fceb7
fix: scrollable list on android
L03TJ3 Oct 8, 2024
e289c69
Dev version beta.64fceb78 released
L03TJ3 Oct 8, 2024
4297c67
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Oct 15, 2024
844d8ce
fix: should use source for images on android
L03TJ3 Oct 15, 2024
152159e
Dev version beta.844d8ce1 released
L03TJ3 Oct 16, 2024
c5e9b1f
fix: faucet refresh after tx
sirpy Oct 22, 2024
c22a5b9
fix: use production env when on production
L03TJ3 Oct 22, 2024
4803d2b
chore: lingui
L03TJ3 Oct 22, 2024
d4ddc54
use default language if non-supported is used
L03TJ3 Oct 22, 2024
005e91b
Dev version beta.d4ddc54b released
L03TJ3 Oct 22, 2024
49b9ce0
Goodid out of gas (#205)
L03TJ3 Oct 24, 2024
86e77e1
fix: video upload on android
L03TJ3 Oct 25, 2024
f993e4c
fix: redtent offer flow style fixes
L03TJ3 Oct 25, 2024
91555be
Dev version beta.f993e4cd released
L03TJ3 Oct 25, 2024
df1e8f0
fix: pool contracts not loading on staging/production
L03TJ3 Oct 28, 2024
a3a39d2
New Crowdin updates (#202)
L03TJ3 Oct 28, 2024
ec58ee2
Merge branch '116-credential-storage' of github.com:GoodDollar/GoodWe…
L03TJ3 Oct 28, 2024
899dd95
Dev version beta.ec58ee2a released
L03TJ3 Oct 28, 2024
d8ba27b
fixes -->
L03TJ3 Oct 28, 2024
0e703b2
New Crowdin updates (#207)
L03TJ3 Oct 28, 2024
460739e
Merge branch '116-credential-storage' of github.com:GoodDollar/GoodWe…
L03TJ3 Oct 28, 2024
f2e0636
chore: lingui
L03TJ3 Oct 28, 2024
783b394
Dev version beta.f2e0636f released
L03TJ3 Oct 28, 2024
db91ac2
fix: typo
L03TJ3 Oct 29, 2024
03a153f
Merge branch 'master' of github.com:GoodDollar/GoodWeb3-Mono into 116…
L03TJ3 Nov 2, 2024
6bdc3f9
chore: bump gc-sdk to latest
L03TJ3 Nov 2, 2024
fb2fd61
Dev version beta.6bdc3f93 released
L03TJ3 Nov 2, 2024
47071d6
fix: styleprop should be number
L03TJ3 Nov 20, 2024
ee46d53
Dev version beta.47071d6a released
L03TJ3 Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-release
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const args = process.argv.slice(2);

console.log("2. Build sdk-v2");
await run("yarn workspace @gooddollar/web3sdk-v2 install");
await run("yarn workspace @gooddollar/web3sdk-v2 build");
await run("yarn workspace @gooddollar/web3sdk-v2 build:release");

console.log("3. Publish sdk-v2");
await run("npm publish --access public --tag beta", { cwd: pkgDir("sdk-v2") });
Expand Down
8 changes: 5 additions & 3 deletions packages/good-design/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gooddollar/good-design",
"repository": "https://github.com/GoodDollar/GoodWeb3-mono/packages/good-design",
"version": "0.1.45",
"version": "0.1.45-beta.efda7af",
"scripts": {
"build": "yarn install && yarn dev:clean && tsc && yarn copy:assets && yalc publish --push",
"build:release": "yarn dev:clean && tsc -p tsconfig.release.json && yarn copy:assets",
Expand All @@ -27,7 +27,7 @@
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@babel/runtime": "^7.18.9",
"@gooddollar/web3sdk-v2": "latest",
"@gooddollar/web3sdk-v2": "0.2.22-beta.efda7af",
"@storybook/addon-actions": "^6.5.12",
"@storybook/addon-essentials": "^6.5.12",
"@storybook/addon-links": "^6.5.12",
Expand All @@ -47,7 +47,6 @@
"@types/react-helmet": "^6.1.6",
"@types/react-native": "0.70.4",
"@usedapp/core": "^1.2.6",
"@web3-onboard/react": "^2.8.7",
"babel-jest": "^27.3.1",
"babel-loader": "^8.2.3",
"babel-plugin-module-resolver": "^4.1.0",
Expand Down Expand Up @@ -94,6 +93,8 @@
"react-inlinesvg": "2.3.0",
"react-native": "0.70.4",
"react-native-animatable": "^1.4.0",
"react-native-fs": "^2.20.0",
"react-native-image-picker": "^7.1.2",
"react-native-mask-input": "^1.2.2",
"react-native-safe-area-context": "^3.3.2",
"react-native-svg": "^12.1.1",
Expand All @@ -105,6 +106,7 @@
"react-native-webview": "^13.2.2",
"react-number-format": "^5.1.1",
"react-use-promise": "^0.5.0",
"react-use-wizard": "^2.3.0",
"require-from-string": "^2.0.2"
}
}
55 changes: 55 additions & 0 deletions packages/good-design/src/apps/goodid/idcard/GoodIdCard.theme.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export const GoodIdCard = {
baseStyle: {
paddingX: 4,
paddingTop: 4,
paddingBottom: 2,
space: 4,
width: 343,
borderRadius: 15,
bgColor: "greyCard",
shadow: "1",
fontStyles: {
title: {
fontFamily: "heading",
fontSize: "xl",
fontWeight: 700,
color: "primary"
},
subHeading: {
fontFamily: "subheading",
fontWeight: 600,
color: "goodGrey.600"
},
subContent: {
fontFamily: "subheading",
fontSize: "sm",
color: "goodGrey.600"
},
footer: {
fontFamily: "subheading",
fontSize: "2xs",
color: "goodGrey.600"
}
}
}
};

export const CardRowItem = {
baseStyle: {
width: "45%",
fontStyles: {
subHeading: {
fontFamily: "subheading",
fontWeight: 700,
color: "goodGrey.600",
fontSize: "sm"
},
subContent: {
fontFamily: "subheading",
fontWeight: 400,
color: "goodGrey.450",
fontSize: "xs"
}
}
}
};
114 changes: 114 additions & 0 deletions packages/good-design/src/apps/goodid/idcard/GoodIdCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import React, { useMemo } from "react";
import { Center, HStack, Heading, Text, VStack, IStackProps } from "native-base";
import { useAggregatedCertificates } from "@gooddollar/web3sdk-v2";

import { withTheme } from "../../../theme";
import SvgXml from "../../../core/images/SvgXml";
import UnknownAvatarSvg from "../../../assets/svg/unknown-avatar.svg";
import GdVerifiedSvg from "../../../assets/svg/gdverified.svg";
import { truncateMiddle } from "../../../utils";

interface GoodIdCardProps extends IStackProps {
account: string;
isWhitelisted: boolean;
avatar?: string;
fullname?: string;
expiryDate?: string;
fontStyles?: any;
}

const CardRowItem = withTheme({ name: "CardRowItem" })(
({
credentialLabel,
verifiedValue,
fontStyles,
...props
}: {
credentialLabel: string;
verifiedValue?: string;
fontStyles?: any;
}) => {
const { subHeading, subContent } = fontStyles ?? {};

return (
L03TJ3 marked this conversation as resolved.
Show resolved Hide resolved
<VStack {...props}>
<Text {...subHeading}>{credentialLabel}</Text>
<HStack space={1} alignItems="center">
<Text {...subContent}>{verifiedValue ?? `Your ${credentialLabel.toLowerCase()}`}</Text>
{verifiedValue && (
<Center mt="-3px">
<SvgXml src={GdVerifiedSvg} height="16" width="16" />
</Center>
)}
</HStack>
</VStack>
);
}
);

const GoodIdCard = withTheme({ name: "GoodIdCard", skipProps: "credentialsList" })(
({ account, isWhitelisted, avatar, fullname, expiryDate, ...props }: GoodIdCardProps) => {
const { title, subHeading, subContent, footer } = props.fontStyles ?? {};
const truncatedAccount = truncateMiddle(account, 11);

const certificates = useAggregatedCertificates(account);

const verifiedValues = useMemo(() => {
let Age: string | null = null,
Gender: string | null = null,
Country: string | null = null;

const filtered = certificates?.filter(
certificate => certificate.typeName === "Identity" || certificate.typeName === "Location"
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const filtered = certificates?.filter(
certificate => certificate.typeName === "Identity" || certificate.typeName === "Location"
);
const filtered = certificates?.filter(({ typeName }) => ["Identity", "Location"].includes(typeName))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and you do not need it. you have all 4 types, you just put type from item to the CardRowItem and display corresponding data.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@L03TJ3 one of certificates is the same for 3 types, but in result collection it will have 3 items having different type

so you display it 3 times but with passing different type to the row item component which will display different label & data

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnsmith-gooddollar I don't need them all 4.
What we need is the values of the 'Age, Gender, Location' certificates.
so in any way there is a filter needed. Either I filter out the identity certificate and use the remaining three. Or it's like I have done and use the identity certificate to get the gender and location

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@L03TJ3 you just go over all certificates from useAggregated, you skip Identity Type and you display the value which corresponds the type. Please fix it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it doesn't clear we could discuss tomorrow at sync


filtered?.forEach(({ certificate, typeName }) => {
const { credentialSubject } = certificate ?? {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be part of CardRowItem. depending of type you pick up different values from subject and display them the different way

if (credentialSubject && typeName === "Identity") {
const { age: VerifiableAgeCredential, gender: VerifiableGenderCredential } = credentialSubject;

Age = Age ?? `${VerifiableAgeCredential.from}-${VerifiableAgeCredential.to}`;
Gender = Gender ?? VerifiableGenderCredential;
}

if (credentialSubject && typeName === "Location") {
Country = Country ?? credentialSubject.countryCode;
}
});

return { Age, Gender, Country };
}, [certificates]);

return (
L03TJ3 marked this conversation as resolved.
Show resolved Hide resolved
<VStack {...props}>
<HStack justifyContent="space-between">
<VStack>
<Heading {...title}>GoodID</Heading>
<HStack space={1} alignItems="center">
<Text {...subHeading}>{truncatedAccount}</Text>
{isWhitelisted && (
<Center mt="-3px">
<SvgXml src={GdVerifiedSvg} height="16" width="16" />
</Center>
)}
</HStack>
{fullname && <Text {...subContent}>{fullname}</Text>}
</VStack>
<VStack justifyContent="flex-start">
<SvgXml src={avatar ?? UnknownAvatarSvg} height="56" width="56" />
</VStack>
</HStack>
<HStack space={2} flexWrap="wrap">
{Object.entries(verifiedValues).map(([label, value]) => (
<CardRowItem key={label} credentialLabel={label} verifiedValue={value ?? "-"} />
))}
</HStack>
<HStack>
<Text {...footer}>{expiryDate ?? "Expires on February 12, 2099"}</Text>
</HStack>
</VStack>
);
}
);

export default GoodIdCard;
1 change: 1 addition & 0 deletions packages/good-design/src/apps/goodid/idcard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as GoodIdCard } from "./GoodIdCard";
1 change: 1 addition & 0 deletions packages/good-design/src/apps/goodid/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./idcard";
Loading