Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Nov 27, 2023
1 parent 67ab83b commit 7eed6ea
Show file tree
Hide file tree
Showing 62 changed files with 2,107 additions and 2,561 deletions.
16 changes: 8 additions & 8 deletions src/components/AbstractTeam/AbstractTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
const [getTeams] = useLazyGetTeamsQuery();
const [submitTransfers, { isSuccess: submitTransfersSucces, data: submitTransfersResult }] = useSubmitTransfersMutation();

const application = useSelector((state: StoreState.All) => state.application);
const application = useSelector((state: StoreState) => state.application);

const [state, setState] = useState<AbstractTeamState>({
validator: FootballPicker(FootballMaxPositionsPicks, FootballPositionIds),
Expand All @@ -104,7 +104,7 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
swapPlayerId: null,
swapPlayer: null,
swappedFrom: null,
visibleWeekId: deadlineInfoSuccess ? (options && options.mode === 'points' ? deadlineInfo.deadlineInfo.displayWeek : deadlineInfo.deadlineInfo.deadlineWeek) : 0,
visibleWeekId: deadlineInfoSuccess ? (options && options.mode === "points" ? deadlineInfo.deadlineInfo.displayWeek : deadlineInfo.deadlineInfo.deadlineWeek) : 0,
boosters: {},
teamPointsInfo: {
generalPoints: null,
Expand All @@ -129,8 +129,8 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
});

useEffect(() => {
setState((state: any) => ({ ...state, visibleWeekId: (options && options.mode === 'points' ? deadlineInfo?.deadlineInfo.displayWeek : deadlineInfo?.deadlineInfo.deadlineWeek) }));
}, [deadlineInfo])
setState((state: any) => ({ ...state, visibleWeekId: (options && options.mode === "points" ? deadlineInfo?.deadlineInfo.displayWeek : deadlineInfo?.deadlineInfo.deadlineWeek) }));
}, [deadlineInfo]);

const setStarting = (starting: any[]) => {
setState({ ...state, starting });
Expand Down Expand Up @@ -175,7 +175,7 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
isTeamOwner?: boolean,
teamUser?: any
) => {
console.log("INIT TEAM STATE")
console.log("INIT TEAM STATE");
const startingPlayersValidatorFormat = playersToValidatorFormat(starting);
const benchPlayersValidatorFormat = playersToValidatorFormat(bench);

Expand Down Expand Up @@ -249,7 +249,7 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
const captains = {
captainId: state.captainId,
viceCaptainId: state.viceCaptainId
}
};
if (!state.captainId && player.positionId !== 0) {
captains.captainId = player.id;
}
Expand Down Expand Up @@ -479,7 +479,7 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
starting: startingIds,
bench: benchIds,
teamName: state.teamName,
}).unwrap().then((res) => openSuccessNotification({ title: res.msg })).catch((err) => openErrorNotification({ title: t(`team.updateSelection.failed`) }));
}).unwrap().then((res) => openSuccessNotification({ title: res.msg })).catch((err) => openErrorNotification({ title: t("team.updateSelection.failed") }));
}
};

Expand Down Expand Up @@ -655,7 +655,7 @@ export const AbstractTeam = (Component: (props: AbstractTeamType) => any, props:
const transfers = state.draftTransfers
.map((transfer: Transfer) => pick(transfer, ["inId", "outId"]));

submitTransfers({ teamId, transfers }).unwrap().then((res) => openSuccessNotification({ title: res.msg })).catch((err) => openErrorNotification({ title: t(`team.transfers.failed`) }));
submitTransfers({ teamId, transfers }).unwrap().then((res) => openSuccessNotification({ title: res.msg })).catch((err) => openErrorNotification({ title: t("team.transfers.failed") }));
};

const onTransfersReset = (teamId: number) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Calendar = (props: CalendarProps) => {

const onFilterChange = (name: string, value: string | number) => {
const filters: any = Object.assign({}, state.filters, { [name]: value });
setState({ ...state, filters })
setState({ ...state, filters });
};

const matchFilter = (match: Match, filters: any) => {
Expand All @@ -49,7 +49,7 @@ export const Calendar = (props: CalendarProps) => {
show = false;
}
return show;
}
};

const onCalendarWeekChanged = (weekId: number) => {
setState({ ...state, weekId: weekId });
Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/CalendarStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const ClubDetails = styled.div<{left?: boolean}>`
padding: 5px;
justify-content: ${(props: any) => props.left ? "flex-end": "flex-start"};
align-items: center;
`
`;

export const ClubBadgeBg = styled.img`
max-width: 25px;
Expand Down
56 changes: 28 additions & 28 deletions src/components/ConfirmModal/ConfirmModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button } from "../UI/Button/Button"
import { Col, Row } from "../UI/Grid/Grid"
import { ConfirmModalStyle } from "./ConfirmModalStyle"
import { useTranslation } from "react-i18next"
import { Button } from "../UI/Button/Button";
import { Col, Row } from "../UI/Grid/Grid";
import { ConfirmModalStyle } from "./ConfirmModalStyle";
import { useTranslation } from "react-i18next";

declare type ConfirmModalProps = {
visible: boolean
Expand All @@ -12,29 +12,29 @@ declare type ConfirmModalProps = {
}

export const ConfirmModal = (props: any) => {
const { visible, onCancel, onConfirm, text, title } = props;
const { t } = useTranslation();
const { visible, onCancel, onConfirm, text, title } = props;
const { t } = useTranslation();

return (
<ConfirmModalStyle
title={title}
closable={true}
open={visible}
onCancel={onCancel}
footer={[]}
>
<Row>
<Col md={24} sm={24} xs={24}>
{text}
</Col>
</Row>
<Row>
<Col md={24} sm={24} xs={24} className="actions">
<Button onClick={(e: any) => { onConfirm() }}>{t('general.confirmModalYesBtn')}</Button>
<Button danger onClick={(e: any) => { onCancel() }}>{t('general.confirmModalNoBtn')}</Button>
</Col>
</Row>
return (
<ConfirmModalStyle
title={title}
closable={true}
open={visible}
onCancel={onCancel}
footer={[]}
>
<Row>
<Col md={24} sm={24} xs={24}>
{text}
</Col>
</Row>
<Row>
<Col md={24} sm={24} xs={24} className="actions">
<Button onClick={(e: any) => { onConfirm(); }}>{t("general.confirmModalYesBtn")}</Button>
<Button danger onClick={(e: any) => { onCancel(); }}>{t("general.confirmModalNoBtn")}</Button>
</Col>
</Row>

</ConfirmModalStyle>
)
}
</ConfirmModalStyle>
);
};
16 changes: 8 additions & 8 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ type FooterProps = {
}

export const Footer = (props: FooterProps) => {
return (
<FooterStyle>
<ul>
<li><Link to="home"><MessageOutlined /></Link></li>
</ul>
</FooterStyle>
);
}
return (
<FooterStyle>
<ul>
<li><Link to="home"><MessageOutlined /></Link></li>
</ul>
</FooterStyle>
);
};
10 changes: 5 additions & 5 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ export const Header = () => {
if (showPoints) {
insertToMenuAtPosition(2, "team");
} else {
insertToMenuAtPosition(1, "team")
insertToMenuAtPosition(1, "team");
}
}

if (authenticated && userTeam && !showTransfers && gameInProgress) {
if (showTransfers) {
insertToMenuAtPosition(3, 'edit');
insertToMenuAtPosition(3, "edit");
} else {
insertToMenuAtPosition(2, 'edit');
insertToMenuAtPosition(2, "edit");
}
}

if (authenticated && showTransfers && gameInProgress) {
if (showTransfers) {
insertToMenuAtPosition(4, 'transfers');
insertToMenuAtPosition(4, "transfers");
} else {
insertToMenuAtPosition(3, 'transfers');
insertToMenuAtPosition(3, "transfers");
}
}

Expand Down
68 changes: 0 additions & 68 deletions src/components/MatchEventMinute/MatchEventMinute.tsx

This file was deleted.

64 changes: 0 additions & 64 deletions src/components/MatchEventMinute/MatchEventMinuteStyle.tsx

This file was deleted.

Loading

0 comments on commit 7eed6ea

Please sign in to comment.