i working on front end project for my company.project is based on next/reactJs with material-ui v5 as styling support. i am fairly familiar with MUIv5 ThemeProvider and its usage. As per company's latest requirements themeproviders color palette values should be coming from backend or should be coming from form where user types the color codes or names in respective fields and it should be reflected throughout the app. i provided them with dropdown with 2-3 color options but they want to give an option to their clients to customize the app (hope it technically possible! ;)). i am attaching the code snippets of themeprovider which utilize the useContext concept. i request you all guys to provide me some kind of solution/guidance to my problem
have a nice day ahead you guys are awesome.................
import { createTheme, responsiveFontSizes } from "@mui/material";
const primaryColor = "#02475B";
const secondaryColor = "#07AE8B";
const warningColor = "#FFA343";
const errorColor = "#CD4A4A";
const textColorLight = "#f5f5f5";
const textColorDark = "#001219";
const baseTheme = createTheme({
palette: {
mode: "light",
primary: {
main: primaryColor,
},
secondary: {
main: secondaryColor,
},
warning: {
main: warningColor,
},
error: {
main: errorColor,
},
neutral: {
main: "#f2f4f3",
},
darkNeutral: {
main: "#353c55",
},
typography: {
fontFamily: ["Nunito Sans", "sans-serif"].join(","),
},
},
});
const theme = responsiveFontSizes(baseTheme);
export default theme;
i did try calling api in theme.js file but throw an error about useContext also tried making theme component to make work ... its child to data manipulation i was successful for manipulating one color from child