mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-22 19:53:49 +01:00
fixes eslint
This commit is contained in:
parent
40e9acc5a8
commit
bbb14eaeb6
@ -30,6 +30,7 @@
|
|||||||
"@typescript-eslint/no-explicit-any": "error",
|
"@typescript-eslint/no-explicit-any": "error",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": "error",
|
"@typescript-eslint/explicit-module-boundary-types": "error",
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": "error",
|
||||||
|
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
|
||||||
"react-hooks/rules-of-hooks": "warn", // Checks rules of Hooks
|
"react-hooks/rules-of-hooks": "warn", // Checks rules of Hooks
|
||||||
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
|
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
|
||||||
"no-restricted-imports": [
|
"no-restricted-imports": [
|
||||||
|
@ -408,16 +408,15 @@ class MockClient implements Client {
|
|||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
wait(ms: number) {
|
wait(ms: number): Promise<number> {
|
||||||
console.log('Start waiting');
|
return new Promise((resolve) => {
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('Done waiting');
|
|
||||||
resolve(ms);
|
resolve(ms);
|
||||||
}, ms);
|
}, ms);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
processGoogleCallback(code: string): Promise<Oauth2CallbackResult> {
|
processGoogleCallback(code: string): Promise<Oauth2CallbackResult> {
|
||||||
// artificial delay for more realistic mock experience
|
// artificial delay for more realistic mock experience
|
||||||
const handler = (success: (result: Oauth2CallbackResult) => void) => {
|
const handler = (success: (result: Oauth2CallbackResult) => void) => {
|
||||||
@ -436,6 +435,7 @@ class MockClient implements Client {
|
|||||||
return new Promise(handler);
|
return new Promise(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
confirmAccountSync(email: string, code: string): Promise<void> {
|
confirmAccountSync(email: string, code: string): Promise<void> {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
@ -659,7 +659,7 @@ export default class RestClient implements Client {
|
|||||||
.put(`${this.baseUrl}/service/users/confirmAccountSync?email=${email}&code=${code}`, {
|
.put(`${this.baseUrl}/service/users/confirmAccountSync?email=${email}&code=${code}`, {
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then(() => {
|
||||||
success();
|
success();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import { Button } from '@mui/material';
|
import { Button } from '@mui/material';
|
||||||
import GoogleIcon from '../google-icon';
|
import GoogleIcon from '../google-icon';
|
||||||
|
|
||||||
const googleButtonStyle = css({
|
const googleButtonStyle = css({
|
||||||
color: '#000000',
|
color: '#000000',
|
||||||
//fontSize: "15px",
|
|
||||||
fontWeight: '300',
|
fontWeight: '300',
|
||||||
border: '1px solid black',
|
border: '1px solid black',
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
@ -12,7 +12,15 @@ const googleButtonStyle = css({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const GoogleButton = ({ text, onClick }) => {
|
type GoogleButtonProps = {
|
||||||
|
text: string;
|
||||||
|
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const GoogleButton: React.FunctionComponent<GoogleButtonProps> = ({
|
||||||
|
text,
|
||||||
|
onClick,
|
||||||
|
}: GoogleButtonProps) => {
|
||||||
return (
|
return (
|
||||||
<Button variant="outlined" css={googleButtonStyle} startIcon={GoogleIcon} onClick={onClick}>
|
<Button variant="outlined" css={googleButtonStyle} startIcon={GoogleIcon} onClick={onClick}>
|
||||||
{text}
|
{text}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import React from 'react';
|
||||||
import { SvgIcon } from '@mui/material';
|
import { SvgIcon } from '@mui/material';
|
||||||
|
|
||||||
const GoogleIconSvg = () => {
|
const GoogleIconSvg = () => {
|
||||||
|
@ -1,7 +1,18 @@
|
|||||||
|
import React from 'react';
|
||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
|
|
||||||
const Separator = ({ responsive, text, maxWidth = undefined }) => {
|
type SeparatorProps = {
|
||||||
|
responsive: boolean;
|
||||||
|
text: string;
|
||||||
|
maxWidth?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Separator: React.FunctionComponent<SeparatorProps> = ({
|
||||||
|
responsive,
|
||||||
|
text,
|
||||||
|
maxWidth = undefined,
|
||||||
|
}: SeparatorProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
const containerStyle = css([
|
const containerStyle = css([
|
||||||
|
@ -21,7 +21,6 @@ const RegistrationCallbackPage = (): React.ReactElement => {
|
|||||||
const [email, setEmail] = useState(undefined);
|
const [email, setEmail] = useState(undefined);
|
||||||
const [syncCode, setSyncCode] = useState(undefined);
|
const [syncCode, setSyncCode] = useState(undefined);
|
||||||
const [googleSync, setGoogleSync] = useState(undefined);
|
const [googleSync, setGoogleSync] = useState(undefined);
|
||||||
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user