diff --git a/ghost/admin-x-settings/src/admin-x-ds/settings/SettingGroup.tsx b/ghost/admin-x-settings/src/admin-x-ds/settings/SettingGroup.tsx index 9f53cb10ef..907a0dc7fc 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/settings/SettingGroup.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/settings/SettingGroup.tsx @@ -54,7 +54,7 @@ const SettingGroup: React.FC = ({ switch (state) { case 'edit': - styles = 'border-grey-500'; + styles = 'border-grey-300'; break; case 'unsaved': diff --git a/ghost/admin-x-settings/src/components/settings/general/GeneralSettings.tsx b/ghost/admin-x-settings/src/components/settings/general/GeneralSettings.tsx index cae24cbd56..1096870d05 100644 --- a/ghost/admin-x-settings/src/components/settings/general/GeneralSettings.tsx +++ b/ghost/admin-x-settings/src/components/settings/general/GeneralSettings.tsx @@ -1,6 +1,7 @@ import React from 'react'; import LockSite from './LockSite'; +import Metadata from './Metadata'; import PublicationLanguage from './PublicationLanguage'; import SettingSection from '../../../admin-x-ds/settings/SettingSection'; import SocialAccounts from './SocialAccounts'; @@ -15,6 +16,7 @@ const GeneralSettings: React.FC = () => { + diff --git a/ghost/admin-x-settings/src/components/settings/general/Metadata.tsx b/ghost/admin-x-settings/src/components/settings/general/Metadata.tsx new file mode 100644 index 0000000000..a98473afe0 --- /dev/null +++ b/ghost/admin-x-settings/src/components/settings/general/Metadata.tsx @@ -0,0 +1,70 @@ +import React from 'react'; +import SettingGroup from '../../../admin-x-ds/settings/SettingGroup'; +import SettingGroupContent from '../../../admin-x-ds/settings/SettingGroupContent'; +import TextField from '../../../admin-x-ds/global/TextField'; +import useSettingGroup from '../../../hooks/useSettingGroup'; + +const Metadata: React.FC = () => { + const { + currentState, + focusRef, + handleSave, + handleCancel, + updateSetting, + getSettingValues, + handleStateChange + } = useSettingGroup(); + + const [metaTitle, metaDescription] = getSettingValues(['meta_title', 'meta_description']) as string[]; + + const handleTitleChange = (e: React.ChangeEvent) => { + updateSetting('meta_title', e.target.value); + }; + + const handleDescriptionChange = (e: React.ChangeEvent) => { + updateSetting('meta_description', e.target.value); + }; + + const values = ( +
+ [TBD: search engine preview in view mode] +
+ ); + + const inputFields = ( + + + + + ); + + return ( + + {values} + {currentState !== 'view' ? inputFields : ''} + + ); +}; + +export default Metadata; \ No newline at end of file