Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
vikibrezinova committed Aug 22, 2024
1 parent 29bda74 commit 0fa333c
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/components/SemesterAdministration/SemesterAdministration.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import {Stack, Typography} from '@mui/material'
import {useQuery} from '@tanstack/react-query'
import { Stack, Typography } from '@mui/material'

Check failure on line 1 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Run autofix to sort these imports!

Check failure on line 1 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·Stack,·Typography·` with `Stack,·Typography`
import { useQuery } from '@tanstack/react-query'

Check failure on line 2 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·useQuery·` with `useQuery`
import axios from 'axios'
import {FC, useState} from 'react'

import {Button} from '@/components/Clickable/Button'
import {Link} from '@/components/Clickable/Link'
import {SemesterWithProblems} from '@/types/api/generated/competition'
import {formatDateTime} from '@/utils/formatDate'
import {useDataFromURL} from '@/utils/useDataFromURL'
import {useHasPermissions} from '@/utils/useHasPermissions'

import {Loading} from '../Loading/Loading'
import {PublicationUploader} from '../PublicationUploader/PublicationUploader'
import {Result} from '../Results/ResultsRow'
import { FC, useState } from 'react'

Check failure on line 4 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·FC,·useState·` with `FC,·useState`

import { Button } from '@/components/Clickable/Button'

Check failure on line 6 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·Button·` with `Button`
import { Link } from '@/components/Clickable/Link'

Check failure on line 7 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·Link·` with `Link`
import { SemesterWithProblems } from '@/types/api/generated/competition'

Check failure on line 8 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·SemesterWithProblems·` with `SemesterWithProblems`
import { formatDateTime } from '@/utils/formatDate'

Check failure on line 9 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·formatDateTime·` with `formatDateTime`
import { useDataFromURL } from '@/utils/useDataFromURL'

Check failure on line 10 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·useDataFromURL·` with `useDataFromURL`
import { useHasPermissions } from '@/utils/useHasPermissions'

Check failure on line 11 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·useHasPermissions·` with `useHasPermissions`

import { Loading } from '../Loading/Loading'
import { PublicationUploader } from '../PublicationUploader/PublicationUploader'
import { Result } from '../Results/ResultsRow'
import styles from './SemesterAdministration.module.scss'
import {SecurityUpdateSharp} from '@mui/icons-material'
import { SecurityUpdateSharp } from '@mui/icons-material'

Check warning on line 17 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

'SecurityUpdateSharp' is defined but never used

interface PostalCard {
code: number
Expand All @@ -28,13 +28,13 @@ interface PostalCard {

export const SemesterAdministration: FC = () => {
const {
id: {semesterId},
id: { semesterId },
loading: urlDataLoading,
} = useDataFromURL()

const {hasPermissions, permissionsIsLoading} = useHasPermissions()
const { hasPermissions, permissionsIsLoading } = useHasPermissions()

const {data: semesterData, isLoading: semesterIsLoading} = useQuery({
const { data: semesterData, isLoading: semesterIsLoading } = useQuery({
queryKey: ['competition', 'semester', semesterId],
queryFn: () => axios.get<SemesterWithProblems>(`/api/competition/semester/${semesterId}`),
// router.query.params su v prvom renderi undefined, tak pustime query az so spravnym semesterId
Expand All @@ -46,7 +46,7 @@ export const SemesterAdministration: FC = () => {

const getResults = async (seriesId: number | null) => {
const isSemester = seriesId === null
const {data} = await axios.get<Result[]>(
const { data } = await axios.get<Result[]>(
isSemester ? `/api/competition/semester/${semesterId}/results` : `/api/competition/series/${seriesId}/results`,
)
setTextareaContent(
Expand Down Expand Up @@ -75,7 +75,7 @@ export const SemesterAdministration: FC = () => {
}

const getPostalCards = async (offline_only: boolean) => {
const {data} = await axios.get<PostalCard[]>(
const { data } = await axios.get<PostalCard[]>(
`/api/competition/semester/${semesterId}/${offline_only ? 'offline-schools' : 'schools'}`,
)
setTextareaContent(
Expand Down Expand Up @@ -109,7 +109,7 @@ export const SemesterAdministration: FC = () => {
</Button>
</Stack>
{semester.series_set.map((series) => (
<Stack>
<Stack key={semester.id}>
<Stack key={series.id} gap={1} mt={5}>
<Typography variant="h2">{series.order}. séria</Typography>
<Stack pl={2} alignItems="start">
Expand Down Expand Up @@ -190,7 +190,7 @@ export const SemesterAdministration: FC = () => {
)}

<Stack mt={1} gap={1}>
<Typography variant="h2" sx={{marginTop: 3}}>
<Typography variant="h2" sx={{ marginTop: 3 }}>
Nahrávanie časopisov
</Typography>
{[1, 2, 3].map((order) => (
Expand Down

0 comments on commit 0fa333c

Please sign in to comment.