-
Notifications
You must be signed in to change notification settings - Fork 15
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: federation in the wallet #238
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
697ff0c
feat: federation in the wallet
janrtvld 7c19153
chore: cleanup
janrtvld 1111d92
chore: type
janrtvld 41cd2c3
feat: federation details
janrtvld 9579682
feat: done
janrtvld f197a17
chore: rename
janrtvld f0ffc50
feat: working
janrtvld bc0c341
feat: final fixes
janrtvld abe86d1
chore: back to funke
janrtvld 8e4d3bb
fix: ci
janrtvld f242f43
Merge branch 'main' into feat/federation-in-the-wallet
TimoGlastra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { FunkeFederationDetailScreen } from '@easypid/features/wallet/FunkeFederationDetailScreen' | ||
import type { TrustedEntity } from '@package/agent' | ||
import { useLocalSearchParams } from 'expo-router' | ||
|
||
export default function Screen() { | ||
const { entityId, trustedEntities, name, logo } = useLocalSearchParams() | ||
|
||
const trustedEntitiesArray = JSON.parse(decodeURIComponent(trustedEntities as string)) as Array<TrustedEntity> | ||
|
||
return ( | ||
<FunkeFederationDetailScreen | ||
entityId={entityId as string} | ||
trustedEntities={trustedEntitiesArray} | ||
name={name as string} | ||
logo={logo as string} | ||
/> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
apps/easypid/src/features/wallet/FunkeFederationDetailScreen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import type { TrustedEntity } from '@package/agent' | ||
import { | ||
Circle, | ||
FlexPage, | ||
Heading, | ||
HeroIcons, | ||
IconContainer, | ||
Image, | ||
MessageBox, | ||
Paragraph, | ||
ScrollView, | ||
type ScrollViewRefType, | ||
XStack, | ||
YStack, | ||
} from '@package/ui' | ||
import { TextBackButton, useScrollViewPosition } from 'packages/app/src' | ||
import React, { useRef } from 'react' | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context' | ||
|
||
interface FunkeFederationDetailScreenProps { | ||
name: string | ||
logo?: string | ||
entityId?: string | ||
trustedEntities?: Array<TrustedEntity> | ||
} | ||
|
||
export function FunkeFederationDetailScreen({ | ||
name, | ||
logo, | ||
entityId, | ||
trustedEntities = [], | ||
}: FunkeFederationDetailScreenProps) { | ||
const { handleScroll, isScrolledByOffset, scrollEventThrottle } = useScrollViewPosition() | ||
const { bottom } = useSafeAreaInsets() | ||
const scrollViewRef = useRef<ScrollViewRefType>(null) | ||
|
||
return ( | ||
<FlexPage gap="$0" paddingHorizontal="$0"> | ||
<YStack | ||
w="100%" | ||
top={0} | ||
p="$4" | ||
borderBottomWidth="$0.5" | ||
borderColor={isScrolledByOffset ? '$grey-200' : '$background'} | ||
/> | ||
<ScrollView ref={scrollViewRef} onScroll={handleScroll} scrollEventThrottle={scrollEventThrottle}> | ||
<YStack gap="$4" p="$4" marginBottom={bottom}> | ||
<Heading variant="h1">About this party</Heading> | ||
<MessageBox | ||
variant="light" | ||
message="Always consider whether sharing with a party is wise." | ||
icon={<HeroIcons.ExclamationTriangleFilled />} | ||
/> | ||
<XStack gap="$4" pt="$2" ai="center"> | ||
{logo ? ( | ||
<Circle overflow="hidden" ai="center" jc="center" size="$6" bw={1} borderColor="$grey-200" bg="$grey-100"> | ||
<Image src={logo} height="100%" width="100%" /> | ||
</Circle> | ||
) : ( | ||
<Circle overflow="hidden" ai="center" jc="center" size="$6" bw={1} borderColor="$grey-200" bg="$grey-100"> | ||
<HeroIcons.BuildingOffice color="$grey-700" /> | ||
</Circle> | ||
)} | ||
<Heading variant="h2">{name}</Heading> | ||
</XStack> | ||
<YStack gap="$4" py="$2"> | ||
<YStack gap="$2"> | ||
<Heading variant="sub2">Trusted by</Heading> | ||
<Paragraph> | ||
{trustedEntities.length > 0 ? ( | ||
<>A list of organizations and whether they have approved {name}.</> | ||
) : ( | ||
<>There are no organizations that have approved {name}.</> | ||
)} | ||
</Paragraph> | ||
</YStack> | ||
<YStack gap="$2"> | ||
{trustedEntities.map((entity) => { | ||
return ( | ||
<XStack ai="center" key={entity.entity_id} br="$8" p="$3.5" gap="$3" bg="$grey-100"> | ||
{entity.logo_uri && ( | ||
<Circle overflow="hidden" size="$4" bg="$grey-50"> | ||
<Image src={entity.logo_uri} height="100%" width="100%" /> | ||
</Circle> | ||
)} | ||
<XStack gap="$1" f={1} justifyContent="space-between" ai="center"> | ||
<Heading f={1} numberOfLines={2} variant="h2"> | ||
{entity.organization_name} | ||
</Heading> | ||
<IconContainer icon={<HeroIcons.CheckCircleFilled size={30} color="$positive-500" />} /> | ||
</XStack> | ||
</XStack> | ||
) | ||
})} | ||
</YStack> | ||
</YStack> | ||
</YStack> | ||
</ScrollView> | ||
<YStack btw="$0.5" borderColor="$grey-200" pt="$4" mx="$-4" px="$4" bg="$background"> | ||
<TextBackButton /> | ||
</YStack> | ||
</FlexPage> | ||
) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error?