File tree Expand file tree Collapse file tree 12 files changed +143
-32
lines changed Expand file tree Collapse file tree 12 files changed +143
-32
lines changed Original file line number Diff line number Diff line change 6
6
import { JobType } from '@prisma/client' ;
7
7
8
8
import { JobTypeLabel } from '~/components/offers/constants' ;
9
+ import CompanyProfileImage from '~/components/shared/CompanyProfileImage' ;
9
10
import type { JobTitleType } from '~/components/shared/JobTitles' ;
10
11
import { getLabelForJobTitleType } from '~/components/shared/JobTitles' ;
11
12
@@ -31,8 +32,13 @@ export default function DashboardProfileCard({
31
32
} : Props ) {
32
33
return (
33
34
< div className = "px-4 py-4 sm:px-6" >
34
- < div className = "flex items-end justify-between" >
35
- < div className = "col-span-1 row-span-3" >
35
+ < div className = "flex justify-between gap-4" >
36
+ < CompanyProfileImage
37
+ alt = { company . name }
38
+ className = "hidden h-10 w-10 object-contain sm:block"
39
+ src = { company . logoUrl }
40
+ />
41
+ < div className = "grow" >
36
42
< h4 className = "font-medium" >
37
43
{ getLabelForJobTitleType ( title as JobTitleType ) } { ' ' }
38
44
{ jobType && < > ({ JobTypeLabel [ jobType ] } )</ > }
@@ -80,4 +86,4 @@ export default function DashboardProfileCard({
80
86
</ div >
81
87
</ div >
82
88
) ;
83
- }
89
+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
} from '@heroicons/react/24/outline' ;
11
11
import { JobType } from '@prisma/client' ;
12
12
13
+ import CompanyProfileImage from '~/components/shared/CompanyProfileImage' ;
13
14
import type { JobTitleType } from '~/components/shared/JobTitles' ;
14
15
import { getLabelForJobTitleType } from '~/components/shared/JobTitles' ;
15
16
@@ -89,8 +90,13 @@ export default function OfferProfileCard({
89
90
function BottomSection ( ) {
90
91
return (
91
92
< div className = "px-4 py-4 sm:px-6" >
92
- < div className = "flex items-end justify-between" >
93
- < div className = "col-span-1 row-span-3" >
93
+ < div className = "flex justify-between gap-4" >
94
+ < CompanyProfileImage
95
+ alt = { company . name }
96
+ className = "hidden h-10 w-10 object-contain sm:block"
97
+ src = { company . logoUrl }
98
+ />
99
+ < div className = "grow" >
94
100
< h4 className = "font-medium" >
95
101
{ getLabelForJobTitleType ( title as JobTitleType ) } { ' ' }
96
102
{ jobType && < > ({ JobTypeLabel [ jobType ] } )</ > }
@@ -125,7 +131,7 @@ export default function OfferProfileCard({
125
131
) }
126
132
</ div >
127
133
</ div >
128
- < div className = "col-span-1 row-span-3 " >
134
+ < div className = "flex flex-col justify-center " >
129
135
< p className = "text-end text-lg font-medium leading-6 text-slate-900" >
130
136
{ jobType === JobType . FULLTIME
131
137
? `${ convertMoneyToString ( income ) } / year`
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { JobType } from '@prisma/client';
9
9
import { JobTypeLabel } from '~/components/offers/constants' ;
10
10
import { InternshipCycleValuesToLabels } from '~/components/offers/InternshipCycles' ;
11
11
import type { OfferDisplayData } from '~/components/offers/types' ;
12
+ import CompanyProfileImage from '~/components/shared/CompanyProfileImage' ;
12
13
13
14
import { getLocationDisplayText } from '~/utils/offers/string' ;
14
15
import { getDurationDisplayText } from '~/utils/offers/time' ;
@@ -21,7 +22,7 @@ export default function OfferCard({
21
22
offer : {
22
23
base,
23
24
bonus,
24
- companyName ,
25
+ company ,
25
26
duration,
26
27
internshipCycle,
27
28
jobTitle,
@@ -40,19 +41,26 @@ export default function OfferCard({
40
41
function UpperSection ( ) {
41
42
return (
42
43
< div className = "px-4 py-5 sm:px-6" >
43
- < div className = "flex justify-between" >
44
- < div >
44
+ < div className = "flex justify-between gap-4" >
45
+ { company && (
46
+ < CompanyProfileImage
47
+ alt = { company . name }
48
+ className = "h-10 w-10 object-contain"
49
+ src = { company . logoUrl }
50
+ />
51
+ ) }
52
+ < div className = "grow" >
45
53
< h3 className = "text-lg font-medium leading-6 text-slate-900" >
46
54
{ jobTitle } { jobType && < > ({ JobTypeLabel [ jobType ] } )</ > }
47
55
</ h3 >
48
56
< div className = "mt-1 flex flex-row flex-wrap sm:mt-0" >
49
- { companyName && (
57
+ { company ?. name != null && (
50
58
< div className = "mr-4 mt-2 flex items-center text-sm text-slate-500" >
51
59
< BuildingOfficeIcon
52
60
aria-hidden = "true"
53
61
className = "mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400"
54
62
/>
55
- { companyName }
63
+ { company ?. name }
56
64
</ div >
57
65
) }
58
66
{ location && (
Original file line number Diff line number Diff line change @@ -34,10 +34,21 @@ function ProfileOffers({ offers }: ProfileOffersProps) {
34
34
}
35
35
36
36
return (
37
- < div className = "space-y-4 p-4" >
38
- { offers . map ( ( offer ) => (
39
- < OfferCard key = { offer . id } offer = { offer } />
40
- ) ) }
37
+ < div className = "p-4" >
38
+ < div className = "space-y-4" >
39
+ { offers . map ( ( offer ) => (
40
+ < OfferCard key = { offer . id } offer = { offer } />
41
+ ) ) }
42
+ </ div >
43
+ < div className = "mt-1 text-end" >
44
+ < a
45
+ className = "text-xs text-slate-500"
46
+ href = "https://clearbit.com"
47
+ rel = "noreferrer"
48
+ target = "_blank" >
49
+ Logos provided by Clearbit
50
+ </ a >
51
+ </ div >
41
52
</ div >
42
53
) ;
43
54
}
@@ -140,6 +151,15 @@ function ProfileAnalysis({
140
151
/>
141
152
</ div >
142
153
) }
154
+ < div className = "text-end" >
155
+ < a
156
+ className = "text-xs text-slate-500"
157
+ href = "https://clearbit.com"
158
+ rel = "noreferrer"
159
+ target = "_blank" >
160
+ Logos provided by Clearbit
161
+ </ a >
162
+ </ div >
143
163
</ div >
144
164
) ;
145
165
}
@@ -188,5 +208,6 @@ export default function ProfileDetails({
188
208
/>
189
209
) ;
190
210
}
211
+
191
212
return null ;
192
213
}
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ export default function ProfileHeader({
243
243
< h2 className = "flex text-2xl font-bold" >
244
244
{ profileName ?? 'anonymous' }
245
245
</ h2 >
246
- { ( experiences [ 0 ] ?. companyName ||
246
+ { ( experiences [ 0 ] ?. company ?. name ||
247
247
experiences [ 0 ] ?. jobLevel ||
248
248
experiences [ 0 ] ?. jobTitle ) && (
249
249
< div className = "flex items-center text-sm text-slate-600" >
@@ -252,7 +252,7 @@ export default function ProfileHeader({
252
252
</ span >
253
253
< p >
254
254
< span className = "mr-2 font-bold" > Current:</ span >
255
- { `${ experiences [ 0 ] . companyName || '' } ${
255
+ { `${ experiences [ 0 ] . company ?. name || '' } ${
256
256
experiences [ 0 ] . jobLevel || ''
257
257
} ${ experiences [ 0 ] . jobTitle || '' } ${
258
258
experiences [ 0 ] . jobType
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import clsx from 'clsx';
2
2
import Link from 'next/link' ;
3
3
import { JobType } from '@prisma/client' ;
4
4
5
+ import CompanyProfileImage from '~/components/shared/CompanyProfileImage' ;
5
6
import type { JobTitleType } from '~/components/shared/JobTitles' ;
6
7
import { getLabelForJobTitleType } from '~/components/shared/JobTitles' ;
7
8
@@ -34,10 +35,19 @@ export default function OfferTableRow({
34
35
} : OfferTableRowProps ) {
35
36
return (
36
37
< tr key = { id } className = "divide-x divide-slate-200 border-b bg-white" >
37
- < td className = "space-y-0.5 py-2 px-4" scope = "row" >
38
- < div className = "font-medium" > { company . name } </ div >
39
- < div className = "text-xs text-slate-500" >
40
- { location . cityName } ({ location . countryCode } )
38
+ < td className = "flex items-center gap-3 space-y-0.5 py-2 px-4" scope = "row" >
39
+ < CompanyProfileImage
40
+ alt = { company . name }
41
+ className = "hidden h-6 w-6 object-contain sm:block"
42
+ src = { company . logoUrl }
43
+ />
44
+ < div >
45
+ < div className = "line-clamp-2 sm:line-clamp-1 font-medium" >
46
+ { company . name }
47
+ </ div >
48
+ < div className = "text-xs text-slate-500" >
49
+ { location . cityName } ({ location . countryCode } )
50
+ </ div >
41
51
</ div >
42
52
</ td >
43
53
< td className = "py-2 px-4" >
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import type { JobType } from '@prisma/client';
2
2
3
3
import type { MonthYear } from '~/components/shared/MonthYearPicker' ;
4
4
5
+ import type { OffersCompany } from '../../types/offers' ;
6
+
5
7
import type { Location } from '~/types/offers' ;
6
8
7
9
/**
@@ -177,7 +179,7 @@ export type EducationDisplayData = {
177
179
export type OfferDisplayData = {
178
180
base ?: string | null ;
179
181
bonus ?: string | null ;
180
- companyName ?: string | null ;
182
+ company ?: OffersCompany | null ;
181
183
duration ?: number | null ;
182
184
id ?: string ;
183
185
internshipCycle ?: string ;
Original file line number Diff line number Diff line change
1
+ import clsx from 'clsx' ;
2
+ import { useState } from 'react' ;
3
+ import { BuildingOffice2Icon } from '@heroicons/react/24/outline' ;
4
+ type Props = Readonly < {
5
+ alt : string ;
6
+ className : string ;
7
+ src : string ;
8
+ } > ;
9
+
10
+ export default function CompanyProfileImage ( { alt, className, src } : Props ) {
11
+ const [ hasError , setHasError ] = useState ( false ) ;
12
+
13
+ return hasError ? (
14
+ < div
15
+ className = { clsx (
16
+ 'shrink-0 rounded bg-slate-50 p-0.5 text-slate-400' ,
17
+ className ,
18
+ ) } >
19
+ < BuildingOffice2Icon />
20
+ </ div >
21
+ ) : (
22
+ < img
23
+ alt = { alt }
24
+ className = { clsx ( 'object-contain' , className ) }
25
+ src = { src }
26
+ onError = { ( ) => {
27
+ setHasError ( true ) ;
28
+ } }
29
+ />
30
+ ) ;
31
+ }
Original file line number Diff line number Diff line change @@ -85,20 +85,29 @@ export default function ProfilesDashboard() {
85
85
{ ! userProfilesQuery . isLoading && (
86
86
< div className = "overflow-y-auto py-8" >
87
87
< h1 className = "mx-auto mb-4 text-start text-4xl font-bold text-slate-900" >
88
- My dashboard
88
+ Dashboard
89
89
</ h1 >
90
90
< p className = "mt-4 text-xl leading-8 text-slate-500" >
91
- Save your offer profiles to your dashboard to easily access and
92
- edit them later.
91
+ Save offer profiles to your dashboard to easily access and edit
92
+ them later.
93
93
</ p >
94
- < div className = "mt-8 flex justify-center " >
94
+ < div className = "mt-8" >
95
95
< ul className = "w-full space-y-4" role = "list" >
96
96
{ userProfiles ?. map ( ( profile ) => (
97
97
< li key = { profile . id } >
98
98
< DashboardProfileCard key = { profile . id } profile = { profile } />
99
99
</ li >
100
100
) ) }
101
101
</ ul >
102
+ < div className = "mt-2 text-end" >
103
+ < a
104
+ className = "text-xs text-slate-500"
105
+ href = "https://clearbit.com"
106
+ rel = "noreferrer"
107
+ target = "_blank" >
108
+ Logos provided by Clearbit
109
+ </ a >
110
+ </ div >
102
111
</ div >
103
112
</ div >
104
113
) }
Original file line number Diff line number Diff line change @@ -186,6 +186,15 @@ export default function OffersHomePage({
186
186
selectedSortType = { selectedSortType }
187
187
onSort = { onSort }
188
188
/>
189
+ < div className = "mt-1 text-end" >
190
+ < a
191
+ className = "text-xs text-slate-500"
192
+ href = "https://clearbit.com"
193
+ rel = "noreferrer"
194
+ target = "_blank" >
195
+ Logos provided by Clearbit
196
+ </ a >
197
+ </ div >
189
198
</ Container >
190
199
</ main >
191
200
</ >
You can’t perform that action at this time.
0 commit comments