Skip to content

Commit

Permalink
fix: fixes an issue where the enter key was redirecting the user to w…
Browse files Browse the repository at this point in the history
…rong page
  • Loading branch information
AssisrMatheus committed Jan 19, 2022
1 parent 6d125f1 commit 2a9289b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"close": "Close",
"add": "Add",
"back": "Back",
"next": "Next",
"exit": "Exit",
"logout": "Logout"
},
Expand Down
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
22 changes: 11 additions & 11 deletions src/apollo/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6028,17 +6028,6 @@ export type ProjectModuleDataFragment = {
};
};

export type ProjectDataFragment = {
__typename?: 'Project';
id: number;
title: string;
slug: string;
cabinetWidth?: number | null | undefined;
gable: number;
type: { __typename?: 'Type'; id: number; slug: string };
collection: { __typename?: 'Collection'; id: number; slug: string };
};

export type LoginMutationVariables = Exact<{
user: UserSingIn;
}>;
Expand Down Expand Up @@ -7282,6 +7271,17 @@ export type DeleteProjectModuleMutation = {
deleteManyProjectModule: { __typename?: 'AffectedRowsOutput'; count: number };
};

export type ProjectDataFragment = {
__typename?: 'Project';
id: number;
title: string;
slug: string;
cabinetWidth?: number | null | undefined;
gable: number;
type: { __typename?: 'Type'; id: number; slug: string };
collection: { __typename?: 'Collection'; id: number; slug: string };
};

export type ProjectCartQueryVariables = Exact<{
slug: Scalars['String'];
}>;
Expand Down
6 changes: 4 additions & 2 deletions src/components/Templates/ProjectCreation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Spinner from '../../UI/Spinner';
import SkeletonImage from '../../UI/SkeletonImage';
import UnitSwitch from '../../Elements/UnitSwitch';
import { ArrowLeft, ArrowRight } from 'react-feather';
import { FormattedMessage } from 'react-intl';

export type ProjectCreationTemplateProps = {
title: string;
Expand Down Expand Up @@ -103,6 +104,7 @@ const ProjectCreationTemplate: React.FC<ProjectCreationTemplateProps> = ({
<Button
disabled={disablePrev || loading}
className="px-6 py-2"
type="button"
onClick={(e) => {
// Using stopPropagation and preventDefault because this is triggering onsubmit on form for a unknown reason
e.preventDefault();
Expand All @@ -111,11 +113,11 @@ const ProjectCreationTemplate: React.FC<ProjectCreationTemplateProps> = ({
}}
>
<ArrowLeft />
Back
<FormattedMessage id="common.back" />
</Button>
)}
<Button disabled={disableNext || loading} className="px-6 py-2" type="submit">
Next
<FormattedMessage id="common.next" />
{loading ? <Spinner className="w-5 h-5 ml-2" /> : <ArrowRight />}
</Button>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/UI/NavbarButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type NavbarButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElemen
const NavbarButton: React.FC<NavbarButtonProps> = ({ icon, iconPosition = 'right', children, ...buttonProps }) => (
<button
className="flex items-center justify-center h-full px-4 hover:bg-mui-gray-50 transition-colors duration-75 group gap-2"
type="button"
{...buttonProps}
>
{iconPosition === 'left' && icon}
Expand Down

0 comments on commit 2a9289b

Please sign in to comment.