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

feat: add new oca branding #1320

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
72a8ca2
feat: add new oca branding
fc-santos Oct 16, 2024
f765c4a
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Oct 22, 2024
2b5444c
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Oct 23, 2024
5459d9c
WIP: work started on new CredentialCard for Branding 1.1
fc-santos Oct 30, 2024
753d44f
wip: work on new brandingOverlay (1.1)
fc-santos Nov 6, 2024
eaa4843
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 6, 2024
c87a97a
feat: work on new oca branding
fc-santos Nov 15, 2024
bceffd9
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 15, 2024
b2d1671
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 18, 2024
a40504a
refactor: work on duplicated code in CredentialCard12
fc-santos Nov 19, 2024
ff9c6a9
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 19, 2024
ccc706a
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 20, 2024
11960be
refactor: fix sonarcloud error for hook useParseAttribute
fc-santos Nov 20, 2024
6faad26
refactor: move credential card logo
fc-santos Nov 20, 2024
3a585de
fix: reliability rating sonarcloud
fc-santos Nov 20, 2024
0326595
refactor: move credential card status
fc-santos Nov 20, 2024
aa294eb
fix: sonarcloud code duplication
fc-santos Nov 20, 2024
c2b4322
refactor: move code
fc-santos Nov 20, 2024
53a70dd
fix: multiple import react-native
fc-santos Nov 20, 2024
de489cb
test: update snapshots
fc-santos Nov 20, 2024
ef5ff39
feat: update RecordLoading skeleton to display the new branding
fc-santos Nov 20, 2024
883122b
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 26, 2024
9bafc02
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 27, 2024
f5a9b7d
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 28, 2024
81efdf5
Merge branch 'main' into feat/add-new-oca-branding
fc-santos Nov 29, 2024
0148d7e
fix: make import relative in notification hook
fc-santos Nov 29, 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
87 changes: 61 additions & 26 deletions packages/legacy/core/App/components/misc/CredentialCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { GenericFn } from '../../types/fn'

import CredentialCard10 from './CredentialCard10'
import CredentialCard11 from './CredentialCard11'
import CredentialCard12 from './CredentialCard12'
import OpenIDCredentialCard from '../../modules/openid/components/OpenIDCredentialCard'
import { GenericCredentialExchangeRecord } from '../../types/credentials'

Expand Down Expand Up @@ -46,41 +47,75 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
const { ColorPallet } = useTheme()
const getCredOverlayType = (type: BrandingOverlayType) => {
if (proof) {
return (
<CredentialCard11
displayItems={displayItems}
style={{ backgroundColor: ColorPallet.brand.secondaryBackground }}
error={!existsInWallet}
predicateError={!satisfiedPredicates}
credName={credName}
credDefId={credDefId}
schemaId={schemaId}
credential={credential as CredentialExchangeRecord}
handleAltCredChange={handleAltCredChange}
hasAltCredentials={hasAltCredentials}
proof
elevated
/>
)
if (type === BrandingOverlayType.Branding11) {
return (
<CredentialCard12
displayItems={displayItems}
error={!existsInWallet}
style={{ backgroundColor: ColorPallet.brand.secondaryBackground }}
predicateError={!satisfiedPredicates}
credName={credName}
credDefId={credDefId}
schemaId={schemaId}
credential={credential as CredentialExchangeRecord}
handleAltCredChange={handleAltCredChange}
hasAltCredentials={hasAltCredentials}
proof
elevated
/>
)
} else {
return (
<CredentialCard11
displayItems={displayItems}
style={{ backgroundColor: ColorPallet.brand.secondaryBackground }}
error={!existsInWallet}
predicateError={!satisfiedPredicates}
credName={credName}
credDefId={credDefId}
schemaId={schemaId}
credential={credential as CredentialExchangeRecord}
handleAltCredChange={handleAltCredChange}
hasAltCredentials={hasAltCredentials}
proof
elevated
/>
)
}
}

if (credential) {
if (type === BrandingOverlayType.Branding01) {
return <CredentialCard10 credential={credential as CredentialExchangeRecord} style={style} onPress={onPress} />
} else if (type == BrandingOverlayType.Branding11) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this PR is still in draft but will it eventually have a BrandingOverlayType.Branding12 and use that here, rather than use the 12 card with the 11 overlay type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could do some refactor here @bryce-mcmath but in the oca package there is the Branding01, Branding10 and Branding11. The bifold component that implements each one of these are CredentialCard10 (For the legacy branding), CredentialCard11 (Branding10) and now CredentialCard12 (Branding11).

I'm not sure why the components were not named respectively CredentialCard01, CredentialCard10 in the beginning (maybe due to lint reasons). Maybe we could name them:

Legacy -> CredentialCard01
Branding 1.0 -> CredentialCard10
Branding 1.1 -> CredentialCard11

Let me know what you think. Thanks!

return <CredentialCard12 credential={credential as CredentialExchangeRecord} style={style} onPress={onPress} />
} else {
return <CredentialCard11 credential={credential as CredentialExchangeRecord} style={style} onPress={onPress} />
}
} else {
return (
<CredentialCard11
credDefId={credDefId}
schemaId={schemaId}
credName={credName}
displayItems={displayItems}
style={style}
onPress={onPress}
/>
)
if (type === BrandingOverlayType.Branding11) {
return (
<CredentialCard12
credDefId={credDefId}
schemaId={schemaId}
credName={credName}
displayItems={displayItems}
style={style}
onPress={onPress}
/>
)
} else {
return (
<CredentialCard11
credDefId={credDefId}
schemaId={schemaId}
credName={credName}
displayItems={displayItems}
style={style}
onPress={onPress}
/>
)
}
}
}

Expand Down
Loading
Loading