Skip to content

Commit 09bd73e

Browse files
committed
Update index.tsx
1 parent 4e57e7b commit 09bd73e

1 file changed

Lines changed: 16 additions & 21 deletions

File tree

  • packages/clerk-js/src/ui/components/devPrompts/KeylessPrompt

packages/clerk-js/src/ui/components/devPrompts/KeylessPrompt/index.tsx

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -253,32 +253,27 @@ type ResolvedContent = {
253253
export function getResolvedContent(state: STATES, context: ResolvedContentContext): ResolvedContent {
254254
const content = CONTENT[state];
255255

256-
// Resolve description (static or function-based)
257256
const description =
258257
typeof content.description === 'function'
259258
? content.description({ appName: context.appName, instanceUrl: context.instanceUrl })
260259
: content.description;
261260

262-
// Resolve CTA based on kind
263-
let cta: ResolvedContent['cta'];
264-
if (content.cta.kind === 'link') {
265-
const linkCta = content.cta;
266-
cta = {
267-
kind: 'link',
268-
text: linkCta.text,
269-
href:
270-
typeof linkCta.href === 'function'
271-
? linkCta.href({ claimUrl: context.claimUrl, instanceUrl: context.instanceUrl })
272-
: linkCta.href,
273-
};
274-
} else {
275-
const actionCta = content.cta;
276-
cta = {
277-
kind: 'action',
278-
text: actionCta.text,
279-
onClick: () => actionCta.onClick(context.onDismiss),
280-
};
281-
}
261+
const ctaItem = content.cta;
262+
const cta: ResolvedContent['cta'] =
263+
ctaItem.kind === 'link'
264+
? {
265+
kind: 'link',
266+
text: ctaItem.text,
267+
href:
268+
typeof ctaItem.href === 'function'
269+
? ctaItem.href({ claimUrl: context.claimUrl, instanceUrl: context.instanceUrl })
270+
: ctaItem.href,
271+
}
272+
: {
273+
kind: 'action',
274+
text: ctaItem.text,
275+
onClick: () => ctaItem.onClick(context.onDismiss),
276+
};
282277

283278
return {
284279
state,

0 commit comments

Comments
 (0)