Skip to content

Commit

Permalink
Merge pull request #66 from solaoi/feature_suppress-reset-on-activate…
Browse files Browse the repository at this point in the history
…-other-tabs

suppress-reset-on-activate-other-tabs
  • Loading branch information
solaoi authored Aug 11, 2022
2 parents 14b4921 + 7c1e713 commit 68dbd3b
Show file tree
Hide file tree
Showing 10 changed files with 1,675 additions and 1,560 deletions.
2 changes: 1 addition & 1 deletion app/auth/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import login from "app/auth/mutations/login"
import { Login } from "app/auth/validations"
import Card from "../../core/layouts/Card"
import Card from "app/core/layouts/Card"
import { Flex } from "@chakra-ui/react"

type LoginFormProps = {
Expand Down
2 changes: 1 addition & 1 deletion app/auth/components/SignupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import signup from "app/auth/mutations/signup"
import { Signup } from "app/auth/validations"
import Card from "../../core/layouts/Card"
import Card from "app/core/layouts/Card"
import { Flex } from "@chakra-ui/react"

type SignupFormProps = {
Expand Down
2 changes: 2 additions & 0 deletions app/core/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { z } from "zod"
import { validateZodSchema } from "blitz"
export { FORM_ERROR } from "final-form"
import { Button, Flex } from "@chakra-ui/react"
import deepEqual from "fast-deep-equal"

export interface FormProps<S extends z.ZodType<any, any>>
extends Omit<PropsWithoutRef<JSX.IntrinsicElements["form"]>, "onSubmit"> {
Expand All @@ -27,6 +28,7 @@ export function Form<S extends z.ZodType<any, any>>({
return (
<FinalForm
initialValues={initialValues}
initialValuesEqual={deepEqual}
validate={validateZodSchema(schema)}
onSubmit={onSubmit}
render={({ handleSubmit, submitting, submitError }) => (
Expand Down
2 changes: 1 addition & 1 deletion app/pages/projects/[projectId]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import getProject from "app/projects/queries/getProject"
import updateProject from "app/projects/mutations/updateProject"
import { ProjectForm, FORM_ERROR } from "app/projects/components/ProjectForm"
import { Spinner, Flex, Breadcrumb, BreadcrumbItem, BreadcrumbLink } from "@chakra-ui/react"
import Card from "../../../core/layouts/Card"
import Card from "app/core/layouts/Card"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

const BreadCrumb = ({ project }) => {
Expand Down
2 changes: 1 addition & 1 deletion app/pages/projects/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import createProject from "app/projects/mutations/createProject"
import { ProjectForm, FORM_ERROR } from "app/projects/components/ProjectForm"
import { Suspense } from "react"
import { Spinner, Flex, Breadcrumb, BreadcrumbItem, BreadcrumbLink } from "@chakra-ui/react"
import Card from "../../core/layouts/Card"
import Card from "app/core/layouts/Card"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

const BreadCrumb = () => (
Expand Down
2 changes: 1 addition & 1 deletion app/pages/stubs/[stubId]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import updateStub from "app/stubs/mutations/updateStub"
import { StubForm, FORM_ERROR } from "app/stubs/components/StubForm"
import { Box, Spinner, Flex, Breadcrumb, BreadcrumbItem, BreadcrumbLink } from "@chakra-ui/react"
import getProject from "app/projects/queries/getProject"
import Card from "../../../core/layouts/Card"
import Card from "app/core/layouts/Card"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

const BreadCrumb = ({ stub }) => {
Expand Down
2 changes: 1 addition & 1 deletion app/pages/stubs/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { StubForm, FORM_ERROR } from "app/stubs/components/StubForm"
import { Spinner, Flex, Breadcrumb, BreadcrumbItem, BreadcrumbLink } from "@chakra-ui/react"
import getProject from "app/projects/queries/getProject"
import { Suspense } from "react"
import Card from "../../core/layouts/Card"
import Card from "app/core/layouts/Card"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

const BreadCrumb = ({ projectId }) => {
Expand Down
3 changes: 1 addition & 2 deletions app/stubs/components/StubForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { LabeledSelectField } from "app/core/components/LabeledSelectField"
import { useRouterQuery } from "blitz"
import { z } from "zod"
export { FORM_ERROR } from "app/core/components/Form"
import Card from "../../core/layouts/Card"
import { border } from "@chakra-ui/styled-system"
import Card from "app/core/layouts/Card"

export function StubForm<S extends z.ZodType<any, any>>(props: FormProps<S>) {
const query = useRouterQuery()
Expand Down
Loading

0 comments on commit 68dbd3b

Please sign in to comment.