Skip to content

Commit fcd716c

Browse files
committed
rename the organisations to organization and fix entitycard render
1 parent 019f734 commit fcd716c

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function OrgDashboardLayout({ children }: DashboardLayoutProps) {
7272
href: '',
7373
label:
7474
(params.entityType === 'organization'
75-
? EntityDetailsQryRes.data?.organisations[0]
75+
? EntityDetailsQryRes.data?.organizations[0]
7676
: EntityDetailsQryRes.data?.dataspaces[0]
7777
)?.name || params.entitySlug,
7878
},
@@ -88,7 +88,7 @@ export default function OrgDashboardLayout({ children }: DashboardLayoutProps) {
8888
items={orgSidebarNav}
8989
entityDetails={
9090
params.entityType === 'organization'
91-
? EntityDetailsQryRes.data?.organisations[0]
91+
? EntityDetailsQryRes.data?.organizations[0]
9292
: EntityDetailsQryRes.data?.dataspaces[0]
9393
}
9494
/>

app/[locale]/dashboard/[entityType]/page.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,16 @@ const Page = () => {
7373
) : (
7474
<div className={cn(styles.Main)}>
7575
<div className="flex flex-wrap gap-24">
76-
{[
77-
...(params.entityType === 'organization'
78-
? allEntitiesList.data.organisations
79-
: allEntitiesList.data.dataspaces),
80-
]?.map((entityItem) => (
81-
<EntityCard
82-
key={entityItem.slug}
83-
entityItem={entityItem}
84-
params={params}
85-
/>
86-
))}
76+
{(params.entityType === 'organization'
77+
? allEntitiesList.data.organizations
78+
: allEntitiesList.data.dataspaces
79+
)?.map((entityItem: any) => {
80+
return (
81+
<div key={entityItem.name}>
82+
<EntityCard entityItem={entityItem} params={params} />
83+
</div>
84+
);
85+
})}
8786
<div className="flex h-72 w-56 flex-col items-center justify-center gap-3 rounded-2 bg-baseGraySlateSolid6 p-4">
8887
<Icon source={Icons.plus} size={40} color="success" />
8988
<Text alignment="center" variant="headingMd">
@@ -100,26 +99,27 @@ const Page = () => {
10099

101100
export default Page;
102101

103-
const EntityCard = ({ key, entityItem, params }: any) => {
102+
const EntityCard = ({ entityItem, params }: any) => {
104103
const [isImageValid, setIsImageValid] = useState(() => {
105-
return entityItem.logo ? true : false;
104+
return entityItem?.logo ? true : false;
106105
});
106+
107107
return (
108108
<div
109-
key={key}
109+
key={entityItem.name}
110110
className="flex h-72 w-56 flex-col items-center gap-3 rounded-2 border-2 border-solid border-baseGraySlateSolid4 px-4 py-5 text-center"
111111
>
112112
<div className="flex h-full w-full items-center justify-center rounded-2">
113113
<Link
114-
href={`/dashboard/${params.entityType}/${entityItem.slug}/dataset`}
114+
href={`/dashboard/${params.entityType}/${entityItem?.slug}/dataset`}
115115
id={entityItem.slug}
116116
>
117117
<div className="border-var(--border-radius-5) rounded-2">
118118
{isImageValid ? (
119119
<Image
120120
height={160}
121121
width={160}
122-
src={`${process.env.NEXT_PUBLIC_BACKEND_URL}${entityItem.logo.url}`}
122+
src={`${process.env.NEXT_PUBLIC_BACKEND_URL}${entityItem?.logo.url}`}
123123
alt={`${entityItem.name} logo`}
124124
onError={() => {
125125
setIsImageValid(false);

0 commit comments

Comments
 (0)