Skip to content

Commit 15a945c

Browse files
chore(clerk-js,types,localizations): API keys form refactor (#6153)
Co-authored-by: Alex Carpenter <alex.carpenter@clerk.dev>
1 parent 1ce6a5c commit 15a945c

File tree

16 files changed

+328
-213
lines changed

16 files changed

+328
-213
lines changed

.changeset/green-elephants-melt.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@clerk/clerk-js": patch
3+
"@clerk/localizations": patch
4+
"@clerk/types": patch
5+
---
6+
7+
Replace expiration segmented list with dropdown and hide description field in `<APIKeys />` component

packages/clerk-js/bundlewatch.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"files": [
3-
{ "path": "./dist/clerk.js", "maxSize": "610kB" },
3+
{ "path": "./dist/clerk.js", "maxSize": "610.32kB" },
44
{ "path": "./dist/clerk.browser.js", "maxSize": "70.2KB" },
55
{ "path": "./dist/clerk.legacy.browser.js", "maxSize": "113KB" },
66
{ "path": "./dist/clerk.headless*.js", "maxSize": "53.06KB" },
7-
{ "path": "./dist/ui-common*.js", "maxSize": "108.56KB" },
7+
{ "path": "./dist/ui-common*.js", "maxSize": "108.75KB" },
88
{ "path": "./dist/vendors*.js", "maxSize": "40.2KB" },
99
{ "path": "./dist/coinbase*.js", "maxSize": "38KB" },
1010
{ "path": "./dist/createorganization*.js", "maxSize": "5KB" },

packages/clerk-js/src/ui/components/ApiKeys/ApiKeysTable.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,23 @@ export const ApiKeysTable = ({
161161
<Text
162162
variant='caption'
163163
colorScheme='secondary'
164-
>
165-
Created at{' '}
166-
{apiKey.createdAt.toLocaleDateString(undefined, {
167-
month: 'short',
168-
day: '2-digit',
169-
year: 'numeric',
170-
})}
171-
</Text>
164+
localizationKey={
165+
apiKey.expiration
166+
? localizationKeys('apiKeys.createdAndExpirationStatus__expiresOn', {
167+
createdDate: apiKey.createdAt,
168+
expiresDate: apiKey.expiration,
169+
})
170+
: localizationKeys('apiKeys.createdAndExpirationStatus__never', {
171+
createdDate: apiKey.createdAt,
172+
})
173+
}
174+
/>
172175
</Flex>
173176
</Td>
174177
<Td>
175178
<Box
176179
sx={{
177-
[mqu.sm]: {
178-
minWidth: '10ch',
179-
},
180+
minWidth: '10ch',
180181
}}
181182
>
182183
<Text localizationKey={apiKey.lastUsedAt ? timeAgo(apiKey.lastUsedAt) : '-'} />

0 commit comments

Comments
 (0)