Fix lint errors
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,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};
|
||||
|
||||
@@ -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,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";
|
||||
|
||||
|
||||
@@ -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,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,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;
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 />;
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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,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 = "";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -51,7 +51,7 @@ type AdminCreateCommonProps = {
|
||||
widgets: {
|
||||
[name: string]: any;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const AdminCreateCommon: React.FC<AdminCreateCommonProps> = ({
|
||||
title,
|
||||
|
||||
@@ -58,7 +58,7 @@ const useShouldRedirect = (enabled = true) => {
|
||||
|
||||
type PageProps = {
|
||||
requiresAuthentication: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AdminPageWrapper: React.FC<PageProps> = ({ requiresAuthentication, children }) => {
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user