Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make buttons visible #106

Merged
merged 3 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading