mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Disabling input fields in preview mode
This commit is contained in:
parent
c9854b014b
commit
7c3e724874
3 changed files with 6 additions and 2 deletions
|
@ -54,13 +54,13 @@ export const InputFieldStyles = `
|
||||||
color: var(--grey7);
|
color: var(--grey7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.gh-portal-input:disabled {
|
.gh-portal-popup-container:not(.preview) .gh-portal-input:disabled {
|
||||||
background: var(--grey13);
|
background: var(--grey13);
|
||||||
color: var(--grey9);
|
color: var(--grey9);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gh-portal-input:disabled::placeholder {
|
.gh-portal-popup-container:not(.preview) .gh-portal-input:disabled::placeholder {
|
||||||
color: var(--grey9);
|
color: var(--grey9);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -13,6 +13,7 @@ const FormInput = ({field, onChange, onBlur = () => { }, onKeyDown = () => {}})
|
||||||
type={field.type}
|
type={field.type}
|
||||||
name={field.name}
|
name={field.name}
|
||||||
placeholder={field.placeholder}
|
placeholder={field.placeholder}
|
||||||
|
disabled={field.disabled}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onKeyDown={onKeyDown}
|
onKeyDown={onKeyDown}
|
||||||
onChange={e => onChange(e, field)}
|
onChange={e => onChange(e, field)}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import InputForm from '../common/InputForm';
|
||||||
import {ValidateInputForm} from '../../utils/form';
|
import {ValidateInputForm} from '../../utils/form';
|
||||||
import {getSiteProducts, getSitePrices, hasMultipleProducts, hasOnlyFreePlan, isInviteOnlySite, getAvailableProducts, hasMultipleProductsFeature} from '../../utils/helpers';
|
import {getSiteProducts, getSitePrices, hasMultipleProducts, hasOnlyFreePlan, isInviteOnlySite, getAvailableProducts, hasMultipleProductsFeature} from '../../utils/helpers';
|
||||||
import {ReactComponent as InvitationIcon} from '../../images/icons/invitation.svg';
|
import {ReactComponent as InvitationIcon} from '../../images/icons/invitation.svg';
|
||||||
|
import {hasMode} from '../../utils/check-mode';
|
||||||
|
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
|
|
||||||
|
@ -345,6 +346,7 @@ class SignupPage extends React.Component {
|
||||||
type: 'email',
|
type: 'email',
|
||||||
value: state.email,
|
value: state.email,
|
||||||
placeholder: 'jamie@example.com',
|
placeholder: 'jamie@example.com',
|
||||||
|
disabled: (hasMode(['preview']) ? 'disabled' : ''),
|
||||||
label: 'Email',
|
label: 'Email',
|
||||||
name: 'email',
|
name: 'email',
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -359,6 +361,7 @@ class SignupPage extends React.Component {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
value: state.name,
|
value: state.name,
|
||||||
placeholder: 'Jamie Larson',
|
placeholder: 'Jamie Larson',
|
||||||
|
disabled: (hasMode(['preview']) ? 'disabled' : ''),
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
required: true,
|
required: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue