Skip to content

Commit

Permalink
fix: white button on white background
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Mar 19, 2024
1 parent 1ce7746 commit e640b9d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
3 changes: 0 additions & 3 deletions src/components/applications/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { useRouter } from "next/navigation";
import { useOIDCContext } from "@/hooks/oidcConfiguration";
import * as React from "react";
import { useOidc } from "@axa-fr/react-oidc";
import { deepOrange, lightGreen } from "@mui/material/colors";

/**
* Login form
Expand Down Expand Up @@ -201,8 +200,6 @@ export function LoginForm() {
<Button
variant="contained"
sx={{
bgcolor: lightGreen[700],
"&:hover": { bgcolor: deepOrange[500] },
flexGrow: 1,
}}
onClick={handleConfigurationChanges}
Expand Down
7 changes: 2 additions & 5 deletions src/components/ui/DashboardButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useOIDCContext } from "@/hooks/oidcConfiguration";
import { useOidc } from "@axa-fr/react-oidc";
import { Button } from "@mui/material";
import { deepOrange, lightGreen } from "@mui/material/colors";
import Link from "next/link";

/**
Expand All @@ -19,12 +18,10 @@ export function DashboardButton() {

return (
<Button
sx={{
bgcolor: lightGreen[700],
"&:hover": { bgcolor: deepOrange[500] },
}}
variant="contained"
component={Link}
href="/dashboard"
style={{ margin: "3%" }}
>
Dashboard
</Button>
Expand Down
12 changes: 2 additions & 10 deletions src/components/ui/ProfileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
MenuItem,
Tooltip,
} from "@mui/material";
import { deepOrange, lightGreen } from "@mui/material/colors";
import { deepOrange } from "@mui/material/colors";
import React from "react";

/**
Expand Down Expand Up @@ -47,15 +47,7 @@ export function ProfileButton() {

if (!isAuthenticated) {
return (
<Button
sx={{
bgcolor: lightGreen[700],
"&:hover": { bgcolor: deepOrange[500] },
}}
variant="contained"
component={Link}
href="/auth"
>
<Button variant="contained" component={Link} href="/auth">
Login
</Button>
);
Expand Down
27 changes: 27 additions & 0 deletions src/hooks/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ThemeContext } from "@/contexts/ThemeProvider";
import { PaletteMode } from "@mui/material";
import deepOrange from "@mui/material/colors/deepOrange";
import lightGreen from "@mui/material/colors/lightGreen";
import { createTheme } from "@mui/material/styles";
import { useContext } from "react";

Expand Down Expand Up @@ -33,6 +35,31 @@ export const useMUITheme = () => {
main: "#ffffff",
},
},
components: {
MuiButton: {
styleOverrides: {
contained: {
// Target the 'contained' variant
color: "white",
backgroundColor: lightGreen[700],
"&:hover": {
color: "white",
backgroundColor: deepOrange[500],
},
},
outlined: {
// Target the 'outlined' variant
color: lightGreen[700],
borderColor: lightGreen[700],
"&:hover": {
color: deepOrange[500],
borderColor: deepOrange[500],
backgroundColor: "transparent",
},
},
},
},
},
});

return muiTheme;
Expand Down

0 comments on commit e640b9d

Please sign in to comment.