Skip to content

Commit

Permalink
placed reusable component into /common
Browse files Browse the repository at this point in the history
  • Loading branch information
laks0407 committed Nov 11, 2024
1 parent 1672300 commit 8546bd3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
22 changes: 22 additions & 0 deletions frontend/src/components/common/StatusMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { Text } from "@chakra-ui/react";

interface StatusMessageProps {
message: string;
color?: string;
}

const StatusMessage = ({ message, color = "blue.700" }: StatusMessageProps): React.ReactElement => {

Check warning on line 9 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Replace `·message,·color·=·"blue.700"·` with `⏎··message,⏎··color·=·"blue.700",⏎`
return (

Check warning on line 10 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Replace `····` with `··`
<Text

Check warning on line 11 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Replace `··<Text⏎········color={color}⏎········textAlign="center"⏎········lineHeight="120%"⏎········marginTop="16px"⏎······` with `<Text·color={color}·textAlign="center"·lineHeight="120%"·marginTop="16px"`
color={color}
textAlign="center"
lineHeight="120%"
marginTop="16px"
>
{message}

Check warning on line 17 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
</Text>

Check warning on line 18 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
);

Check warning on line 19 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
};

Check warning on line 20 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`

Check warning on line 21 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
export default StatusMessage;

Check warning on line 22 in frontend/src/components/common/StatusMessage.tsx

View workflow job for this annotation

GitHub Actions / run-lint

Replace `··export·default·StatusMessage;` with `export·default·StatusMessage;⏎`
18 changes: 1 addition & 17 deletions frontend/src/components/pages/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
FormErrorMessage,
Flex,
} from "@chakra-ui/react";
import StatusMessage from "../common/StatusMessage";
import background from "./login_background.png";
import backgroundMobile from "./login_background_phone.png";

Expand All @@ -16,23 +17,6 @@ type SentEmail = {
timestamp: number;
};

const StatusMessage: React.FC<{ message: string; color?: string }> = ({
message,
color = "blue.700",
}) => {
return (
<Text
color={color}
textAlign="center"
textStyle="bodyMobile"
lineHeight="120%"
marginTop="16px"
>
{message}
</Text>
);
};

const ForgotPassword = (): React.ReactElement => {
const [validUser, setValidUser] = useState(true);
const [sentEmail, setSentEmail] = useState(false);
Expand Down

0 comments on commit 8546bd3

Please sign in to comment.