optimize profile card

This commit is contained in:
pompurin404 2024-10-06 20:00:16 +08:00
parent 0e129ab00f
commit f49850ae8a
No known key found for this signature in database
2 changed files with 32 additions and 4 deletions

View File

@ -261,6 +261,22 @@ const ProfileItem: React.FC<Props> = (props) => {
)}
</div>
)}
</CardBody>
<CardFooter className="pt-0">
{info.type === 'remote' && !extra && (
<div
className={`w-full mt-2 flex justify-between ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
>
<Chip
size="sm"
variant="bordered"
className={`${isCurrent ? 'text-primary-foreground border-primary-foreground' : 'border-primary text-primary'}`}
>
</Chip>
<small>{dayjs(info.updated).fromNow()}</small>
</div>
)}
{info.type === 'local' && (
<div
className={`mt-2 flex justify-between ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
@ -274,8 +290,6 @@ const ProfileItem: React.FC<Props> = (props) => {
</Chip>
</div>
)}
</CardBody>
<CardFooter className="pt-0">
{extra && (
<Progress
className="w-full"

View File

@ -130,6 +130,22 @@ const ProfileCard: React.FC = () => {
)}
</div>
)}
</CardBody>
<CardFooter className="pt-0">
{info.type === 'remote' && !extra && (
<div
className={`w-full mt-2 flex justify-between ${match ? 'text-primary-foreground' : 'text-foreground'}`}
>
<Chip
size="sm"
variant="bordered"
className={`${match ? 'text-primary-foreground border-primary-foreground' : 'border-primary text-primary'}`}
>
</Chip>
<small>{dayjs(info.updated).fromNow()}</small>
</div>
)}
{info.type === 'local' && (
<div
className={`mt-2 flex justify-between ${match ? 'text-primary-foreground' : 'text-foreground'}`}
@ -143,8 +159,6 @@ const ProfileCard: React.FC = () => {
</Chip>
</div>
)}
</CardBody>
<CardFooter className="pt-0">
{extra && (
<Progress
className="w-full"