Disabling input fields in preview mode

This commit is contained in:
Peter Zimon 2021-09-02 11:29:05 +02:00
parent c9854b014b
commit 7c3e724874
3 changed files with 6 additions and 2 deletions

View File

@ -54,13 +54,13 @@ export const InputFieldStyles = `
color: var(--grey7);
}
.gh-portal-input:disabled {
.gh-portal-popup-container:not(.preview) .gh-portal-input:disabled {
background: var(--grey13);
color: var(--grey9);
box-shadow: none;
}
.gh-portal-input:disabled::placeholder {
.gh-portal-popup-container:not(.preview) .gh-portal-input:disabled::placeholder {
color: var(--grey9);
}
`;

View File

@ -13,6 +13,7 @@ const FormInput = ({field, onChange, onBlur = () => { }, onKeyDown = () => {}})
type={field.type}
name={field.name}
placeholder={field.placeholder}
disabled={field.disabled}
value={field.value}
onKeyDown={onKeyDown}
onChange={e => onChange(e, field)}

View File

@ -7,6 +7,7 @@ import InputForm from '../common/InputForm';
import {ValidateInputForm} from '../../utils/form';
import {getSiteProducts, getSitePrices, hasMultipleProducts, hasOnlyFreePlan, isInviteOnlySite, getAvailableProducts, hasMultipleProductsFeature} from '../../utils/helpers';
import {ReactComponent as InvitationIcon} from '../../images/icons/invitation.svg';
import {hasMode} from '../../utils/check-mode';
const React = require('react');
@ -345,6 +346,7 @@ class SignupPage extends React.Component {
type: 'email',
value: state.email,
placeholder: 'jamie@example.com',
disabled: (hasMode(['preview']) ? 'disabled' : ''),
label: 'Email',
name: 'email',
required: true,
@ -359,6 +361,7 @@ class SignupPage extends React.Component {
type: 'text',
value: state.name,
placeholder: 'Jamie Larson',
disabled: (hasMode(['preview']) ? 'disabled' : ''),
label: 'Name',
name: 'name',
required: true,