sforkowany z mirror/soapbox
SoapboxConfig: improve layout
rodzic
f5039b9877
commit
b0e60bb60d
|
@ -11,7 +11,9 @@ import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures } from 'soap
|
||||||
import { normalizeAccount } from 'soapbox/normalizers';
|
import { normalizeAccount } from 'soapbox/normalizers';
|
||||||
import resizeImage from 'soapbox/utils/resize_image';
|
import resizeImage from 'soapbox/utils/resize_image';
|
||||||
|
|
||||||
import { Button, Column, Form, FormActions, FormGroup, Input, Textarea, HStack } from '../../components/ui';
|
import { Button, Column, Form, FormActions, FormGroup, Input, Textarea } from '../../components/ui';
|
||||||
|
import HStack from '../../components/ui/hstack/hstack';
|
||||||
|
import Stack from '../../components/ui/stack/stack';
|
||||||
import Streamfield, { StreamfieldComponent } from '../../components/ui/streamfield/streamfield';
|
import Streamfield, { StreamfieldComponent } from '../../components/ui/streamfield/streamfield';
|
||||||
|
|
||||||
import ProfilePreview from './components/profile-preview';
|
import ProfilePreview from './components/profile-preview';
|
||||||
|
@ -394,7 +396,7 @@ const EditProfile: React.FC = () => {
|
||||||
|
|
||||||
{/* HACK: wrap these checkboxes in a .simple_form container so they get styled (for now) */}
|
{/* HACK: wrap these checkboxes in a .simple_form container so they get styled (for now) */}
|
||||||
{/* Need a either move, replace, or refactor these checkboxes. */}
|
{/* Need a either move, replace, or refactor these checkboxes. */}
|
||||||
<div className='simple_form'>
|
<Stack space={2} className='simple_form'>
|
||||||
{features.followRequests && (
|
{features.followRequests && (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
label={<FormattedMessage id='edit_profile.fields.locked_label' defaultMessage='Lock account' />}
|
label={<FormattedMessage id='edit_profile.fields.locked_label' defaultMessage='Lock account' />}
|
||||||
|
@ -448,7 +450,7 @@ const EditProfile: React.FC = () => {
|
||||||
onChange={handleCheckboxChange('accepts_email_list')}
|
onChange={handleCheckboxChange('accepts_email_list')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</Stack>
|
||||||
|
|
||||||
{features.profileFields && (
|
{features.profileFields && (
|
||||||
<Streamfield
|
<Streamfield
|
||||||
|
|
|
@ -6,9 +6,10 @@ import { updateConfig } from 'soapbox/actions/admin';
|
||||||
import { uploadMedia } from 'soapbox/actions/media';
|
import { uploadMedia } from 'soapbox/actions/media';
|
||||||
import snackbar from 'soapbox/actions/snackbar';
|
import snackbar from 'soapbox/actions/snackbar';
|
||||||
import { Column, Form, FormActions, FormGroup, Input, Button } from 'soapbox/components/ui';
|
import { Column, Form, FormActions, FormGroup, Input, Button } from 'soapbox/components/ui';
|
||||||
|
import HStack from 'soapbox/components/ui/hstack/hstack';
|
||||||
|
import Stack from 'soapbox/components/ui/stack/stack';
|
||||||
import Streamfield from 'soapbox/components/ui/streamfield/streamfield';
|
import Streamfield from 'soapbox/components/ui/streamfield/streamfield';
|
||||||
import {
|
import {
|
||||||
FieldsGroup,
|
|
||||||
SimpleTextarea,
|
SimpleTextarea,
|
||||||
FileChooserLogo,
|
FileChooserLogo,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
|
@ -179,11 +180,11 @@ const SoapboxConfig: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<Column label={intl.formatMessage(messages.heading)}>
|
<Column label={intl.formatMessage(messages.heading)}>
|
||||||
<Form onSubmit={handleSubmit} className='simple_form space-y-4'>
|
<Form onSubmit={handleSubmit} className='simple_form space-y-4'>
|
||||||
<fieldset className='space-y-4' disabled={isLoading}>
|
<fieldset className='space-y-6' disabled={isLoading}>
|
||||||
<SitePreview soapbox={soapbox} />
|
<SitePreview soapbox={soapbox} />
|
||||||
<FieldsGroup>
|
|
||||||
<div className='fields-row file-picker'>
|
<HStack space={2}>
|
||||||
<div className='fields-row__column fields-row__column-6'>
|
<Stack space={2} className='w-1/2'>
|
||||||
<ColorWithPicker
|
<ColorWithPicker
|
||||||
buttonId='brand_color'
|
buttonId='brand_color'
|
||||||
label={<FormattedMessage id='soapbox_config.fields.brand_color_label' defaultMessage='Brand color' />}
|
label={<FormattedMessage id='soapbox_config.fields.brand_color_label' defaultMessage='Brand color' />}
|
||||||
|
@ -207,17 +208,17 @@ const SoapboxConfig: React.FC = () => {
|
||||||
/> */}
|
/> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Stack>
|
||||||
<div className='fields-row__column fields-group fields-row__column-6'>
|
|
||||||
|
<Stack className='w-1/2'>
|
||||||
<FileChooserLogo
|
<FileChooserLogo
|
||||||
label={<FormattedMessage id='soapbox_config.fields.logo_label' defaultMessage='Logo' />}
|
label={<FormattedMessage id='soapbox_config.fields.logo_label' defaultMessage='Logo' />}
|
||||||
name='logo'
|
name='logo'
|
||||||
hint={<FormattedMessage id='soapbox_config.hints.logo' defaultMessage='SVG. At most 2 MB. Will be displayed to 50px height, maintaining aspect ratio' />}
|
hint={<FormattedMessage id='soapbox_config.hints.logo' defaultMessage='SVG. At most 2 MB. Will be displayed to 50px height, maintaining aspect ratio' />}
|
||||||
onChange={handleFileChange(['logo'])}
|
onChange={handleFileChange(['logo'])}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
</div>
|
</HStack>
|
||||||
</FieldsGroup>
|
|
||||||
|
|
||||||
<FormGroup labelText={intl.formatMessage(messages.copyrightFooterLabel)}>
|
<FormGroup labelText={intl.formatMessage(messages.copyrightFooterLabel)}>
|
||||||
<Input
|
<Input
|
||||||
|
@ -228,7 +229,7 @@ const SoapboxConfig: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<FieldsGroup>
|
<Stack space={2}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name='verifiedCanEditName'
|
name='verifiedCanEditName'
|
||||||
label={intl.formatMessage(messages.verifiedCanEditNameLabel)}
|
label={intl.formatMessage(messages.verifiedCanEditNameLabel)}
|
||||||
|
@ -271,7 +272,7 @@ const SoapboxConfig: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FieldsGroup>
|
</Stack>
|
||||||
|
|
||||||
<Streamfield
|
<Streamfield
|
||||||
label={<FormattedMessage id='soapbox_config.fields.promo_panel_fields_label' defaultMessage='Promo panel items' />}
|
label={<FormattedMessage id='soapbox_config.fields.promo_panel_fields_label' defaultMessage='Promo panel items' />}
|
||||||
|
|
|
@ -36,10 +36,6 @@ code {
|
||||||
|
|
||||||
.simple_form {
|
.simple_form {
|
||||||
.input {
|
.input {
|
||||||
+ .input {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.hidden {
|
&.hidden {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue