feat: show error message in larger space

This commit is contained in:
tiddlygit-test 2021-04-29 23:12:55 +08:00
parent 8586e30411
commit 76b0cc2f6b
4 changed files with 16 additions and 25 deletions

View file

@ -1,20 +1,14 @@
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
import React from 'react';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { Typography, Button, LinearProgress, Snackbar } from '@material-ui/core';
import { Typography, LinearProgress, Snackbar } from '@material-ui/core';
import Alert from '@material-ui/lab/Alert';
import type { IWikiWorkspaceFormProps } from './useForm';
import { useValidateCloneWiki, useCloneWiki } from './useCloneWiki';
import { useWikiCreationProgress } from './useIndicator';
import { WikiLocation } from './FormComponents';
const CloseButton = styled(Button)`
white-space: nowrap;
width: 100%;
`;
import { WikiLocation, CloseButton } from './FormComponents';
export function CloneWikiDoneButton({ form, isCreateMainWorkspace }: IWikiWorkspaceFormProps & { isCreateMainWorkspace: boolean }): JSX.Element {
const { t } = useTranslation();

View file

@ -1,19 +1,13 @@
import React from 'react';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { Typography, Button, LinearProgress, Snackbar } from '@material-ui/core';
import { Typography, LinearProgress, Snackbar } from '@material-ui/core';
import Alert from '@material-ui/lab/Alert';
import type { IWikiWorkspaceFormProps } from './useForm';
import { useValidateExistedWiki, useExistedWiki } from './useExistedWiki';
import { useWikiCreationProgress } from './useIndicator';
import { WikiLocation } from './FormComponents';
const CloseButton = styled(Button)`
white-space: nowrap;
width: 100%;
`;
import { WikiLocation, CloseButton } from './FormComponents';
export function ExistedWikiDoneButton({
form,

View file

@ -1,4 +1,4 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';
import { Paper, Button, TextField, Autocomplete, Typography } from '@material-ui/core';
export const CreateContainer = styled(Paper)`
@ -18,6 +18,15 @@ export const LocationPickerButton = styled(Button)`
white-space: nowrap;
width: fit-content;
`;
export const CloseButton = styled(Button)`
${({ disabled }) =>
disabled === true
? ''
: css`
white-space: nowrap;
`}
width: 100%;
`;
LocationPickerButton.defaultProps = {
variant: 'contained',
color: 'inherit',

View file

@ -1,20 +1,14 @@
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
import React from 'react';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { Typography, Button, LinearProgress, Snackbar } from '@material-ui/core';
import { Typography, LinearProgress, Snackbar } from '@material-ui/core';
import Alert from '@material-ui/lab/Alert';
import type { IWikiWorkspaceFormProps } from './useForm';
import { useValidateNewWiki, useNewWiki } from './useNewWiki';
import { useWikiCreationProgress } from './useIndicator';
import { WikiLocation } from './FormComponents';
const CloseButton = styled(Button)`
white-space: nowrap;
width: 100%;
`;
import { WikiLocation, CloseButton } from './FormComponents';
export function NewWikiDoneButton({
form,