Skip to content

Commit 39353e8

Browse files
committed
Add bio and description fields to PublisherCard and GraphQL query for enhanced publisher details
1 parent 2120e46 commit 39353e8

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

app/[locale]/(user)/publishers/PublisherCard.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1+
import React from 'react';
12
import Image from 'next/image';
23
import Link from 'next/link';
3-
import { Text } from 'opub-ui';
4-
import React from 'react';
5-
4+
import { Text, Tooltip } from 'opub-ui';
65

76
interface CardProps {
87
data: any;
98
}
109

1110
const PublisherCard: React.FC<CardProps> = ({ data }) => {
12-
return (
11+
return (
1312
<div className="my-10">
1413
<div className=" grid w-full grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3 lg:gap-16">
1514
{data.map((item: any, index: any) => (
@@ -68,6 +67,23 @@ const PublisherCard: React.FC<CardProps> = ({ data }) => {
6867
</Text>
6968
</div> */}
7069
</div>
70+
{(item?.bio || item?.description) && (
71+
<div>
72+
<Tooltip
73+
content={
74+
item.__typename === 'TypeUser'
75+
? item?.bio
76+
: item?.description
77+
}
78+
>
79+
<Text>
80+
{item.__typename === 'TypeUser'
81+
? item.bio.slice(0, 100) + '...'
82+
: item.description.slice(0, 100) + '...'}
83+
</Text>
84+
</Tooltip>
85+
</div>
86+
)}
7187
</Link>
7288
))}
7389
</div>

app/[locale]/(user)/publishers/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const getAllPublishers: any = graphql(`
1818
... on TypeOrganization {
1919
name
2020
id
21+
description
2122
logo {
2223
url
2324
}
@@ -28,6 +29,7 @@ const getAllPublishers: any = graphql(`
2829
... on TypeUser {
2930
fullName
3031
id
32+
bio
3133
profilePicture {
3234
url
3335
}

0 commit comments

Comments
 (0)