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: unify UI for DIDComm and OpenID flows for Offer and details screens #1365

Conversation

MosCD3
Copy link
Contributor

@MosCD3 MosCD3 commented Dec 18, 2024

Summary of Changes

Unify UI for OpenID flow and Didcomm in regards to the following

  • Credentials List cards
  • Credential details screen
  • Credential offer screen

Introducing OCA by adding mapping functions to map W3C credential metadata to default OCA branding overlay
Re-using Card components and creating some other re-usable components for both flows

Screenshots, videos, or gifs

UI Screens for OpenID Creds along with Didcomm, all look identical
DBC DIIP is W3C Cred, while the rest is Anoncreds

Simulator Screenshot - iPhone 16 - 2024-12-18 at 00 09 19
Simulator Screenshot - iPhone 16 - 2024-12-18 at 00 09 27
IMG_700A93F0C579-1 (1)

Breaking change guide

No breaking changes

Related Issues

Replace this text with issue #'s that are relevant to this PR. If there are none, simply enter N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this)
  • If applicable, screenshots, gifs, or video are included for UI changes
  • If applicable, breaking changes are described above along with how to address them
  • Updated documentation as needed for changed code and new or modified features
  • Added sufficient tests so that overall code coverage is not reduced

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated checks have passed

@MosCD3 MosCD3 marked this pull request as ready for review December 18, 2024 05:08
@jleach jleach changed the title Unify UI for Didcomm and OpenID flows for Offer and details screens feat: unify UI for Didcomm and OpenID flows for Offer and details screens Dec 19, 2024
@jleach jleach changed the title feat: unify UI for Didcomm and OpenID flows for Offer and details screens feat: unify UI for DIDComm and OpenID flows for Offer and details screens Dec 19, 2024
import { credentialTextColor } from '../../utils/credential'
import { testIdWithKey } from '../../utils/testable'

type Props = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Able to rename to CredentialDetailPrimaryHeaderProps to follow the app convetion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

import { toImageSource } from '../../utils/credential'
import { testIdWithKey } from '../../utils/testable'

type Props = {
Copy link
Contributor

Choose a reason for hiding this comment

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

CredentialDetailSecondaryHeaderProps to follow convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


useEffect(() => {
const resolveOverlay = async () => {
if (!credentialDisplay || !bundleResolver || !i18n || !credentialDisplay.display) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the above two useEffect you put the guard clause if (x) return outside of the async function. Able to move this out or the other two in for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

)
}

const screenEdges: Edge[] = ['left', 'right']
Copy link
Contributor

Choose a reason for hiding this comment

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

This var seems orphaned down here. Can it be moved up with the others for readability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


useEffect(() => {
const resolveOverlay = async () => {
if (!credentialDisplay || !bundleResolver || !i18n || !credentialDisplay.display) {
Copy link
Contributor

Choose a reason for hiding this comment

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

outside for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

resolveOverlay()
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Contributor

Choose a reason for hiding this comment

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

Why "disable"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, including 'credentialDisplay' in the dept array, causes infinite rendering loop. I spent enough time trying to dig deeper but couldn't figure out the reason. Removing this from the dept array makes rendering more stable.

{credential && (
<View style={{ marginHorizontal: 15, marginBottom: 16 }}>
<OpenIDCredentialCard credentialDisplay={display} />
{/* <OpenIDCredentialCard credentialDisplay={display} /> */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@MosCD3 MosCD3 requested a review from jleach January 6, 2025 03:44
@MosCD3 MosCD3 requested a review from a team as a code owner January 8, 2025 18:54
Copy link

sonarqubecloud bot commented Jan 9, 2025

@jleach
Copy link
Contributor

jleach commented Jan 9, 2025

Checked out and tested. LGTM.

@jleach jleach merged commit 08e12a6 into openwallet-foundation:main Jan 9, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants