Skip to content

Commit 00acd11

Browse files
committed
don't show custom error if hideError is false; fix error page alignment; wip: universal layout
1 parent d78e8d5 commit 00acd11

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

components/form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ function InputInner ({
574574
onKeyDown={onKeyDownInner}
575575
onChange={onChangeInner}
576576
onBlur={onBlurInner}
577-
isInvalid={!hideError && invalid}
577+
isInvalid={!hideError && invalid} // handle error showing separately
578578
isValid={showValid && meta.initialValue !== meta.value && meta.touched && !meta.error}
579579
/>
580580
{(isClient && clear && field.value && !props.readOnly) &&
@@ -1243,7 +1243,7 @@ export function PasswordInput ({ newPass, qr, copy, readOnly, append, value: ini
12431243

12441244
export function MultiInput ({
12451245
name, label, groupClassName, length = 4, charLength = 1, upperCase, showSequence,
1246-
onChange, autoFocus, inputType = 'text',
1246+
onChange, autoFocus, hideError, inputType = 'text',
12471247
...props
12481248
}) {
12491249
const [inputs, setInputs] = useState(new Array(length).fill(''))
@@ -1325,7 +1325,7 @@ export function MultiInput ({
13251325
/>
13261326
))}
13271327
</div>
1328-
{meta.touched && meta.error && (
1328+
{hideError && meta.touched && meta.error && (
13291329
<BootstrapForm.Control.Feedback type='invalid' className='d-block'>
13301330
{meta.error}
13311331
</BootstrapForm.Control.Feedback>

pages/auth/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function AuthError ({ error }) {
2828
<StaticLayout>
2929
<Image className='rounded-1 shadow-sm' width='500' height='375' src={`${process.env.NEXT_PUBLIC_ASSET_PREFIX}/double.gif`} fluid />
3030
<h2 className='pt-4'>Where did the magic go?</h2>
31-
<h4 className='text-muted pt-2'>Get another magic code by logging in or try again by going back.</h4>
31+
<h4 className='text-muted text-center pt-2'>Get another magic code by logging in or try again by going back.</h4>
3232
<Button
3333
className='align-items-center my-3'
3434
style={{ borderWidth: '2px' }}

pages/email.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ export const MagicCodeForm = ({ onSubmit }) => {
5757
required
5858
upperCase
5959
autoFocus
60-
groupClassName='d-flex justify-content-center w-50 mx-auto gap-2'
60+
groupClassName='d-flex justify-content-center mx-auto gap-2'
6161
inputType='text'
62+
hideError
6263
/>
6364
<SubmitButton variant='primary' className='px-4'>verify</SubmitButton>
6465
</Form>

0 commit comments

Comments
 (0)