Fix lint errors

This commit is contained in:
Aarni Halinen
2021-02-11 10:35:52 +02:00
parent 0eadc7d466
commit d4d4fb5d0a
26 changed files with 37 additions and 39 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import styled from "styled-components";
import AccordionIcon from "./AccordionIcon";
import { colors } from "@theme/colors";
import AccordionIcon from "./AccordionIcon";
const Container = styled.div`
margin: 0.2em;
@@ -38,7 +38,7 @@ const Container = styled.div`
}
`;
const Panel = styled.div<{visible?: boolean}>`
const Panel = styled.div<{ visible?: boolean }>`
margin-top: ${(p) => (p.visible ? "0" : "-100%")};
display: flex;
+1 -1
View File
@@ -22,7 +22,7 @@ const StyledLink = styled(Link)`
type AddLinkProps = ComponentProps<typeof Link> & {
text: string;
}
};
const AddLink: React.FC<AddLinkProps> = ({ text, ...props }) => (
<StyledLink passHref {...props}>
+1 -1
View File
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
import HeaderLogo from "./HeaderLogo";
import { colors } from "@theme/colors";
import HeaderLogo from "./HeaderLogo";
const Header = styled.header`
background-color: ${colors.darkBlue};
+1 -1
View File
@@ -20,7 +20,7 @@ const SideBar = styled.nav`
}
`;
const StyledLink = styled(Link)<{$path: string}>`
const StyledLink = styled(Link)<{ $path: string }>`
padding: 1rem 3rem 1rem 1rem;
letter-spacing: 3px;
text-transform: uppercase;
+1 -1
View File
@@ -1,8 +1,8 @@
import React from "react";
import styled from "styled-components";
import ContactCard from "./ContactCard";
import { Committee } from "@views/ContactsPage/ContactsPageView";
import { colors } from "@theme/colors";
import ContactCard from "./ContactCard";
const blank_profile = "/img/blank_profile.png";
+2 -2
View File
@@ -1,9 +1,9 @@
import React, { useState, useEffect, useRef } from "react";
import Navigation from "./Navigation";
import throttle from "lodash/throttle";
import styled from "styled-components";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import Navigation from "./Navigation";
import NavigationMobile from "./NavigationMobile";
import HeaderLogo from "./HeaderLogo";
@@ -15,7 +15,7 @@ const StyledHeader = styled.header`
}
`;
const Sticky = styled.div<{$isHidden?: boolean}>`
const Sticky = styled.div<{ $isHidden?: boolean }>`
position: sticky;
top: 0;
z-index: 10;
+1 -1
View File
@@ -1,7 +1,7 @@
import styled from "styled-components";
import { colors } from "@theme/colors";
const Buttons = styled.div<{row?: boolean}>`
const Buttons = styled.div<{ row?: boolean }>`
min-width: 20%;
max-width: fit-content;
margin: auto;
+1 -1
View File
@@ -1,9 +1,9 @@
import React, { useState } from "react";
import styled from "styled-components";
import DropDownBox from "./DropDownBox";
import { Link } from "@components/index";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import DropDownBox from "./DropDownBox";
const Container = styled.div`
position: relative;
+3 -3
View File
@@ -25,7 +25,7 @@ const HiddenDefaultElement = styled.input`
`;
/* Create a custom checkbox */
const CustomCBoxElement = styled.span<{checked?: boolean}>`
const CustomCBoxElement = styled.span<{ checked?: boolean }>`
border-radius: 4px;
position: absolute;
top: 0;
@@ -60,8 +60,8 @@ const Checkmark = styled.div`
`;
type CheckboxProps = Omit<
React.InputHTMLAttributes<HTMLInputElement>,
"type"
React.InputHTMLAttributes<HTMLInputElement>,
"type"
>;
const Checkbox: React.FC<CheckboxProps> = ({ children, checked, ...props }) => (
@@ -33,10 +33,8 @@ const Checkboxes: React.FC<CheckboxesProps> = ({
<div className="checkboxes" id={id}>
{enumOptions.map((option, index) => {
const checked = value.indexOf(option.value) !== -1;
const itemDisabled =
enumDisabled && enumDisabled.indexOf(option.value) !== -1;
const disabledCls =
disabled || itemDisabled || readonly ? "disabled" : "";
const itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
const checkbox = (
<Checkbox
id={`${id}_${index}`}
@@ -22,7 +22,7 @@ const HiddenDefaultElement = styled.input`
width: 0;
`;
const CustomRadioElement = styled.span<{checked?: boolean}>`
const CustomRadioElement = styled.span<{ checked?: boolean }>`
position: absolute;
top: 0;
left: 0;
@@ -43,8 +43,8 @@ const Indicator = styled.div`
`;
type RadioButtonProps = Omit<
React.InputHTMLAttributes<HTMLInputElement>,
"type"
React.InputHTMLAttributes<HTMLInputElement>,
"type"
>;
const RadioButton: React.FC<RadioButtonProps> = ({
@@ -33,10 +33,8 @@ const RadioButtonWidget: React.FC<RadioButtonWidgetProps> = (props) => {
<div className="field-radio-group" id={id}>
{enumOptions.map((option, i) => {
const checked = option.value === value;
const itemDisabled =
enumDisabled && enumDisabled.indexOf(option.value) !== -1;
const disabledCls =
disabled || itemDisabled || readonly ? "disabled" : "";
const itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
const disabledCls = disabled || itemDisabled || readonly ? "disabled" : "";
const radio = (
<RadioButton
checked={checked}
+2 -2
View File
@@ -29,8 +29,8 @@ const renderData = (jobAds: JobAd[]) => {
<td><Link to={`${URL}/${ad.id}`}>{ad.title_fi}</Link></td>
<td>{ad.description_fi}</td>
<td>
{ad.autohide_enabled ?
formatRelative(new Date(ad.autohide_at), new Date())
{ad.autohide_enabled
? formatRelative(new Date(ad.autohide_at), new Date())
: "Disabled"}
</td>
</tr>
+2 -2
View File
@@ -11,10 +11,10 @@ import SignupQuestionsWidget from "@components/Widgets/SignupQuestionsWidget/Sig
import MarkdownEditorWidget from "@components/Widgets/MarkdownEditorWidget";
import { buildValidationSchema } from "@views/SignUpPage/FormUtils";
const DEFAULT_EMAIL =
`Moikka,
const DEFAULT_EMAIL = `Moikka,
Ilmottautuminen saapui perille.`;
const widgets = {
datetime: DatetimeWidget,
signup: SignupQuestionsWidget,
+1
View File
@@ -16,6 +16,7 @@ interface InitialProps {
const EventPage: NextPage<InitialProps> = ({ initialEvent }) => {
const router = useRouter();
const { id } = router.query;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data, error } = useFetchEvents({ initialData: initialEvent, id: id as string });
if (!data) return <LoadingView />;
+2 -2
View File
@@ -67,11 +67,11 @@ const SignUpPage: NextPage = () => {
try {
if (uuid) {
const resp = await updateSignup(payload, uuid);
await updateSignup(payload, uuid);
// TODO: Update signup list, so user sees possible changes in the list
setStatus("Sign-up submission updated successfully");
} else {
const resp = await createSignup(payload);
await createSignup(payload);
// TODO: Fetch/update signup list, so user sees the signup in the list
setStatus("Sign-up submitted successfully");
}
+1
View File
@@ -12,6 +12,7 @@ interface InitialProps {
}
const CorporatePage: NextPage<InitialProps> = ({ initialJobAds }) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data, error } = useFetchJobAds({ initialData: initialJobAds });
return (
<>
+1 -1
View File
@@ -2,9 +2,9 @@ import React, { useState } from "react";
import { Event } from "@models/Event";
import Button from "@components/Button";
import FilterContainer from "./FilterContainer";
import { CardSection, Card, FullWidthSection } from "@components/index";
import noop from "@utils/noop";
import FilterContainer from "./FilterContainer";
interface EventCalendarProps {
events: Event[];
+1 -1
View File
@@ -2,9 +2,9 @@ import React, { useState } from "react";
import { Post } from "@models/Feed";
import Button from "@components/Button";
import FilterContainer from "./FilterContainer";
import { CardSection, Card, FullWidthSection } from "@components/index";
import noop from "@utils/noop";
import FilterContainer from "./FilterContainer";
interface NewsProps {
feed: Post[];
@@ -1,9 +1,9 @@
import React from "react";
import CorporatePageHero from "./CorporatePageHero";
import {
CTASection, TextSection, PageLink, Link,
} from "@components/index";
import { JobAd } from "@models/JobAd";
import CorporatePageHero from "./CorporatePageHero";
import JobAdList from "./JobAdList";
const EXCURSION_RULES = "https://static.sahkoinsinoorikilta.fi/saannot/excursiosaannot.pdf";
+1 -1
View File
@@ -1,10 +1,10 @@
import React from "react";
import Image from "next/image";
import styled from "styled-components";
import FreshmenPageHero from "./FreshmenPageHero";
import {
CTASection, TextSection, InfoBox, PageLink, Link,
} from "@components/index";
import FreshmenPageHero from "./FreshmenPageHero";
const FOPAS_LINK = "";
const FUKSI_POINTS_LINK = "";
+1 -1
View File
@@ -9,13 +9,13 @@ import {
CTASection,
Link,
} from "@components/index";
import FrontPageHero from "./FrontPageHero";
import { Event } from "@models/Event";
import { Post } from "@models/Feed";
import { colors } from "@theme/colors";
import FullWidthSection from "@components/Sections/FullWidthSection";
import noop from "@utils/noop";
import FrontPageHero from "./FrontPageHero";
// Corporate logos import
const ABB = "/img/corporate_logos/abb.png";
+1 -1
View File
@@ -3,10 +3,10 @@ import styled from "styled-components";
import {
CTASection, TextSection, PageLink, Link,
} from "@components/index";
import GuildPageHero from "./GuildPageHero";
import FullWidthSection from "@components/Sections/FullWidthSection";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";
import GuildPageHero from "./GuildPageHero";
const Column = styled.div`
display: flex;
+1 -1
View File
@@ -2,13 +2,13 @@ import React from "react";
import styled from "styled-components";
import { IChangeEvent, ISubmitEvent, ErrorSchema } from "react-jsonschema-form";
import { SignupForm } from "@models/SignupForm";
import { buildFormSchema, buildUISchema } from "./FormUtils";
import Checkboxes from "@components/Widgets/Checkbox/Checkboxes";
import RadioButtonWidget from "@components/Widgets/RadioButton/RadioButtonWidget";
import { TextSection } from "@components/index";
import { colors } from "@theme/colors";
import FormWrapper from "@views/common/FormWrapper";
import Loader from "@components/Loader";
import { buildFormSchema, buildUISchema } from "./FormUtils";
const customWidgets = {
radio: RadioButtonWidget,
+1 -1
View File
@@ -51,7 +51,7 @@ type AdminCreateCommonProps = {
widgets: {
[name: string]: any;
};
}
};
const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
title,
+1 -1
View File
@@ -58,7 +58,7 @@ const useShouldRedirect = (enabled = true) => {
type PageProps = {
requiresAuthentication: boolean;
}
};
const AdminPageWrapper: React.FC<PageProps> = ({ requiresAuthentication, children }) => {
const router = useRouter();