converted frontend from tailwind to material-ui using AI
parent
3e5e728d92
commit
70b690ab9d
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
|||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,27 +1,40 @@
|
|||||||
import { useLocation } from "preact-iso";
|
import { useLocation } from "preact-iso";
|
||||||
|
import { AppBar, Toolbar, Button, Box } from "@mui/material";
|
||||||
|
import { styled } from "@mui/system";
|
||||||
|
|
||||||
|
const StyledToolbar = styled(Toolbar)({
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
backgroundColor: "#E0E7FF", // Indigo-200 equivalent
|
||||||
|
});
|
||||||
|
|
||||||
|
const StyledButton = styled(Button)(({ theme, active }) => ({
|
||||||
|
color: theme.palette.text.primary,
|
||||||
|
fontWeight: active ? "bold" : "normal",
|
||||||
|
textDecoration: active ? "underline" : "none",
|
||||||
|
}));
|
||||||
|
|
||||||
export function Header() {
|
export function Header() {
|
||||||
const { url } = useLocation();
|
const { url } = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header class="flex flex-row justify-center">
|
<AppBar position="static" elevation={0}>
|
||||||
<nav class="flex flex-row justify-center text-lg gap-4 max-w-5xl py-2 px-3 rounded-full bg-indigo-200">
|
<StyledToolbar>
|
||||||
<a
|
<Box sx={{ display: "flex", gap: 2 }}>
|
||||||
href="/"
|
<StyledButton
|
||||||
class={
|
href="/"
|
||||||
(url === "/" || url === "/historical-calendar-prices") &&
|
active={url === "/" || url === "/historical-calendar-prices"}
|
||||||
"underline font-bold"
|
>
|
||||||
}
|
Historical Calendar Prices
|
||||||
>
|
</StyledButton>
|
||||||
Historical Calendar Prices
|
<StyledButton
|
||||||
</a>
|
href="/calendar-optimizer"
|
||||||
<a
|
active={url === "/calendar-optimizer"}
|
||||||
href="/calendar-optimizer"
|
>
|
||||||
class={url === "/calendar-optimizer" && "underline font-bold"}
|
Calendar Optimizer
|
||||||
>
|
</StyledButton>
|
||||||
Calendar Optimizer
|
</Box>
|
||||||
</a>
|
</StyledToolbar>
|
||||||
</nav>
|
</AppBar>
|
||||||
</header>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -1,32 +1,37 @@
|
|||||||
import _ from "./env";
|
|
||||||
import { render } from "preact";
|
import { render } from "preact";
|
||||||
import { LocationProvider, Router, Route } from "preact-iso";
|
import { LocationProvider, Router, Route } from "preact-iso";
|
||||||
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
||||||
|
import CssBaseline from '@mui/material/CssBaseline';
|
||||||
|
|
||||||
import { Header } from "./components/Header.jsx";
|
import { Header } from "./components/Header.jsx";
|
||||||
import { CalendarOptimizer } from "./pages/CalendarOptimizer.js";
|
import { CalendarOptimizer } from "./pages/CalendarOptimizer.js";
|
||||||
import { NotFound } from "./pages/_404.jsx";
|
import { NotFound } from "./pages/_404.jsx";
|
||||||
// import './style.css';
|
|
||||||
import { HistoricalCalendarPrices } from "./pages/HistoricalCalendarPrices.js";
|
import { HistoricalCalendarPrices } from "./pages/HistoricalCalendarPrices.js";
|
||||||
|
|
||||||
|
const theme = createTheme();
|
||||||
|
|
||||||
export function App() {
|
export function App() {
|
||||||
return (
|
return (
|
||||||
<LocationProvider>
|
<ThemeProvider theme={theme}>
|
||||||
<div class="flex flex-col justify-start gap-4">
|
<CssBaseline />
|
||||||
<Header />
|
<LocationProvider>
|
||||||
<main>
|
<div>
|
||||||
<Router>
|
<Header />
|
||||||
<Route path="/" component={HistoricalCalendarPrices} />
|
<main>
|
||||||
<Route path="/calendar-optimizer" component={CalendarOptimizer} />
|
<Router>
|
||||||
<Route
|
<Route path="/" component={HistoricalCalendarPrices} />
|
||||||
path="/historical-calendar-prices"
|
<Route path="/calendar-optimizer" component={CalendarOptimizer} />
|
||||||
component={HistoricalCalendarPrices}
|
<Route
|
||||||
/>
|
path="/historical-calendar-prices"
|
||||||
<Route default component={NotFound} />
|
component={HistoricalCalendarPrices}
|
||||||
</Router>
|
/>
|
||||||
</main>
|
<Route default component={NotFound} />
|
||||||
</div>
|
</Router>
|
||||||
</LocationProvider>
|
</main>
|
||||||
|
</div>
|
||||||
|
</LocationProvider>
|
||||||
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(<App />, document.getElementById("app"));
|
render(<App />, document.getElementById("app"));
|
@ -1,13 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
export default {
|
|
||||||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
|
|
||||||
theme: {
|
|
||||||
extend: {
|
|
||||||
width: {
|
|
||||||
128: "32rem",
|
|
||||||
160: "40rem",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
};
|
|
Loading…
Reference in New Issue