0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Updated site description field to use Textarea

refs. https://github.com/TryGhost/Team/issues/3328
This commit is contained in:
Peter Zimon 2023-05-30 15:40:01 +02:00
parent c9d0424636
commit 30e2924b5e
2 changed files with 8 additions and 8 deletions

View file

@ -19,7 +19,7 @@ interface TextAreaProps {
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
}
const TextArea: React.FC<TextAreaProps> = ({inputRef, title, value, rows = 4, maxLength, resize = 'none', error, placeholder, hint, clearBg = false, onChange, ...props}) => {
const TextArea: React.FC<TextAreaProps> = ({inputRef, title, value, rows = 3, maxLength, resize = 'none', error, placeholder, hint, clearBg = false, onChange, ...props}) => {
let styles = `border-b ${!clearBg && 'bg-grey-100 px-[10px]'} py-2 ${error ? `border-red` : `border-grey-300 hover:border-grey-400 focus:border-grey-600`} ${title && `mt-2`}`;
switch (resize) {

View file

@ -1,6 +1,7 @@
import React from 'react';
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
import SettingGroupContent from '../../../admin-x-ds/settings/SettingGroupContent';
import TextArea from '../../../admin-x-ds/global/TextArea';
import TextField from '../../../admin-x-ds/global/TextField';
import useSettingGroup from '../../../hooks/useSettingGroup';
@ -21,7 +22,7 @@ const TitleAndDescription: React.FC = () => {
updateSetting('title', e.target.value);
};
const handleDescriptionChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const handleDescriptionChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
updateSetting('description', e.target.value);
};
@ -44,7 +45,7 @@ const TitleAndDescription: React.FC = () => {
);
const inputFields = (
<SettingGroupContent columns={2}>
<SettingGroupContent>
<TextField
hint="The name of your site"
inputRef={focusRef}
@ -53,13 +54,12 @@ const TitleAndDescription: React.FC = () => {
value={title}
onChange={handleTitleChange}
/>
<TextField
hint="Used in your theme, meta data and search results"
placeholder="Enter something"
<TextArea
hint="A short description, used in your theme, meta data and search results"
placeholder="Site description"
title="Site description"
value={description}
onChange={handleDescriptionChange}
/>
onChange={handleDescriptionChange} />
</SettingGroupContent>
);