File tree Expand file tree Collapse file tree 4 files changed +22
-11
lines changed
_app.orgs.$organizationSlug.settings._index Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ function ProjectSelector({
304
304
) }
305
305
>
306
306
< span className = "flex items-center gap-1.5 overflow-hidden" >
307
- < Avatar avatar = { organization . avatar } size = { 1.25 } />
307
+ < Avatar avatar = { organization . avatar } size = { 1.25 } orgName = { organization . title } />
308
308
< SelectorDivider />
309
309
< span className = "truncate text-2sm font-normal text-text-bright" >
310
310
{ project . name ?? "Select a project" }
@@ -319,7 +319,7 @@ function ProjectSelector({
319
319
< div className = "flex flex-col gap-2 bg-charcoal-750 p-2" >
320
320
< div className = "flex items-center gap-2.5" >
321
321
< div className = "box-content size-10 overflow-clip rounded-sm bg-charcoal-800" >
322
- < Avatar avatar = { organization . avatar } size = { 2.5 } includePadding />
322
+ < Avatar avatar = { organization . avatar } size = { 2.5 } orgName = { organization . title } />
323
323
</ div >
324
324
< div className = "space-y-0.5" >
325
325
< Paragraph variant = "small/bright" > { organization . title } </ Paragraph >
@@ -483,7 +483,7 @@ function SwitchOrganizations({
483
483
key = { org . id }
484
484
to = { organizationPath ( org ) }
485
485
title = { org . title }
486
- icon = { < Avatar size = { 1 } avatar = { org . avatar } /> }
486
+ icon = { < Avatar size = { 1 } avatar = { org . avatar } orgName = { org . title } /> }
487
487
leadingIconClassName = "text-text-dimmed"
488
488
isSelected = { org . id === organization . id }
489
489
/>
Original file line number Diff line number Diff line change 8
8
} from "@heroicons/react/20/solid" ;
9
9
import { type Prisma } from "@trigger.dev/database" ;
10
10
import { z } from "zod" ;
11
- import { useOrganization } from "~/hooks/useOrganizations" ;
12
11
import { logger } from "~/services/logger.server" ;
13
12
import { cn } from "~/utils/cn" ;
14
13
@@ -54,17 +53,26 @@ export function Avatar({
54
53
avatar,
55
54
size,
56
55
includePadding,
56
+ orgName,
57
57
} : {
58
58
avatar : Avatar ;
59
59
/** Size in rems of the icon */
60
60
size : number ;
61
61
includePadding ?: boolean ;
62
+ orgName : string ;
62
63
} ) {
63
64
switch ( avatar . type ) {
64
65
case "icon" :
65
66
return < AvatarIcon avatar = { avatar } size = { size } includePadding = { includePadding } /> ;
66
67
case "letters" :
67
- return < AvatarLetters avatar = { avatar } size = { size } includePadding = { includePadding } /> ;
68
+ return (
69
+ < AvatarLetters
70
+ avatar = { avatar }
71
+ size = { size }
72
+ includePadding = { includePadding }
73
+ orgName = { orgName }
74
+ />
75
+ ) ;
68
76
case "image" :
69
77
return < AvatarImage avatar = { avatar } size = { size } /> ;
70
78
}
@@ -110,13 +118,14 @@ function AvatarLetters({
110
118
avatar,
111
119
size,
112
120
includePadding,
121
+ orgName,
113
122
} : {
114
123
avatar : LettersAvatar ;
115
124
size : number ;
116
125
includePadding ?: boolean ;
126
+ orgName : string ;
117
127
} ) {
118
- const organization = useOrganization ( ) ;
119
- const letters = organization . title . slice ( 0 , 2 ) ;
128
+ const letters = orgName . slice ( 0 , 2 ) ;
120
129
121
130
const style = {
122
131
backgroundColor : avatar . hex ,
Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ export default function Page() {
374
374
) ;
375
375
}
376
376
377
- function LogoForm ( { organization } : { organization : { avatar : Avatar } } ) {
377
+ function LogoForm ( { organization } : { organization : { avatar : Avatar ; title : string } } ) {
378
378
const navigation = useNavigation ( ) ;
379
379
380
380
const isSubmitting =
@@ -392,7 +392,7 @@ function LogoForm({ organization }: { organization: { avatar: Avatar } }) {
392
392
< Label > Icon</ Label >
393
393
< div className = "flex w-full items-end justify-between gap-2" >
394
394
< div className = "grid place-items-center overflow-hidden rounded-sm border border-charcoal-750 bg-background-bright" >
395
- < Avatar avatar = { avatar } size = { 5 } includePadding />
395
+ < Avatar avatar = { avatar } size = { 5 } includePadding orgName = { organization . title } />
396
396
</ div >
397
397
{ /* Letters */ }
398
398
< Form method = "post" >
@@ -418,6 +418,7 @@ function LogoForm({ organization }: { organization: { avatar: Avatar } }) {
418
418
} }
419
419
size = { 2.5 }
420
420
includePadding
421
+ orgName = { organization . title }
421
422
/>
422
423
</ button >
423
424
</ Form >
@@ -449,6 +450,7 @@ function LogoForm({ organization }: { organization: { avatar: Avatar } }) {
449
450
} }
450
451
size = { 2.5 }
451
452
includePadding
453
+ orgName = { organization . title }
452
454
/>
453
455
</ button >
454
456
</ Form >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default function Story() {
20
20
< h2 className = "mb-4 text-lg font-semibold text-white" > Size 8</ h2 >
21
21
< div className = "flex flex-wrap gap-2" >
22
22
{ avatars . map ( ( avatar , index ) => (
23
- < Avatar key = { `small-${ index } ` } avatar = { avatar } size = { 2 } />
23
+ < Avatar key = { `small-${ index } ` } avatar = { avatar } size = { 2 } orgName = { `Org ${ index } ` } />
24
24
) ) }
25
25
</ div >
26
26
</ div >
@@ -30,7 +30,7 @@ export default function Story() {
30
30
< h2 className = "mb-4 text-lg font-semibold text-white" > Size 12</ h2 >
31
31
< div className = "flex flex-wrap gap-4" >
32
32
{ avatars . map ( ( avatar , index ) => (
33
- < Avatar key = { `large-${ index } ` } avatar = { avatar } size = { 3 } />
33
+ < Avatar key = { `large-${ index } ` } avatar = { avatar } size = { 3 } orgName = { `Org ${ index } ` } />
34
34
) ) }
35
35
</ div >
36
36
</ div >
You can’t perform that action at this time.
0 commit comments