Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
janrtvld committed Nov 26, 2024
1 parent 697ff0c commit 7c19153
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions apps/easypid/src/app/(app)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Redirect, Stack, useGlobalSearchParams, useLocalSearchParams, usePathname, useRouter } from 'expo-router'
import { Redirect, Stack, useGlobalSearchParams, usePathname, useRouter } from 'expo-router'

import { TypedArrayEncoder } from '@credo-ts/core'
import { useSecureUnlock } from '@easypid/agent'
Expand Down Expand Up @@ -137,7 +137,7 @@ export default function AppLayout() {
<Stack.Screen name="activity/[id]" options={headerNormalOptions} />
<Stack.Screen name="pinConfirmation" options={headerNormalOptions} />
<Stack.Screen name="pinLocked" options={headerNormalOptions} />
<Stack.Screen name="issuer" options={headerNormalOptions} />
<Stack.Screen name="federation" options={headerNormalOptions} />
<Stack.Screen name="pidSetup" />
</Stack>
</WithBackgroundPidRefresh>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FunkeIssuerDetailScreen } from '@easypid/features/wallet/FunkeIssuerDetailScreen'
import { FunkeFederationDetailScreen } from '@easypid/features/wallet/FunkeFederationDetailScreen'
import { useLocalSearchParams } from 'expo-router'

export default function Screen() {
Expand All @@ -7,7 +7,7 @@ export default function Screen() {
const trustedEntityIdsArray = Array.isArray(trustedEntityIds) ? trustedEntityIds : trustedEntityIds?.split(',') ?? []

return (
<FunkeIssuerDetailScreen
<FunkeFederationDetailScreen
entityId={entityId as string}
trustedEntityIds={trustedEntityIdsArray}
name={name as string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ export function FunkeCredentialNotificationScreen() {
entityId={issuerMetadata?.credential_issuer as string}
lastInteractionDate={activities[0]?.date}
onContinue={onCheckCardContinue}
trustedEntityIds={Object.keys(credentialsForRequest?.verifier.verifiedEntityIds ?? [])}
/>
),
},
Expand Down
8 changes: 6 additions & 2 deletions apps/easypid/src/features/receive/slides/VerifyPartySlide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface VerifyPartySlideProps {
backgroundColor?: string
lastInteractionDate?: string
onContinue?: () => Promise<void>
trustedEntityIds?: string[]
verifiedEntityIds?: Record<string, boolean>
}

export const VerifyPartySlide = ({
Expand All @@ -37,13 +37,17 @@ export const VerifyPartySlide = ({
backgroundColor,
lastInteractionDate,
onContinue,
trustedEntityIds,
verifiedEntityIds,
}: VerifyPartySlideProps) => {
const router = useRouter()
const { onNext, onCancel } = useWizard()
const { withHaptics } = useHaptics()
const [isLoading, setIsLoading] = useState(false)

const trustedEntityIds = Object.entries(verifiedEntityIds ?? {})
.filter(([_, isVerified]) => isVerified)
.map(([entityId]) => entityId)

const handleContinue = async () => {
setIsLoading(true)
if (onContinue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function FunkeOpenIdPresentationNotificationScreen() {
entityId={credentialsForRequest?.verifier.entityId as string}
verifierName={credentialsForRequest?.verifier.name}
logo={credentialsForRequest?.verifier.logo}
trustedEntityIds={Object.keys(credentialsForRequest?.verifier.verifiedEntityIds ?? [])}
verifiedEntityIds={credentialsForRequest?.verifier.verifiedEntityIds}
lastInteractionDate={lastInteractionDate}
onComplete={() => pushToWallet('replace')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface FunkePresentationNotificationScreenProps {
verifierName?: string
logo?: DisplayImage
lastInteractionDate?: string
trustedEntityIds?: string[]
verifiedEntityIds?: Record<string, boolean>
submission?: FormattedSubmission
usePin: boolean
isAccepting: boolean
Expand All @@ -33,7 +33,7 @@ export function FunkePresentationNotificationScreen({
isAccepting,
submission,
onComplete,
trustedEntityIds,
verifiedEntityIds,
}: FunkePresentationNotificationScreenProps) {
return (
<SlideWizard
Expand All @@ -56,7 +56,7 @@ export function FunkePresentationNotificationScreen({
name={verifierName}
logo={logo}
lastInteractionDate={lastInteractionDate}
trustedEntityIds={trustedEntityIds}
verifiedEntityIds={verifiedEntityIds}
/>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ import { TextBackButton, useScrollViewPosition } from 'packages/app/src'
import { useRef } from 'react'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

interface FunkeIssuerDetailScreenProps {
interface FunkeFederationDetailScreenProps {
name: string
logo?: string
entityId?: string
trustedEntityIds?: string[]
}

export function FunkeIssuerDetailScreen({ name, logo, entityId, trustedEntityIds = [] }: FunkeIssuerDetailScreenProps) {
export function FunkeFederationDetailScreen({
name,
logo,
entityId,
trustedEntityIds = [],
}: FunkeFederationDetailScreenProps) {
const { trustedEntities } = useTrustedEntities()

const { handleScroll, isScrolledByOffset, scrollEventThrottle } = useScrollViewPosition()
Expand Down

0 comments on commit 7c19153

Please sign in to comment.