Skip to content

Commit b366138

Browse files
committed
description and collabrative card
1 parent 7b8657c commit b366138

3 files changed

Lines changed: 22 additions & 53 deletions

File tree

app/[locale]/(user)/collaboratives/CollaborativesListingClient.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ const CollaborativesListingClient = () => {
300300
title={collaborative.title || ''}
301301
variation="collapsed"
302302
iconColor="warning"
303+
imageUrl={`${process.env.NEXT_PUBLIC_BACKEND_URL}/${collaborative.logo?.path.replace('/code/files/', '')}`}
303304
metadataContent={[
304305
{
305306
icon: Icons.calendar as any,
@@ -343,7 +344,7 @@ const CollaborativesListingClient = () => {
343344
label: 'Published by',
344345
},
345346
]}
346-
description={`rest ${stripMarkdown(collaborative.summary || '')}`}
347+
description={stripMarkdown(collaborative.summary || '')}
347348
/>
348349
)
349350
)}

app/[locale]/(user)/components/Content.tsx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client';
22

3-
import { graphql } from '@/gql';
4-
import { useQuery } from '@tanstack/react-query';
53
import Image from 'next/image';
64
import Link from 'next/link';
75
import { useRouter } from 'next/navigation';
6+
import { graphql } from '@/gql';
7+
import { useTourTrigger } from '@/hooks/use-tour-trigger';
8+
import { useQuery } from '@tanstack/react-query';
89
import { SearchInput, Spinner, Text } from 'opub-ui';
910

10-
import { useTourTrigger } from '@/hooks/use-tour-trigger';
1111
import { GraphQL } from '@/lib/api';
1212
import { cn } from '@/lib/utils';
1313
import Styles from '../page.module.scss';
@@ -24,13 +24,12 @@ const statsInfo: any = graphql(`
2424
}
2525
`);
2626

27-
2827
export const Content = () => {
2928
const router = useRouter();
30-
29+
3130
// Enable tour for first-time users
3231
useTourTrigger(true, 1500);
33-
32+
3433
const Stats: { data: any; isLoading: any } = useQuery([`statsDetails`], () =>
3534
GraphQL(statsInfo, {}, [])
3635
);
@@ -64,17 +63,25 @@ export const Content = () => {
6463
},
6564
];
6665

67-
6866
return (
6967
<main className="container py-10 md:px-8 lg:py-20">
7068
<div className="flex justify-around gap-8 px-4 md:px-12 lg:px-12">
7169
<div className="flex flex-col gap-11 lg:w-[60%]">
7270
<div className="flex flex-col gap-2">
73-
<Text variant="heading3xl" color="onBgDefault" className='text-textOnBGDefault1'>
71+
<Text
72+
variant="heading3xl"
73+
color="onBgDefault"
74+
className="text-textOnBGDefault1"
75+
>
7476
An Open-Source Platform for Collaborative Data-Driven Change
7577
</Text>
76-
<Text variant="headingLg" color="onBgDefault" className='text-textOnBGDefault2'>
77-
Share datasets, knowledge resources, and AI use-cases for data changemakers.
78+
<Text
79+
variant="headingLg"
80+
color="onBgDefault"
81+
className="text-textOnBGDefault2"
82+
>
83+
Share datasets, knowledge resources, and AI use-cases for data
84+
changemakers.
7885
</Text>
7986
</div>
8087
<div className="w-full" data-tour="search-bar">
@@ -115,7 +122,7 @@ export const Content = () => {
115122
<Text
116123
color="onBgDefault"
117124
fontWeight="semibold"
118-
className="uppercase text-xs text-textSurfaceStats"
125+
className="text-xs uppercase text-textSurfaceStats"
119126
>
120127
{item.label}
121128
</Text>
@@ -124,7 +131,7 @@ export const Content = () => {
124131
))}
125132
</div>
126133
)}
127-
134+
128135
{/* <div className="flex flex-wrap gap-4">
129136
{Sectors.map((item, index) => (
130137
<div key={index}>

app/[locale]/(user)/components/ListingComponent.tsx

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,7 @@ import {
2828
} from '@/components/loading';
2929
import Filter from '../datasets/components/FIlter/Filter';
3030
import Styles from '../datasets/dataset.module.scss';
31-
32-
// Helper function to strip markdown and HTML tags for card preview
33-
const stripMarkdown = (markdown: string): string => {
34-
if (!markdown) return '';
35-
return (
36-
markdown
37-
// Remove code blocks first (before other replacements)
38-
.replace(/```[\s\S]*?```/g, '')
39-
// Remove inline code
40-
.replace(/`([^`]+)`/g, '$1')
41-
// Remove images
42-
.replace(/!\[([^\]]*)\]\([^)]+\)/g, '$1')
43-
// Remove links
44-
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
45-
// Remove headers
46-
.replace(/^#{1,6}\s+/gm, '')
47-
// Remove bold
48-
.replace(/\*\*([^*]+)\*\*/g, '$1')
49-
.replace(/__([^_]+)__/g, '$1')
50-
// Remove italic
51-
.replace(/\*([^*]+)\*/g, '$1')
52-
.replace(/_([^_]+)_/g, '$1')
53-
// Remove strikethrough
54-
.replace(/~~([^~]+)~~/g, '$1')
55-
// Remove blockquotes
56-
.replace(/^\s*>\s+/gm, '')
57-
// Remove horizontal rules
58-
.replace(/^(-{3,}|_{3,}|\*{3,})$/gm, '')
59-
// Remove list markers
60-
.replace(/^\s*[-*+]\s+/gm, '')
61-
.replace(/^\s*\d+\.\s+/gm, '')
62-
// Remove HTML tags
63-
.replace(/<[^>]*>/g, '')
64-
// Remove extra whitespace and newlines
65-
.replace(/\n\s*\n/g, '\n')
66-
.replace(/\n/g, ' ')
67-
.replace(/\s+/g, ' ')
68-
.trim()
69-
);
70-
};
31+
import { stripMarkdown } from '../search/components/UnifiedListingComponent';
7132

7233
// Interfaces
7334
interface Bucket {

0 commit comments

Comments
 (0)