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: export connection alert modal #1408

Conversation

ZouidiSamih
Copy link
Contributor

Summary of Changes

Exported the connection alert model to improve its reusability across components/modules.

Screenshots, videos, or gifs

N/A

Breaking change guide

N/A

Related Issues

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

@ZouidiSamih ZouidiSamih requested a review from a team as a code owner January 22, 2025 20:25
@bryce-mcmath bryce-mcmath changed the title Feat/export connection alert model feat: export connection alert model Jan 22, 2025
@bryce-mcmath bryce-mcmath changed the title feat: export connection alert model feat: export connection alert modal Jan 22, 2025
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

very small nit pick but changes look good

@@ -715,7 +715,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
</InfoTextBox>
)}
{!loading && proofConnectionLabel && goalCode === 'aries.vc.verify' ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're looking at this, it would be a little cleaner to modify the check to:

{(!loading && proofConnectionLabel && goalCode === 'aries.vc.verify') ?? (
  connectionAlert({ connectionID: proofConnectionLabel })
)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback! I've implemented the suggested changes

@bryce-mcmath bryce-mcmath self-requested a review January 22, 2025 22:07
Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

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

Requesting a small adjustment, but overall nice work

@@ -75,6 +74,7 @@ const CredentialOffer: React.FC<CredentialOfferProps> = ({ navigation, credentia
const { start } = useTour()
const screenIsFocused = useIsFocused()
const goalCode = useOutOfBandByConnectionId(credential?.connectionId ?? '')?.outOfBandInvitation?.goalCode
const [connectionAlert] = useServices([TOKENS.COMPONENT_CONNECTION_ALERT])
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we opt to use capitalized components and JSX for injectables like this? Following something like PINCreateHeader for example, ie.

const [ConnectionAlert] = useServices([TOKENS.COMPONENT_CONNECTION_ALERT])
...
{credentialConnectionLabel && goalCode === 'aries.vc.issue' ? (
  <ConnectionAlert connectionID={credentialConnectionLabel} />
) : null}

It makes it easier to identify what is being rendered at a glance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback! I've implemented the suggested changes

@@ -279,7 +279,7 @@ const CredentialOffer: React.FC<CredentialOfferProps> = ({ navigation, credentia
>
{loading ? <RecordLoading /> : null}
{credentialConnectionLabel && goalCode === 'aries.vc.issue' ? (
<ConnectionAlert connectionID={credentialConnectionLabel} />
connectionAlert({ connectionID: credentialConnectionLabel })
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the second part of the suggested change referenced in comment above

@bryce-mcmath bryce-mcmath merged commit 313b374 into openwallet-foundation:main Jan 23, 2025
8 checks passed
@bryce-mcmath
Copy link
Contributor

@ZouidiSamih nicely done!

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.

3 participants