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:
parent
c6b19a528c
commit
eed52dfc33
2 changed files with 11 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue