Skip to content

Commit 44da1fc

Browse files
authored
🎨 Lint (#106)
1 parent 5761443 commit 44da1fc

File tree

6 files changed

+137
-140
lines changed

6 files changed

+137
-140
lines changed

frontend/src/components/Invitations/Invitations.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ import {
1414
Tr,
1515
} from "@chakra-ui/react"
1616
import { useQuery, useQueryClient } from "@tanstack/react-query"
17+
import { useEffect, useState } from "react"
1718
import { ErrorBoundary } from "react-error-boundary"
19+
1820
import { InvitationsService } from "../../client/services"
19-
import CancelInvitation from "./CancelInvitation"
2021
import { Route } from "../../routes/_layout/$team"
21-
import { useEffect, useState } from "react"
22+
import CancelInvitation from "./CancelInvitation"
2223

2324
const PER_PAGE = 5
2425

frontend/src/components/Invitations/NewInvitation.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import {
99
Text,
1010
} from "@chakra-ui/react"
1111
import { useMutation, useQueryClient } from "@tanstack/react-query"
12-
import { type SubmitHandler, useForm } from "react-hook-form"
12+
import { useForm, type SubmitHandler } from "react-hook-form"
1313

1414
import {
15+
InvitationsService,
1516
type ApiError,
1617
type InvitationCreate,
17-
InvitationsService,
1818
} from "../../client"
1919
import useCustomToast from "../../hooks/useCustomToast"
20-
import { emailPattern } from "../../utils"
2120
import { Route } from "../../routes/_layout/$team"
21+
import { emailPattern } from "../../utils"
2222

2323
const NewInvitation = () => {
2424
const { team: teamSlug } = Route.useParams()

frontend/src/components/TeamSettings/TeamInfo.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { Box, Container, Flex, Heading, Text } from "@chakra-ui/react"
22
import { useSuspenseQuery } from "@tanstack/react-query"
33

4+
import { TeamsService } from "../../client"
45
import { Route } from "../../routes/_layout/$team"
56
import Invitations from "../Invitations/Invitations"
67
import NewInvitation from "../Invitations/NewInvitation"
78
import Team from "../Teams/Team"
8-
import { TeamsService } from "../../client"
9-
109

1110
const TeamInfo = () => {
1211
const { team: teamSlug } = Route.useParams()

frontend/src/components/Teams/Team.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { Suspense } from "react"
1616
import { ErrorBoundary } from "react-error-boundary"
1717

1818
import { TeamsService, type UserPublic } from "../../client"
19-
import ActionsMenu from "../Common/ActionsMenu"
2019
import { Route } from "../../routes/_layout/$team"
20+
import ActionsMenu from "../Common/ActionsMenu"
2121

2222
function TeamTableBody() {
2323
const { team: teamSlug } = Route.useParams()

frontend/src/routes/_layout/teams/$teamSlug/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import {
1414
Thead,
1515
Tr,
1616
} from "@chakra-ui/react"
17-
import {
18-
useQueryClient,
19-
useSuspenseQuery
20-
} from "@tanstack/react-query"
17+
import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query"
2118
import { createFileRoute } from "@tanstack/react-router"
2219
import { Suspense } from "react"
2320
import { ErrorBoundary } from "react-error-boundary"
@@ -34,7 +31,7 @@ export const Route = createFileRoute("/_layout/teams/$teamSlug/")({
3431
function TeamTableBody() {
3532
const queryClient = useQueryClient()
3633
const currentUser = queryClient.getQueryData<UserPublic>(["currentUser"])
37-
const { teamSlug: teamSlug } = Route.useParams()
34+
const { teamSlug } = Route.useParams()
3835
const { data: team } = useSuspenseQuery({
3936
queryKey: ["team", teamSlug],
4037
queryFn: () => TeamsService.readTeam({ teamSlug: teamSlug }),
@@ -133,7 +130,7 @@ function TeamTable() {
133130
}
134131

135132
function Team() {
136-
const { teamSlug: teamSlug } = Route.useParams()
133+
const { teamSlug } = Route.useParams()
137134
const { data: team } = useSuspenseQuery({
138135
queryKey: ["team", teamSlug],
139136
queryFn: () => TeamsService.readTeam({ teamSlug: teamSlug }),

frontend/src/routes/signup.tsx

Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
import { Link as RouterLink, createFileRoute } from "@tanstack/react-router"
1717
import { type SubmitHandler, useForm } from "react-hook-form"
1818
import { FaEnvelope, FaKey, FaUser } from "react-icons/fa"
19-
2019
import { useState } from "react"
20+
2121
import type { UserRegister } from "../client"
2222
import AuthOptions from "../components/Auth/AuthOptions"
2323
import BackgroundPanel from "../components/Auth/BackgroundPanel"
@@ -69,133 +69,133 @@ function SignUp() {
6969
{emailSent ? (
7070
<EmailSent email={userEmail} />
7171
) : (
72-
<Container
73-
as="form"
74-
onSubmit={handleSubmit(onSubmit)}
75-
maxW={{ base: "xs", md: "md" }}
76-
flexDir="column"
77-
alignItems="stretch"
78-
justifyContent="center"
79-
centerContent
80-
gap={4}
81-
>
82-
<Box>
83-
<Text fontWeight="bolder" fontSize="2xl">
84-
Sign Up
85-
</Text>
86-
<Text fontSize="md" color="gray.500">
87-
Create your account
88-
</Text>
89-
</Box>
90-
<FormControl id="full_name" isInvalid={!!errors.email}>
91-
<FormLabel htmlFor="full_name" srOnly>
92-
Full Name
93-
</FormLabel>
94-
<InputGroup>
95-
<InputLeftElement pointerEvents="none">
96-
<Icon as={FaUser} color="ui.dim" />
97-
</InputLeftElement>
98-
<Input
99-
id="full_name"
100-
{...register("full_name", {
101-
required: "Name is required",
102-
pattern: namePattern,
103-
})}
104-
placeholder="Full Name"
105-
type="text"
106-
/>
107-
</InputGroup>
108-
{errors.full_name && (
109-
<FormErrorMessage>{errors.full_name.message}</FormErrorMessage>
110-
)}
111-
</FormControl>
112-
<FormControl id="email" isInvalid={!!errors.email}>
113-
<FormLabel htmlFor="username" srOnly>
114-
Email
115-
</FormLabel>
116-
<InputGroup>
117-
<InputLeftElement pointerEvents="none">
118-
<Icon as={FaEnvelope} color="ui.dim" />
119-
</InputLeftElement>
120-
<Input
121-
id="email"
122-
{...register("email", {
123-
required: "Email is required",
124-
pattern: emailPattern,
125-
})}
126-
placeholder="Email"
127-
type="email"
128-
/>
129-
</InputGroup>
130-
{errors.email && (
131-
<FormErrorMessage>{errors.email.message}</FormErrorMessage>
132-
)}
133-
</FormControl>
134-
<FormControl id="password" isInvalid={!!errors.password}>
135-
<FormLabel htmlFor="password" srOnly>
136-
Password
137-
</FormLabel>
138-
<InputGroup>
139-
<InputLeftElement pointerEvents="none">
140-
<Icon as={FaKey} color="ui.dim" />
141-
</InputLeftElement>
142-
<Input
143-
id="password"
144-
{...register("password", passwordRules())}
145-
placeholder="Password"
146-
type="password"
147-
/>
148-
</InputGroup>
149-
{errors.password && (
150-
<FormErrorMessage>{errors.password.message}</FormErrorMessage>
151-
)}
152-
</FormControl>
153-
<FormControl
154-
id="confirm_password"
155-
isInvalid={!!errors.confirm_password}
72+
<Container
73+
as="form"
74+
onSubmit={handleSubmit(onSubmit)}
75+
maxW={{ base: "xs", md: "md" }}
76+
flexDir="column"
77+
alignItems="stretch"
78+
justifyContent="center"
79+
centerContent
80+
gap={4}
15681
>
157-
<FormLabel htmlFor="confirm_password" srOnly>
158-
Confirm Password
159-
</FormLabel>
82+
<Box>
83+
<Text fontWeight="bolder" fontSize="2xl">
84+
Sign Up
85+
</Text>
86+
<Text fontSize="md" color="gray.500">
87+
Create your account
88+
</Text>
89+
</Box>
90+
<FormControl id="full_name" isInvalid={!!errors.email}>
91+
<FormLabel htmlFor="full_name" srOnly>
92+
Full Name
93+
</FormLabel>
94+
<InputGroup>
95+
<InputLeftElement pointerEvents="none">
96+
<Icon as={FaUser} color="ui.dim" />
97+
</InputLeftElement>
98+
<Input
99+
id="full_name"
100+
{...register("full_name", {
101+
required: "Name is required",
102+
pattern: namePattern,
103+
})}
104+
placeholder="Full Name"
105+
type="text"
106+
/>
107+
</InputGroup>
108+
{errors.full_name && (
109+
<FormErrorMessage>{errors.full_name.message}</FormErrorMessage>
110+
)}
111+
</FormControl>
112+
<FormControl id="email" isInvalid={!!errors.email}>
113+
<FormLabel htmlFor="username" srOnly>
114+
Email
115+
</FormLabel>
116+
<InputGroup>
117+
<InputLeftElement pointerEvents="none">
118+
<Icon as={FaEnvelope} color="ui.dim" />
119+
</InputLeftElement>
120+
<Input
121+
id="email"
122+
{...register("email", {
123+
required: "Email is required",
124+
pattern: emailPattern,
125+
})}
126+
placeholder="Email"
127+
type="email"
128+
/>
129+
</InputGroup>
130+
{errors.email && (
131+
<FormErrorMessage>{errors.email.message}</FormErrorMessage>
132+
)}
133+
</FormControl>
134+
<FormControl id="password" isInvalid={!!errors.password}>
135+
<FormLabel htmlFor="password" srOnly>
136+
Password
137+
</FormLabel>
138+
<InputGroup>
139+
<InputLeftElement pointerEvents="none">
140+
<Icon as={FaKey} color="ui.dim" />
141+
</InputLeftElement>
142+
<Input
143+
id="password"
144+
{...register("password", passwordRules())}
145+
placeholder="Password"
146+
type="password"
147+
/>
148+
</InputGroup>
149+
{errors.password && (
150+
<FormErrorMessage>{errors.password.message}</FormErrorMessage>
151+
)}
152+
</FormControl>
153+
<FormControl
154+
id="confirm_password"
155+
isInvalid={!!errors.confirm_password}
156+
>
157+
<FormLabel htmlFor="confirm_password" srOnly>
158+
Confirm Password
159+
</FormLabel>
160160

161-
<InputGroup>
162-
<InputLeftElement pointerEvents="none">
163-
<Icon as={FaKey} color="ui.dim" />
164-
</InputLeftElement>
165-
<Input
166-
id="confirm_password"
167-
{...register(
168-
"confirm_password",
169-
confirmPasswordRules(getValues),
170-
)}
171-
placeholder="Repeat Password"
172-
type="password"
173-
/>
174-
</InputGroup>
175-
{errors.confirm_password && (
176-
<FormErrorMessage>
177-
{errors.confirm_password.message}
178-
</FormErrorMessage>
179-
)}
180-
</FormControl>
181-
<Text>
182-
{"By signing up, you agree to our "}
183-
<Link as={RouterLink} to="/" color="ui.main">
184-
Terms
185-
</Link>
186-
{" and "}
187-
<Link as={RouterLink} to="/" color="ui.main">
188-
Privacy Policy.
189-
</Link>
190-
</Text>
191-
<Button variant="primary" type="submit" isLoading={isSubmitting}>
192-
Sign Up
193-
</Button>
194-
<AuthOptions
195-
description={"Already have an account?"}
196-
path={"/login"}
197-
/>
198-
</Container>
161+
<InputGroup>
162+
<InputLeftElement pointerEvents="none">
163+
<Icon as={FaKey} color="ui.dim" />
164+
</InputLeftElement>
165+
<Input
166+
id="confirm_password"
167+
{...register(
168+
"confirm_password",
169+
confirmPasswordRules(getValues),
170+
)}
171+
placeholder="Repeat Password"
172+
type="password"
173+
/>
174+
</InputGroup>
175+
{errors.confirm_password && (
176+
<FormErrorMessage>
177+
{errors.confirm_password.message}
178+
</FormErrorMessage>
179+
)}
180+
</FormControl>
181+
<Text>
182+
{"By signing up, you agree to our "}
183+
<Link as={RouterLink} to="/" color="ui.main">
184+
Terms
185+
</Link>
186+
{" and "}
187+
<Link as={RouterLink} to="/" color="ui.main">
188+
Privacy Policy.
189+
</Link>
190+
</Text>
191+
<Button variant="primary" type="submit" isLoading={isSubmitting}>
192+
Sign Up
193+
</Button>
194+
<AuthOptions
195+
description={"Already have an account?"}
196+
path={"/login"}
197+
/>
198+
</Container>
199199
)}
200200
</Flex>
201201
</>

0 commit comments

Comments
 (0)