@@ -7,6 +7,10 @@ import { Application, GroupTree, GroupsmDetails } from '@/schema/ckan.schema'
7
7
import Link from 'next/link'
8
8
import { useSession } from 'next-auth/react'
9
9
import { api } from '@/utils/api'
10
+ import {
11
+ ArrowTurnLeftUpIcon ,
12
+ ArrowUpRightIcon ,
13
+ } from '@heroicons/react/24/solid'
10
14
11
15
export function Hero ( { application } : { application : Application } ) {
12
16
const { data : session } = useSession ( )
@@ -23,71 +27,61 @@ export function Hero({ application }: { application: Application }) {
23
27
} `}
24
28
className = "object-cover"
25
29
/>
26
- < div className = "absolute bottom-0 z-10 flex lg:h-[68px] lg:w-56 px-4 py-4 items-center justify-center rounded-t-[3px] bg-white" >
30
+ < div className = "absolute bottom-0 z-10 flex lg:h-[68px] lg:w-60 px-4 py-4 items-center justify-center rounded-t-[3px] bg-white" >
27
31
< Link
28
32
href = "/application"
29
- className = "inline-flex items-center justify-center ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-amber-400 text-stone-900 font-bold font-acumin hover:bg-yellow-500 h-11 px-6 py-4 rounded-[3px] text-base"
33
+ className = "whitespace-nowrap inline-flex items-center justify-center ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-amber-400 text-stone-900 font-bold font-acumin hover:bg-yellow-500 h-11 px-6 py-4 rounded-[3px] text-base"
30
34
>
31
35
< ChevronLeftIcon className = "mb-1 lg:mr-1 h-6 w-6" />
32
36
< span > See all applications</ span >
33
37
</ Link >
34
38
</ div >
35
39
</ div >
36
- < div className = "flex flex-col gap-y-1 px-4 py-6 lg:col-span-3" >
40
+ < div className = "flex flex-col justify-center gap-y-1 px-4 py-6 lg:col-span-3" >
37
41
< div className = "text-[33px] font-bold text-black" >
38
42
{ application . title }
39
43
</ div >
40
- < div className = "max-w-[578.85px] text-lg font-light text-black" >
41
- { application ?. description }
42
- </ div >
44
+ < p className = "max-w-[578.85px] text-lg font-light text-black" >
45
+ { application ?. description } { ' ' }
46
+ < a
47
+ href = { application . contact_url }
48
+ target = "_blank"
49
+ rel = "noreferrer"
50
+ className = "underline "
51
+ >
52
+ Contact the { application . title ?? application . name } Team
53
+ </ a >
54
+ </ p >
43
55
< div className = "flex items-center gap-3" >
44
56
< div className = "text-base font-light text-black" >
45
- { application . package_count } Dataset(s)
57
+ { application . package_count } associated dataset
58
+ { application . package_count > 1 ? 's' : '' }
46
59
</ div >
47
60
</ div >
48
- < CopyLink />
61
+ < div className = "flex items-center gap-3" >
62
+ < Button className = "mt-3" >
63
+ < a
64
+ href = { application . homepage_url }
65
+ target = "_blank"
66
+ rel = "noreferrer"
67
+ className = "flex items-center gap-1"
68
+ >
69
+ Open Application{ ' ' }
70
+ < ArrowUpRightIcon className = "h-5 w-5" />
71
+ </ a >
72
+ </ Button >
73
+ < Button className = "mt-3" variant = "outline" >
74
+ < a
75
+ href = { application . help_url }
76
+ target = "_blank"
77
+ rel = "noreferrer"
78
+ className = "flex items-center gap-1"
79
+ >
80
+ Visit Guide < ArrowUpRightIcon className = "h-5 w-5" />
81
+ </ a >
82
+ </ Button >
83
+ </ div >
49
84
</ div >
50
85
</ div >
51
86
)
52
87
}
53
-
54
- function CopyLink ( ) {
55
- const [ clicked , setClicked ] = useState ( false )
56
- return (
57
- < >
58
- { ! clicked ? (
59
- < Button
60
- onClick = { async ( ) => {
61
- await navigator . clipboard . writeText (
62
- window . location . href
63
- )
64
- setClicked ( ! clicked )
65
- setTimeout ( ( ) => {
66
- setClicked ( false )
67
- } , 3000 )
68
- } }
69
- variant = "outline"
70
- className = "mr-auto mt-3"
71
- >
72
- Share application
73
- </ Button >
74
- ) : (
75
- < button
76
- onClick = { ( ) => setClicked ( ! clicked ) }
77
- className = "mt-3 flex h-auto max-w-[578px] gap-2 rounded-sm border border-amber-400 px-5 py-3"
78
- >
79
- < ClipboardDocumentIcon className = "h-6 w-6 text-gray-800" />
80
- < div className = "max-w-[30rem]" >
81
- < p className = "text-start text-sm font-semibold text-black" >
82
- Link copied to clipboard
83
- </ p >
84
- < p className = "text-start text-sm font-light" >
85
- Make sure that the users who you are sharing the
86
- collection with, have permissions to see it.
87
- </ p >
88
- </ div >
89
- </ button >
90
- ) }
91
- </ >
92
- )
93
- }
0 commit comments