File tree Expand file tree Collapse file tree
clerk-js/src/core/resources
ui/src/components/OrganizationProfile Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @clerk/localizations ' : minor
3+ ' @clerk/clerk-js ' : minor
4+ ' @clerk/shared ' : minor
5+ ' @clerk/ui ' : minor
6+ ---
7+
8+ Add support for rendering the Banned badge in the organization members list.
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export class PublicUserData implements IPublicUserData {
1212 identifier ! : string ;
1313 userId ?: string ;
1414 username ?: string ;
15+ banned ?: boolean ;
1516
1617 constructor ( data : PublicUserDataJSON | PublicUserDataJSONSnapshot ) {
1718 this . fromJSON ( data ) ;
@@ -26,6 +27,7 @@ export class PublicUserData implements IPublicUserData {
2627 this . identifier = data . identifier || '' ;
2728 this . userId = data . user_id ;
2829 this . username = data . username ;
30+ this . banned = data . banned ?? undefined ;
2931 }
3032
3133 return this ;
@@ -40,6 +42,7 @@ export class PublicUserData implements IPublicUserData {
4042 identifier : this . identifier ,
4143 user_id : this . userId ,
4244 username : this . username ,
45+ banned : this . banned ,
4346 } ;
4447 }
4548}
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export const enUS: LocalizationResource = {
6363 badge__upcomingPlan : 'Upcoming' ,
6464 badge__userDevice : 'User device' ,
6565 badge__you : 'You' ,
66+ badge__banned : 'Banned' ,
6667 billing : {
6768 addPaymentMethod__label : 'Add payment method' ,
6869 alwaysFree : 'Always free' ,
Original file line number Diff line number Diff line change @@ -321,6 +321,7 @@ export interface PublicUserDataJSON {
321321 identifier : string ;
322322 user_id ?: string ;
323323 username ?: string ;
324+ banned ?: boolean ;
324325}
325326
326327export interface SessionWithActivitiesJSON extends Omit < SessionJSON , 'user' > {
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ export type __internal_LocalizationResource = {
152152 badge__unverified : LocalizationValue ;
153153 badge__requiresAction : LocalizationValue ;
154154 badge__you : LocalizationValue ;
155+ badge__banned : LocalizationValue ;
155156 badge__freeTrial : LocalizationValue ;
156157 badge__currentPlan : LocalizationValue ;
157158 badge__upcomingPlan : LocalizationValue ;
Original file line number Diff line number Diff line change @@ -336,6 +336,7 @@ export interface PublicUserData {
336336 identifier : string ;
337337 userId ?: string ;
338338 username ?: string ;
339+ banned ?: boolean ;
339340}
340341
341342/**
Original file line number Diff line number Diff line change @@ -95,7 +95,16 @@ const MemberRow = (props: {
9595 user = { membership . publicUserData }
9696 subtitle = { membership . publicUserData ?. identifier }
9797 subtitleProps = { { variant : 'caption' } }
98- badge = { isCurrentUser && < Badge localizationKey = { localizationKeys ( 'badge__you' ) } /> }
98+ badge = {
99+ isCurrentUser ? (
100+ < Badge localizationKey = { localizationKeys ( 'badge__you' ) } />
101+ ) : membership . publicUserData ?. banned ? (
102+ < Badge
103+ colorScheme = 'danger'
104+ localizationKey = { localizationKeys ( 'badge__banned' ) }
105+ />
106+ ) : undefined
107+ }
99108 />
100109 </ Td >
101110 < Td >
You can’t perform that action at this time.
0 commit comments