mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Hide save button in setting groups in Admin X
refs. https://github.com/TryGhost/Team/issues/3150 Save button is not necessary until a value is changed.
This commit is contained in:
parent
ece42c7e26
commit
07919f2fbe
1 changed files with 15 additions and 10 deletions
|
@ -5,7 +5,7 @@ import SettingGroupHeader from '../../../admin-x-ds/settings/SettingGroupHeader'
|
|||
import SettingGroupInputs from '../../../admin-x-ds/settings/SettingGroupInputs';
|
||||
import SettingGroupValues from '../../../admin-x-ds/settings/SettingGroupValues';
|
||||
import TextField from '../../../admin-x-ds/global/TextField';
|
||||
import {ButtonColors} from '../../../admin-x-ds/global/Button';
|
||||
import {ButtonColors, IButton} from '../../../admin-x-ds/global/Button';
|
||||
import {TSettingGroupStates} from '../../../admin-x-ds/settings/SettingGroup';
|
||||
|
||||
const TitleAndDescription: React.FC = () => {
|
||||
|
@ -48,20 +48,25 @@ const TitleAndDescription: React.FC = () => {
|
|||
}
|
||||
];
|
||||
|
||||
const editButtons = [
|
||||
let editButtons: IButton[] = [
|
||||
{
|
||||
label: 'Cancel',
|
||||
key: 'cancel',
|
||||
onClick: handleCancelClick
|
||||
},
|
||||
{
|
||||
label: 'Save',
|
||||
key: 'save',
|
||||
disabled: !isEdited,
|
||||
color: ButtonColors.Green
|
||||
}
|
||||
];
|
||||
|
||||
if (isEdited) {
|
||||
editButtons.push(
|
||||
{
|
||||
label: 'Save',
|
||||
key: 'save',
|
||||
disabled: !isEdited,
|
||||
color: ButtonColors.Green
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const viewValues = [
|
||||
{
|
||||
heading: 'Site title',
|
||||
|
@ -78,7 +83,7 @@ const TitleAndDescription: React.FC = () => {
|
|||
const inputFields = (
|
||||
<SettingGroupInputs columns={2}>
|
||||
<TextField
|
||||
help="The name of your site"
|
||||
hint="The name of your site"
|
||||
inputRef={siteTitleRef}
|
||||
placeholder="Site title"
|
||||
title="Site title"
|
||||
|
@ -86,7 +91,7 @@ const TitleAndDescription: React.FC = () => {
|
|||
onChange={handleTitleChange}
|
||||
/>
|
||||
<TextField
|
||||
help="Used in your theme, meta data and search results"
|
||||
hint="Used in your theme, meta data and search results"
|
||||
placeholder="Enter something"
|
||||
title="Site description"
|
||||
value={siteDescription}
|
||||
|
|
Loading…
Add table
Reference in a new issue