Skip to content

Commit

Permalink
🎨 Lint (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejsdev authored Jun 24, 2024
1 parent 5761443 commit 44da1fc
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 140 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/Invitations/Invitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import {
Tr,
} from "@chakra-ui/react"
import { useQuery, useQueryClient } from "@tanstack/react-query"
import { useEffect, useState } from "react"
import { ErrorBoundary } from "react-error-boundary"

import { InvitationsService } from "../../client/services"
import CancelInvitation from "./CancelInvitation"
import { Route } from "../../routes/_layout/$team"
import { useEffect, useState } from "react"
import CancelInvitation from "./CancelInvitation"

const PER_PAGE = 5

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Invitations/NewInvitation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import {
Text,
} from "@chakra-ui/react"
import { useMutation, useQueryClient } from "@tanstack/react-query"
import { type SubmitHandler, useForm } from "react-hook-form"
import { useForm, type SubmitHandler } from "react-hook-form"

import {
InvitationsService,
type ApiError,
type InvitationCreate,
InvitationsService,
} from "../../client"
import useCustomToast from "../../hooks/useCustomToast"
import { emailPattern } from "../../utils"
import { Route } from "../../routes/_layout/$team"
import { emailPattern } from "../../utils"

const NewInvitation = () => {
const { team: teamSlug } = Route.useParams()
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/TeamSettings/TeamInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Box, Container, Flex, Heading, Text } from "@chakra-ui/react"
import { useSuspenseQuery } from "@tanstack/react-query"

import { TeamsService } from "../../client"
import { Route } from "../../routes/_layout/$team"
import Invitations from "../Invitations/Invitations"
import NewInvitation from "../Invitations/NewInvitation"
import Team from "../Teams/Team"
import { TeamsService } from "../../client"


const TeamInfo = () => {
const { team: teamSlug } = Route.useParams()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Teams/Team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { Suspense } from "react"
import { ErrorBoundary } from "react-error-boundary"

import { TeamsService, type UserPublic } from "../../client"
import ActionsMenu from "../Common/ActionsMenu"
import { Route } from "../../routes/_layout/$team"
import ActionsMenu from "../Common/ActionsMenu"

function TeamTableBody() {
const { team: teamSlug } = Route.useParams()
Expand Down
9 changes: 3 additions & 6 deletions frontend/src/routes/_layout/teams/$teamSlug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import {
Thead,
Tr,
} from "@chakra-ui/react"
import {
useQueryClient,
useSuspenseQuery
} from "@tanstack/react-query"
import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query"
import { createFileRoute } from "@tanstack/react-router"
import { Suspense } from "react"
import { ErrorBoundary } from "react-error-boundary"
Expand All @@ -34,7 +31,7 @@ export const Route = createFileRoute("/_layout/teams/$teamSlug/")({
function TeamTableBody() {
const queryClient = useQueryClient()
const currentUser = queryClient.getQueryData<UserPublic>(["currentUser"])
const { teamSlug: teamSlug } = Route.useParams()
const { teamSlug } = Route.useParams()
const { data: team } = useSuspenseQuery({
queryKey: ["team", teamSlug],
queryFn: () => TeamsService.readTeam({ teamSlug: teamSlug }),
Expand Down Expand Up @@ -133,7 +130,7 @@ function TeamTable() {
}

function Team() {
const { teamSlug: teamSlug } = Route.useParams()
const { teamSlug } = Route.useParams()
const { data: team } = useSuspenseQuery({
queryKey: ["team", teamSlug],
queryFn: () => TeamsService.readTeam({ teamSlug: teamSlug }),
Expand Down
252 changes: 126 additions & 126 deletions frontend/src/routes/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
import { Link as RouterLink, createFileRoute } from "@tanstack/react-router"
import { type SubmitHandler, useForm } from "react-hook-form"
import { FaEnvelope, FaKey, FaUser } from "react-icons/fa"

import { useState } from "react"

import type { UserRegister } from "../client"
import AuthOptions from "../components/Auth/AuthOptions"
import BackgroundPanel from "../components/Auth/BackgroundPanel"
Expand Down Expand Up @@ -69,133 +69,133 @@ function SignUp() {
{emailSent ? (
<EmailSent email={userEmail} />
) : (
<Container
as="form"
onSubmit={handleSubmit(onSubmit)}
maxW={{ base: "xs", md: "md" }}
flexDir="column"
alignItems="stretch"
justifyContent="center"
centerContent
gap={4}
>
<Box>
<Text fontWeight="bolder" fontSize="2xl">
Sign Up
</Text>
<Text fontSize="md" color="gray.500">
Create your account
</Text>
</Box>
<FormControl id="full_name" isInvalid={!!errors.email}>
<FormLabel htmlFor="full_name" srOnly>
Full Name
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaUser} color="ui.dim" />
</InputLeftElement>
<Input
id="full_name"
{...register("full_name", {
required: "Name is required",
pattern: namePattern,
})}
placeholder="Full Name"
type="text"
/>
</InputGroup>
{errors.full_name && (
<FormErrorMessage>{errors.full_name.message}</FormErrorMessage>
)}
</FormControl>
<FormControl id="email" isInvalid={!!errors.email}>
<FormLabel htmlFor="username" srOnly>
Email
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaEnvelope} color="ui.dim" />
</InputLeftElement>
<Input
id="email"
{...register("email", {
required: "Email is required",
pattern: emailPattern,
})}
placeholder="Email"
type="email"
/>
</InputGroup>
{errors.email && (
<FormErrorMessage>{errors.email.message}</FormErrorMessage>
)}
</FormControl>
<FormControl id="password" isInvalid={!!errors.password}>
<FormLabel htmlFor="password" srOnly>
Password
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaKey} color="ui.dim" />
</InputLeftElement>
<Input
id="password"
{...register("password", passwordRules())}
placeholder="Password"
type="password"
/>
</InputGroup>
{errors.password && (
<FormErrorMessage>{errors.password.message}</FormErrorMessage>
)}
</FormControl>
<FormControl
id="confirm_password"
isInvalid={!!errors.confirm_password}
<Container
as="form"
onSubmit={handleSubmit(onSubmit)}
maxW={{ base: "xs", md: "md" }}
flexDir="column"
alignItems="stretch"
justifyContent="center"
centerContent
gap={4}
>
<FormLabel htmlFor="confirm_password" srOnly>
Confirm Password
</FormLabel>
<Box>
<Text fontWeight="bolder" fontSize="2xl">
Sign Up
</Text>
<Text fontSize="md" color="gray.500">
Create your account
</Text>
</Box>
<FormControl id="full_name" isInvalid={!!errors.email}>
<FormLabel htmlFor="full_name" srOnly>
Full Name
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaUser} color="ui.dim" />
</InputLeftElement>
<Input
id="full_name"
{...register("full_name", {
required: "Name is required",
pattern: namePattern,
})}
placeholder="Full Name"
type="text"
/>
</InputGroup>
{errors.full_name && (
<FormErrorMessage>{errors.full_name.message}</FormErrorMessage>
)}
</FormControl>
<FormControl id="email" isInvalid={!!errors.email}>
<FormLabel htmlFor="username" srOnly>
Email
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaEnvelope} color="ui.dim" />
</InputLeftElement>
<Input
id="email"
{...register("email", {
required: "Email is required",
pattern: emailPattern,
})}
placeholder="Email"
type="email"
/>
</InputGroup>
{errors.email && (
<FormErrorMessage>{errors.email.message}</FormErrorMessage>
)}
</FormControl>
<FormControl id="password" isInvalid={!!errors.password}>
<FormLabel htmlFor="password" srOnly>
Password
</FormLabel>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaKey} color="ui.dim" />
</InputLeftElement>
<Input
id="password"
{...register("password", passwordRules())}
placeholder="Password"
type="password"
/>
</InputGroup>
{errors.password && (
<FormErrorMessage>{errors.password.message}</FormErrorMessage>
)}
</FormControl>
<FormControl
id="confirm_password"
isInvalid={!!errors.confirm_password}
>
<FormLabel htmlFor="confirm_password" srOnly>
Confirm Password
</FormLabel>

<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaKey} color="ui.dim" />
</InputLeftElement>
<Input
id="confirm_password"
{...register(
"confirm_password",
confirmPasswordRules(getValues),
)}
placeholder="Repeat Password"
type="password"
/>
</InputGroup>
{errors.confirm_password && (
<FormErrorMessage>
{errors.confirm_password.message}
</FormErrorMessage>
)}
</FormControl>
<Text>
{"By signing up, you agree to our "}
<Link as={RouterLink} to="/" color="ui.main">
Terms
</Link>
{" and "}
<Link as={RouterLink} to="/" color="ui.main">
Privacy Policy.
</Link>
</Text>
<Button variant="primary" type="submit" isLoading={isSubmitting}>
Sign Up
</Button>
<AuthOptions
description={"Already have an account?"}
path={"/login"}
/>
</Container>
<InputGroup>
<InputLeftElement pointerEvents="none">
<Icon as={FaKey} color="ui.dim" />
</InputLeftElement>
<Input
id="confirm_password"
{...register(
"confirm_password",
confirmPasswordRules(getValues),
)}
placeholder="Repeat Password"
type="password"
/>
</InputGroup>
{errors.confirm_password && (
<FormErrorMessage>
{errors.confirm_password.message}
</FormErrorMessage>
)}
</FormControl>
<Text>
{"By signing up, you agree to our "}
<Link as={RouterLink} to="/" color="ui.main">
Terms
</Link>
{" and "}
<Link as={RouterLink} to="/" color="ui.main">
Privacy Policy.
</Link>
</Text>
<Button variant="primary" type="submit" isLoading={isSubmitting}>
Sign Up
</Button>
<AuthOptions
description={"Already have an account?"}
path={"/login"}
/>
</Container>
)}
</Flex>
</>
Expand Down

0 comments on commit 44da1fc

Please sign in to comment.