0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00

feat(console): update jwt create page button text

update jwt create page button text
This commit is contained in:
simeng-li 2024-03-29 17:31:35 +08:00 committed by Darcy Ye
parent c6b19a528c
commit eed52dfc33
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import { type AdminConsoleKey } from '@logto/phrases';
import classNames from 'classnames';
import Button from '@/ds-components/Button';
@ -9,9 +10,16 @@ type Props = {
isSubmitting: boolean;
onSubmit: () => Promise<void>;
onDiscard: () => void;
confirmText?: AdminConsoleKey;
};
function SubmitFormChangesActionBar({ isOpen, isSubmitting, onSubmit, onDiscard }: Props) {
function SubmitFormChangesActionBar({
isOpen,
isSubmitting,
confirmText = 'general.save_changes',
onSubmit,
onDiscard,
}: Props) {
return (
<div className={classNames(styles.container, isOpen && styles.active)}>
<div className={styles.actionBar}>
@ -27,7 +35,7 @@ function SubmitFormChangesActionBar({ isOpen, isSubmitting, onSubmit, onDiscard
isLoading={isSubmitting}
type="primary"
size="medium"
title="general.save_changes"
title={confirmText}
onClick={async () => onSubmit()}
/>
</div>

View file

@ -79,6 +79,7 @@ function MainContent<T extends LogtoJwtTokenPath>({
// Always show the action bar if is the create mode
isOpen={isDirty || action === 'create'}
isSubmitting={isSubmitting}
confirmText={action === 'create' ? 'general.create' : 'general.save_changes'}
onDiscard={
// If the form is in create mode, navigate back to the previous page
action === 'create'