Skip to content
Merged
Prev Previous commit
Next Next commit
chore: create LoginPage/Language.ts to remove circular dependency
  • Loading branch information
brettkolodny committed Apr 28, 2025
commit cc6df5f6f984cb1419a944b9664cbae8c17aa81f
9 changes: 9 additions & 0 deletions site/src/pages/LoginPage/Language.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const Language = {
emailLabel: "Email",
passwordLabel: "Password",
emailInvalid: "Please enter a valid email address.",
emailRequired: "Please enter an email address.",
passwordSignIn: "Sign In",
githubSignIn: "GitHub",
oidcSignIn: "OpenID Connect",
};
2 changes: 1 addition & 1 deletion site/src/pages/LoginPage/LoginPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
waitForLoaderToBeRemoved,
} from "testHelpers/renderHelpers";
import { server } from "testHelpers/server";
import { Language } from "./Language";
import { LoginPage } from "./LoginPage";
import { Language } from "./SignInForm";

describe("LoginPage", () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/LoginPage/OAuthSignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from "@mui/material/Button";
import { visuallyHidden } from "@mui/utils";
import type { AuthMethods } from "api/typesGenerated";
import { type FC, useId } from "react";
import { Language } from "./SignInForm";
import { Language } from "./Language";

const iconStyles = {
width: 16,
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/LoginPage/PasswordSignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { FC } from "react";
import { Link as RouterLink } from "react-router-dom";
import { getFormHelpers, onChangeTrimmed } from "utils/formUtils";
import * as Yup from "yup";
import { Language } from "./SignInForm";
import { Language } from "./Language";

type PasswordSignInFormProps = {
onSubmit: (credentials: { email: string; password: string }) => void;
Expand Down
10 changes: 0 additions & 10 deletions site/src/pages/LoginPage/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ import { getApplicationName } from "utils/appearance";
import { OAuthSignInForm } from "./OAuthSignInForm";
import { PasswordSignInForm } from "./PasswordSignInForm";

export const Language = {
emailLabel: "Email",
passwordLabel: "Password",
emailInvalid: "Please enter a valid email address.",
emailRequired: "Please enter an email address.",
passwordSignIn: "Sign In",
githubSignIn: "GitHub",
oidcSignIn: "OpenID Connect",
};

const styles = {
root: {
width: "100%",
Expand Down