Skip to content

Commit 330820c

Browse files
authored
fix: inactive tokens should display greyed out resource card (#3373)
1 parent 0f4672b commit 330820c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/authorizations/components/TokenRow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class TokenRow extends PureComponent<Props> {
5050
<ResourceCard
5151
contextMenu={this.contextMenu}
5252
testID={`token-card ${auth.description}`}
53+
disabled={!this.isTokenEnabled}
5354
>
5455
<ResourceCard.EditableName
5556
onUpdate={this.handleUpdateName}

src/authorizations/components/redesigned/TokenRow.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ class TokensRow extends PureComponent<Props> {
5757
const {description} = this.props.auth
5858
const {auth} = this.props
5959
const date = new Date(auth.createdAt)
60+
6061
return (
6162
<ResourceCard
6263
contextMenu={this.contextMenu}
64+
disabled={!this.isTokenActive}
6365
testID={`token-card ${auth.description}`}
6466
direction={FlexDirection.Row}
6567
justifyContent={JustifyContent.SpaceBetween}
@@ -132,6 +134,11 @@ class TokensRow extends PureComponent<Props> {
132134
)
133135
}
134136

137+
private get isTokenActive(): boolean {
138+
const {auth} = this.props
139+
return auth.status === 'active'
140+
}
141+
135142
private handleDelete = () => {
136143
const {id, description} = this.props.auth
137144
this.props.deleteAuthorization(id, description)

0 commit comments

Comments
 (0)