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: mui theme #990

Merged
merged 3 commits into from
Dec 20, 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
10 changes: 3 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { Providers } from "./provider";
import "@styles/globals.css";
import Navbar from "@components/UI/navbar";
import Footer from "@components/UI/footer";
import { ThemeProvider } from "@mui/material";
import { theme } from "@components/UI/theme";

export default function RootLayout({
children,
Expand All @@ -20,11 +18,9 @@ export default function RootLayout({
<html lang="en">
<body className="default_background_color">
<Providers>
<ThemeProvider theme={theme}>
<Navbar />
<main className="mt-[48px]">{children}</main>
{pathname !== "/" && <Footer />}
</ThemeProvider>
<Navbar />
<main className="mt-[48px]">{children}</main>
{pathname !== "/" && <Footer />}
</Providers>
</body>
</html>
Expand Down
53 changes: 1 addition & 52 deletions app/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { NotificationProvider } from "@context/NotificationProvider";
import { LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { getConnectors } from "@utils/walletConfig";
import theme from "@styles/theme";

// Traffic measures
if (typeof window !== "undefined") {
Expand All @@ -47,58 +48,6 @@ export function Providers({ children }: { children: React.ReactNode }) {
}),
});

const theme = createTheme({
palette: {
primary: {
main: "#6affaf",
light: "#5ce3fe",
},
secondary: {
main: "#f4faff",
dark: "#eae0d5",
},
background: {
default: "#29282b",
},
},
components: {
MuiTabs: {
styleOverrides: {
root: {
"& .MuiTabs-flexContainer": {
display: "flex",
flexDirection: "column", // For mobile versions
alignItems: "center",
["@media (min-width:768px)"]: {
flexDirection: "row", // For desktop versions
},
},
},
// Overrides the styles for the selected tab indicator
indicator: {
backgroundColor: "transparent",
},
},
},
MuiTab: {
styleOverrides: {
// Overrides the styles for unselected tabs
root: {
color: "#E1DCEA", // Text color for unselected tabs
width: "100%",
["@media (min-width:768px)"]: {
width: "fit-content",
},
"&.Mui-selected": {
color: "#000", // Text color for the selected tab
backgroundColor: "#fff", // Background of the selected tab
},
},
},
},
},
});

return (
<StarknetConfig
chains={chains}
Expand Down
13 changes: 0 additions & 13 deletions components/UI/theme.tsx

This file was deleted.

49 changes: 44 additions & 5 deletions styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,56 @@ import { createTheme } from "@mui/material/styles";
const theme = createTheme({
palette: {
primary: {
light: "#6affaf",
main: "#6affaf",
dark: "#6affaf",
light: "#5ce3fe",
},
secondary: {
light: "#f4faff",
main: "#f4faff",
dark: "#e1dcea",
dark: "#eae0d5",
},
background: {
default: "#101012",
default: "#29282b",
},
Marchand-Nicolas marked this conversation as resolved.
Show resolved Hide resolved
},
components: {
MuiModal: {
defaultProps: {
disableScrollLock: true,
},
},
Marchand-Nicolas marked this conversation as resolved.
Show resolved Hide resolved
MuiTabs: {
styleOverrides: {
root: {
"& .MuiTabs-flexContainer": {
display: "flex",
flexDirection: "column", // For mobile versions
alignItems: "center",
["@media (min-width:768px)"]: {
flexDirection: "row", // For desktop versions
},
},
},
// Overrides the styles for the selected tab indicator
indicator: {
backgroundColor: "transparent",
},
},
},
MuiTab: {
styleOverrides: {
// Overrides the styles for unselected tabs
root: {
color: "#E1DCEA", // Text color for unselected tabs
width: "100%",
["@media (min-width:768px)"]: {
width: "fit-content",
},
"&.Mui-selected": {
color: "#000", // Text color for the selected tab
backgroundColor: "#fff", // Background of the selected tab
},
},
},
Marchand-Nicolas marked this conversation as resolved.
Show resolved Hide resolved
},
},
});
Expand Down
Loading