-
Notifications
You must be signed in to change notification settings - Fork 1
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
ENG-3859 feat(portal): better navigation between list details list identity and tag claim #822
Merged
Vitalsine85
merged 3 commits into
main
from
vital/eng-3859-navigation-between-list-details-list-identity-and-tag-claim
Sep 5, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import { | ||
Button, | ||
ButtonVariant, | ||
cn, | ||
HoverCard, | ||
HoverCardContent, | ||
HoverCardTrigger, | ||
Icon, | ||
Identity, | ||
IdentityTag, | ||
IdentityType, | ||
ProfileCard, | ||
Text, | ||
TextVariant, | ||
Trunctacular, | ||
} from '@0xintuition/1ui' | ||
import { ClaimPresenter } from '@0xintuition/api' | ||
|
||
import { PATHS } from '@consts/paths' | ||
|
||
export interface DetailInfoCardProps | ||
extends React.HTMLAttributes<HTMLDivElement> { | ||
variant: IdentityType | ||
list?: ClaimPresenter | ||
username: string | ||
avatarImgSrc: string | ||
id: string | ||
description: string | ||
link: string | ||
ipfsLink: string | ||
timestamp: string | ||
} | ||
|
||
const DetailInfoCard = ({ | ||
variant = Identity.user, | ||
list, | ||
username, | ||
avatarImgSrc, | ||
id, | ||
description, | ||
link, | ||
ipfsLink, | ||
timestamp, | ||
className, | ||
...props | ||
}: DetailInfoCardProps) => { | ||
const formattedDate = new Intl.DateTimeFormat('en-US', { | ||
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric', | ||
}).format(new Date(timestamp)) | ||
|
||
return ( | ||
<div | ||
className={cn( | ||
`flex flex-col gap-5 theme-border p-5 rounded-lg max-sm:items-center`, | ||
className, | ||
)} | ||
{...props} | ||
> | ||
{list && ( | ||
<div> | ||
<Text variant={TextVariant.caption} className="text-muted-foreground"> | ||
List | ||
</Text> | ||
<div className="flex justify-start items-center gap-1"> | ||
<a href={`${PATHS.LIST}/${list.claim_id}`}> | ||
<IdentityTag | ||
variant={list.object?.user ? Identity.user : Identity.nonUser} | ||
imgSrc={list.object?.image ?? ''} | ||
> | ||
<Trunctacular | ||
value={ | ||
list.object?.user_display_name ?? | ||
list.object?.display_name ?? | ||
'Unknown' | ||
} | ||
maxStringLength={32} | ||
/> | ||
</IdentityTag> | ||
</a> | ||
</div> | ||
</div> | ||
)} | ||
<div> | ||
<Text variant={TextVariant.caption} className="text-muted-foreground"> | ||
Creator | ||
</Text> | ||
<div className="flex justify-start items-center gap-1"> | ||
<HoverCard openDelay={150} closeDelay={150}> | ||
<HoverCardTrigger> | ||
<a href={link}> | ||
<IdentityTag variant={variant} imgSrc={avatarImgSrc}> | ||
<Trunctacular value={username} maxStringLength={18} /> | ||
</IdentityTag> | ||
</a> | ||
</HoverCardTrigger> | ||
<HoverCardContent side="right" className="w-max"> | ||
<div className="flex flex-col gap-4 w-80 max-md:w-[80%]"> | ||
<ProfileCard | ||
variant={variant} | ||
avatarSrc={avatarImgSrc ?? ''} | ||
name={username} | ||
id={id ?? ''} | ||
bio={description ?? ''} | ||
ipfsLink={ipfsLink} | ||
className="profile-card" | ||
/> | ||
{link && ( | ||
<a href={link}> | ||
<Button | ||
variant={ButtonVariant.secondary} | ||
className="w-full" | ||
> | ||
View Identity{' '} | ||
<Icon name={'arrow-up-right'} className="h-3 w-3" /> | ||
</Button> | ||
</a> | ||
)} | ||
</div> | ||
</HoverCardContent> | ||
</HoverCard> | ||
<span className="bg-muted-foreground h-[2px] w-[2px] block rounded-full" /> | ||
<Text variant={TextVariant.body} className="text-muted-foreground"> | ||
{formattedDate} | ||
</Text> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export { DetailInfoCard } |
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
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.
if we want to start moving away from using
let
we could try something like this --what do you think? i know we're mixing these patterns in our loaders so likely a bigger question but wondering what you think.
not blocking just a question
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.
Either way works for me, I don't really have a preference. We should just have a quick chat and land on one or the other.