Skip to content

Commit

Permalink
Merge pull request #106 from gfa-cc-after/fix/make-buttons-visible
Browse files Browse the repository at this point in the history
fix: make buttons visible
  • Loading branch information
markkovari authored Sep 8, 2024
2 parents 4ba02d3 + 6cfb0ba commit 340b71d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
6 changes: 4 additions & 2 deletions frontend/src/pages/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useToast } from "@chakra-ui/react";
import { Button, useToast } from "@chakra-ui/react";
import { AxiosError } from "axios";
import type { ChangeEvent, FormEvent } from "react";
import { useState } from "react";
Expand Down Expand Up @@ -80,7 +80,9 @@ export function Login() {
autoComplete="current-password"
required={true}
/>
<button type="submit">Login</button>
<Button colorScheme="purple" type="submit">
Login
</Button>
</form>
<Link className="links" to="/">
Main
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/pages/ProfileDeletion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useToast } from "@chakra-ui/react";
import { Button, useToast } from "@chakra-ui/react";
import { AxiosError } from "axios";
import { useNavigate } from "react-router-dom";
import { deleteProfile } from "../httpClient.ts";
Expand Down Expand Up @@ -57,21 +57,21 @@ export function ProfileDeletion() {
profile? We're sad to see you go! Please remember, this action is
permanent and you'll lose all your data."
</p>
<button
<Button
type="button"
data-testid="delete-profile-button"
style={{ backgroundColor: "red", margin: "10px" }}
onClick={handleDeletion}
>
Yes, delete it!
</button>
<button
</Button>
<Button
type="button"
style={{ backgroundColor: "green", margin: "10px" }}
onClick={routChange}
>
Nope, take me back!
</button>
</Button>
</>
);
}
5 changes: 3 additions & 2 deletions frontend/src/pages/ProfileDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "@chakra-ui/react";
import { Link, useNavigate } from "react-router-dom";
import { usePetClinicState } from "../state.ts";

Expand Down Expand Up @@ -27,13 +28,13 @@ export function ProfileDetail() {
<Link className={"links"} to="/profile-update">
Profile update
</Link>
<button
<Button
style={{ backgroundColor: "red" }}
type="button"
onClick={() => navigate("/delete-profile")}
>
Delete Profile
</button>
</Button>
</>
);
}
9 changes: 6 additions & 3 deletions frontend/src/pages/ProfileUpdate.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "@chakra-ui/react";
import type { ChangeEvent, FormEvent } from "react";
import { PasswordStrengthValidator } from "../components/PasswordStrengthValidator";
import {
Expand Down Expand Up @@ -71,10 +72,12 @@ export function ProfileUpdate() {
required={true}
/>
<PasswordStrengthValidator password={user.password} />
<button type="submit">Save</button>
<button type="button" onClick={() => navigate("/")}>
<Button colorScheme="green" type="submit">
Save
</Button>
<Button colorScheme="blue" type="button" onClick={() => navigate("/")}>
Discard
</button>
</Button>
</form>
</>
);
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/pages/Register.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useToast } from "@chakra-ui/react";
import { Button, useToast } from "@chakra-ui/react";
import { AxiosError } from "axios";
import type { ChangeEvent, FormEvent } from "react";
import { useState } from "react";
Expand Down Expand Up @@ -103,7 +103,9 @@ function Register() {
onChange={handleUserChange}
/>
<PasswordStrengthValidator password={user.password} />
<button type="submit">Register</button>
<Button colorScheme="purple" type="submit">
Register
</Button>
</form>
<Link className={"links"} to="/login">
Login
Expand Down

0 comments on commit 340b71d

Please sign in to comment.