Replace cloudscape on behalf of MUI
parent
26b228197e
commit
44b3ef8b70
File diff suppressed because it is too large
Load Diff
|
|
@ -11,9 +11,12 @@
|
||||||
"format": "prettier . --write"
|
"format": "prettier . --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cloudscape-design/components": "^3.0.1132",
|
"@emotion/react": "^11.14.0",
|
||||||
"@cloudscape-design/global-styles": "^1.0.47",
|
"@emotion/styled": "^11.14.1",
|
||||||
|
"@mui/material": "^7.3.5",
|
||||||
|
"@mui/x-date-pickers": "^8.19.0",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
|
"dayjs": "^1.11.19",
|
||||||
"react": "^19.2.0",
|
"react": "^19.2.0",
|
||||||
"react-dom": "^19.2.0",
|
"react-dom": "^19.2.0",
|
||||||
"react-intl": "^7.1.14",
|
"react-intl": "^7.1.14",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
.app-logo {
|
.app-logo {
|
||||||
max-width: 40%;
|
max-width: 200px;
|
||||||
margin: 0 30%;
|
border-radius: 10%;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
32
src/App.tsx
32
src/App.tsx
|
|
@ -1,9 +1,5 @@
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import { Login } from "./pages/Login.tsx";
|
import { Login } from "./pages/Login.tsx";
|
||||||
import {
|
|
||||||
ContentLayout,
|
|
||||||
SpaceBetween
|
|
||||||
} from "@cloudscape-design/components";
|
|
||||||
import icon from "./paella-icon.png";
|
import icon from "./paella-icon.png";
|
||||||
import { Outlet, Route, Routes } from "react-router";
|
import { Outlet, Route, Routes } from "react-router";
|
||||||
import { SignUp } from "./pages/SignUp.tsx";
|
import { SignUp } from "./pages/SignUp.tsx";
|
||||||
|
|
@ -14,19 +10,33 @@ import { PreLoginPageContext } from "./context/pre-login-page-context.ts";
|
||||||
import { LoggedInPageContext } from "./context/logged-in-page-context.ts";
|
import { LoggedInPageContext } from "./context/logged-in-page-context.ts";
|
||||||
import { NotFound } from "./pages/NotFound.tsx";
|
import { NotFound } from "./pages/NotFound.tsx";
|
||||||
import { BuyReturn } from "./pages/BuyReturn.tsx";
|
import { BuyReturn } from "./pages/BuyReturn.tsx";
|
||||||
|
import { Grid, Paper } from "@mui/material";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const locallyStoredUserId = window.localStorage.getItem("paysplit-user-id");
|
const locallyStoredUserId = window.localStorage.getItem("paysplit-user-id");
|
||||||
const locallyStoredUserIdAsNumber = locallyStoredUserId ? parseInt(locallyStoredUserId) : null
|
const locallyStoredUserIdAsNumber = locallyStoredUserId
|
||||||
const [userId, setUserId] = useState<number | null>(locallyStoredUserIdAsNumber);
|
? parseInt(locallyStoredUserId)
|
||||||
|
: null;
|
||||||
|
const [userId, setUserId] = useState<number | null>(
|
||||||
|
locallyStoredUserIdAsNumber,
|
||||||
|
);
|
||||||
const storeUserId = (id: number) => {
|
const storeUserId = (id: number) => {
|
||||||
window.localStorage.setItem("paysplit-user-id", id.toString());
|
window.localStorage.setItem("paysplit-user-id", id.toString());
|
||||||
setUserId(id);
|
setUserId(id);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ContentLayout defaultPadding maxContentWidth={500}>
|
<Paper
|
||||||
<SpaceBetween size="m">
|
elevation={2}
|
||||||
|
sx={{
|
||||||
|
padding: "50px 20px",
|
||||||
|
bgcolor: "lightblue",
|
||||||
|
borderRadius: 4,
|
||||||
|
maxWidth: "400px",
|
||||||
|
margin: "auto",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid container direction="column" alignContent="center" spacing={2}>
|
||||||
<img className="app-logo" src={icon} alt="App logo" />
|
<img className="app-logo" src={icon} alt="App logo" />
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
|
|
@ -52,8 +62,8 @@ function App() {
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="*" element={<NotFound />} />
|
<Route path="*" element={<NotFound />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</SpaceBetween>
|
</Grid>
|
||||||
</ContentLayout>
|
</Paper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,16 @@ import { createRoot } from "react-dom/client";
|
||||||
import App from "./App.tsx";
|
import App from "./App.tsx";
|
||||||
import { BrowserRouter } from "react-router";
|
import { BrowserRouter } from "react-router";
|
||||||
import { IntlProvider } from "react-intl";
|
import { IntlProvider } from "react-intl";
|
||||||
|
import { LocalizationProvider } from "@mui/x-date-pickers";
|
||||||
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!).render(
|
createRoot(document.getElementById("root")!).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<IntlProvider locale="es-ES" messages={{}}>
|
<IntlProvider locale="es-ES" messages={{}}>
|
||||||
<App />
|
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
||||||
|
<App />
|
||||||
|
</LocalizationProvider>
|
||||||
</IntlProvider>
|
</IntlProvider>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</StrictMode>,
|
</StrictMode>,
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,76 @@
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Container,
|
|
||||||
Header,
|
|
||||||
Input,
|
|
||||||
SpaceBetween,
|
|
||||||
} from "@cloudscape-design/components";
|
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
import { startBuyFlow } from "../api/client";
|
import { startBuyFlow } from "../api/client";
|
||||||
import { LoggedInPageContext } from "../context/logged-in-page-context";
|
import { LoggedInPageContext } from "../context/logged-in-page-context";
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
FormControlLabel,
|
||||||
|
Grid,
|
||||||
|
Paper,
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
|
import { useNavigate } from "react-router";
|
||||||
|
|
||||||
export const Buy = () => {
|
export const Buy = () => {
|
||||||
const [quantity, setQuantity] = useState(0);
|
const [quantity, setQuantity] = useState(0);
|
||||||
const { userId } = useContext(LoggedInPageContext)!;
|
const { userId } = useContext(LoggedInPageContext)!;
|
||||||
|
const navigate = useNavigate();
|
||||||
const handleBuyFlow = () =>
|
const handleBuyFlow = () =>
|
||||||
startBuyFlow(userId, quantity).then(
|
startBuyFlow(userId, quantity).then(
|
||||||
(response) => (window.location.href = response.data.url),
|
(response) => (window.location.href = response.data.url),
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Grid container direction="column" spacing={2} alignItems="center">
|
||||||
<SpaceBetween size="s">
|
<Typography variant="h3">Buy tokens</Typography>
|
||||||
<Header>Buy tokens</Header>
|
|
||||||
<Input
|
<Paper
|
||||||
type="number"
|
variant="outlined"
|
||||||
|
sx={{
|
||||||
|
p: 5,
|
||||||
|
bgcolor: "aliceblue",
|
||||||
|
borderRadius: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<RadioGroup
|
||||||
value={quantity.toString()}
|
value={quantity.toString()}
|
||||||
onChange={(e) => setQuantity(parseInt(e.detail.value))}
|
onChange={(e) => setQuantity(parseInt(e.target.value))}
|
||||||
/>
|
>
|
||||||
<Button onClick={handleBuyFlow}>Buy</Button>
|
<FormControlLabel
|
||||||
</SpaceBetween>
|
value="1"
|
||||||
</Container>
|
control={<Radio />}
|
||||||
|
label="1 token - 4€"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="5"
|
||||||
|
control={<Radio />}
|
||||||
|
label="5 tokens - 20€"
|
||||||
|
/>
|
||||||
|
<FormControlLabel
|
||||||
|
value="10"
|
||||||
|
control={<Radio />}
|
||||||
|
label="10 tokens - 40"
|
||||||
|
/>
|
||||||
|
</RadioGroup>
|
||||||
|
</Paper>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
onClick={handleBuyFlow}
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
sx={{ width: "100%" }}
|
||||||
|
>
|
||||||
|
Buy
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={() => navigate("/signup")}
|
||||||
|
variant="contained"
|
||||||
|
color="secondary"
|
||||||
|
sx={{ width: "100%" }}
|
||||||
|
>
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
import { Header, SpaceBetween, Spinner } from "@cloudscape-design/components";
|
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import { completeBuyFlow } from "../api/client";
|
import { completeBuyFlow } from "../api/client";
|
||||||
import { LoggedInPageContext } from "../context/logged-in-page-context";
|
import { LoggedInPageContext } from "../context/logged-in-page-context";
|
||||||
|
import { CircularProgress, Grid, Typography } from "@mui/material";
|
||||||
|
|
||||||
export const BuyReturn = () => {
|
export const BuyReturn = () => {
|
||||||
const { userId } = useContext(LoggedInPageContext)!;
|
const { userId } = useContext(LoggedInPageContext)!;
|
||||||
completeBuyFlow(userId).then(
|
completeBuyFlow(userId).then(
|
||||||
(response) => (window.location.href = response.data.url),
|
(response) => (window.location.href = response.data.url),
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpaceBetween size="m" direction="horizontal">
|
<Grid container direction="column" spacing={6} alignItems="center">
|
||||||
<Spinner size="big" />
|
<Typography variant="h5">We are processing your request</Typography>
|
||||||
<Header>We are processing your request</Header>
|
<CircularProgress size={50} color="inherit" />
|
||||||
</SpaceBetween>
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Input,
|
|
||||||
Checkbox,
|
|
||||||
Header,
|
|
||||||
SpaceBetween,
|
|
||||||
} from "@cloudscape-design/components";
|
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
import { login } from "../api/client";
|
import { login } from "../api/client";
|
||||||
import { Link, useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { PreLoginPageContext } from "../context/pre-login-page-context";
|
import { PreLoginPageContext } from "../context/pre-login-page-context";
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Checkbox,
|
||||||
|
FormControlLabel,
|
||||||
|
Grid,
|
||||||
|
TextField,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
|
|
||||||
export const Login = () => {
|
export const Login = () => {
|
||||||
const [userName, setUserName] = useState("");
|
const [userName, setUserName] = useState("");
|
||||||
|
|
@ -25,31 +26,44 @@ export const Login = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpaceBetween size="s" alignItems={"center"}>
|
<Grid container direction="column" spacing={2} alignItems="center">
|
||||||
<Header>Login</Header>
|
<Typography variant="h3">Login</Typography>
|
||||||
<Input
|
<TextField
|
||||||
value={userName}
|
value={userName}
|
||||||
onChange={(e) => setUserName(e.detail.value)}
|
onChange={(e) => setUserName(e.target.value)}
|
||||||
placeholder="User"
|
placeholder="User"
|
||||||
/>
|
/>
|
||||||
<Input
|
<TextField
|
||||||
type="password"
|
type="password"
|
||||||
value={password}
|
value={password}
|
||||||
onChange={(e) => setPassword(e.detail.value)}
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<FormControlLabel
|
||||||
checked={rememberMe}
|
control={
|
||||||
onChange={() => setRememberMe(!rememberMe)}
|
<Checkbox
|
||||||
|
checked={rememberMe}
|
||||||
|
onChange={() => setRememberMe(!rememberMe)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
label="Remember me"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
onClick={handleLoginFlow}
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
sx={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
Remember me
|
Login
|
||||||
</Checkbox>
|
|
||||||
<Button onClick={handleLoginFlow}>Login</Button>
|
|
||||||
<Button>
|
|
||||||
<Link to="/register" style={{ textDecoration: "none" }}>
|
|
||||||
Create an account
|
|
||||||
</Link>
|
|
||||||
</Button>
|
</Button>
|
||||||
</SpaceBetween>
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="secondary"
|
||||||
|
sx={{ width: "100%" }}
|
||||||
|
onClick={() => navigate("/register")}
|
||||||
|
>
|
||||||
|
Create an account
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
|
import * as zod from "zod";
|
||||||
|
import { registerUser } from "../api/client";
|
||||||
|
import { useNavigate } from "react-router";
|
||||||
|
import { PreLoginPageContext } from "../context/pre-login-page-context";
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Button,
|
Button,
|
||||||
Header,
|
Grid,
|
||||||
Input,
|
Paper,
|
||||||
SpaceBetween,
|
TextField,
|
||||||
} from "@cloudscape-design/components";
|
Typography,
|
||||||
import * as zod from "zod";
|
} from "@mui/material";
|
||||||
import { registerUser } from "../api/client";
|
|
||||||
import { Link, useNavigate } from "react-router";
|
|
||||||
import { PreLoginPageContext } from "../context/pre-login-page-context";
|
|
||||||
|
|
||||||
export const Register = () => {
|
export const Register = () => {
|
||||||
const [userName, setUserName] = useState("");
|
const [userName, setUserName] = useState("");
|
||||||
|
|
@ -57,39 +58,62 @@ export const Register = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpaceBetween size="s" alignItems={"center"}>
|
<>
|
||||||
<Header>Register</Header>
|
<Grid container direction="column" spacing={2} alignItems="center">
|
||||||
<Input
|
<Typography variant="h3">Register</Typography>
|
||||||
value={userName}
|
<TextField
|
||||||
onChange={(e) => setUserName(e.detail.value)}
|
value={userName}
|
||||||
placeholder="User name"
|
onChange={(e) => setUserName(e.target.value)}
|
||||||
/>
|
placeholder="User name"
|
||||||
<Input
|
/>
|
||||||
type="password"
|
<TextField
|
||||||
value={password}
|
type="password"
|
||||||
onChange={(e) => setPassword(e.detail.value)}
|
value={password}
|
||||||
placeholder="Password"
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
/>
|
placeholder="Password"
|
||||||
<Input
|
/>
|
||||||
type="password"
|
<TextField
|
||||||
value={passwordConfirm}
|
type="password"
|
||||||
onChange={(e) => setPasswordConfirm(e.detail.value)}
|
value={passwordConfirm}
|
||||||
placeholder="Confirm password"
|
onChange={(e) => setPasswordConfirm(e.target.value)}
|
||||||
/>
|
placeholder="Confirm password"
|
||||||
{passwordErrors.map((error) => (
|
/>
|
||||||
<Alert type="error">{error}</Alert>
|
<Button
|
||||||
))}
|
disabled={passwordErrors.length !== 0}
|
||||||
<Button
|
variant="contained"
|
||||||
disabled={passwordErrors.length !== 0}
|
color="primary"
|
||||||
onClick={handleRegisterFlow}
|
sx={{ width: "100%" }}
|
||||||
>
|
onClick={handleRegisterFlow}
|
||||||
Register
|
>
|
||||||
</Button>
|
Register
|
||||||
<Button>
|
</Button>
|
||||||
<Link to="/login" style={{ textDecoration: "none" }}>
|
<Button
|
||||||
Login with existing account
|
onClick={() => navigate("/login")}
|
||||||
</Link>
|
variant="contained"
|
||||||
</Button>
|
sx={{ width: "100%" }}
|
||||||
</SpaceBetween>
|
color="secondary"
|
||||||
|
>
|
||||||
|
Login
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
{!!passwordErrors.length && (
|
||||||
|
<Paper
|
||||||
|
elevation={2}
|
||||||
|
sx={{
|
||||||
|
p: 1,
|
||||||
|
bgcolor: "white",
|
||||||
|
borderRadius: 4,
|
||||||
|
maxWidth: "400px",
|
||||||
|
margin: "auto",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid container direction="column" spacing={2}>
|
||||||
|
{passwordErrors.map((error) => (
|
||||||
|
<Alert severity="error">{error}</Alert>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,65 +1,105 @@
|
||||||
import {
|
import { Button, Grid, Paper, Typography } from "@mui/material";
|
||||||
Calendar,
|
import { DateCalendar } from "@mui/x-date-pickers";
|
||||||
Button,
|
|
||||||
SpaceBetween,
|
|
||||||
Container,
|
|
||||||
Header,
|
|
||||||
} from "@cloudscape-design/components";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { FormattedDate } from "react-intl";
|
import { FormattedDate } from "react-intl";
|
||||||
import { Link } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
|
import { Dayjs } from "dayjs";
|
||||||
|
|
||||||
export const SignUp = () => {
|
export const SignUp = () => {
|
||||||
const [selectedDate, setSelectedDate] = useState<string | null>(null);
|
const [selectedDate, setSelectedDate] = useState<Dayjs | null>(null);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const tuesday = 2;
|
const tuesday = 2;
|
||||||
const thursday = 4;
|
const thursday = 4;
|
||||||
const isDateEnabled = (date: Date) =>
|
const isDateDisabled = (day: Dayjs) =>
|
||||||
[tuesday, thursday].includes(date.getDay());
|
![tuesday, thursday].includes(day.day());
|
||||||
const availableSlots: number = 3;
|
const availableSlots: number = 3;
|
||||||
const availableTokens: number = 0;
|
const availableTokens: number = 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpaceBetween size="s" alignItems={"center"}>
|
<Grid container direction="column" spacing={2} alignItems="center">
|
||||||
<Container>
|
<Typography variant="h3">Pick a date</Typography>
|
||||||
<Header>Pick a date</Header>
|
<Paper
|
||||||
<Calendar
|
variant="outlined"
|
||||||
value={selectedDate || ""}
|
sx={{
|
||||||
onChange={(e) => setSelectedDate(e.detail.value)}
|
p: 1,
|
||||||
isDateEnabled={isDateEnabled}
|
bgcolor: "aliceblue",
|
||||||
|
borderRadius: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DateCalendar
|
||||||
|
value={selectedDate}
|
||||||
|
onChange={setSelectedDate}
|
||||||
|
shouldDisableDate={isDateDisabled}
|
||||||
|
slotProps={{
|
||||||
|
day: {
|
||||||
|
sx: {
|
||||||
|
fontSize: "0.9rem",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
{selectedDate && (
|
</Paper>
|
||||||
<>
|
{selectedDate && (
|
||||||
<Header>
|
<Paper
|
||||||
<FormattedDate
|
variant="outlined"
|
||||||
value={selectedDate}
|
sx={{
|
||||||
day="numeric"
|
p: 3,
|
||||||
month="long"
|
bgcolor: "aliceblue",
|
||||||
year="numeric"
|
borderRadius: 4,
|
||||||
/>
|
}}
|
||||||
</Header>
|
>
|
||||||
{availableSlots === 0 ? (
|
<Typography variant="h5">
|
||||||
<p>There are no available slots for this date.</p>
|
<FormattedDate
|
||||||
) : (
|
value={selectedDate.day()}
|
||||||
<>
|
day="numeric"
|
||||||
<p>There are {availableSlots} available slots for this date.</p>
|
month="long"
|
||||||
<Button disabled={!availableTokens}>Sign up</Button>
|
year="numeric"
|
||||||
</>
|
/>
|
||||||
)}
|
</Typography>
|
||||||
</>
|
{availableSlots === 0 ? (
|
||||||
)}
|
<Typography variant="subtitle1">
|
||||||
</Container>
|
There are no available slots for this date.
|
||||||
{!availableTokens && (
|
</Typography>
|
||||||
<Container>
|
) : (
|
||||||
<p>
|
<>
|
||||||
You don't have any tokens to sign up to a slot, please buy here.
|
<Typography variant="subtitle1">
|
||||||
</p>
|
There are {availableSlots} available slots for this date.
|
||||||
<Button>
|
</Typography>
|
||||||
<Link to="/buy" style={{ textDecoration: "none" }}>
|
<Button
|
||||||
Buy
|
variant="contained"
|
||||||
</Link>
|
color="primary"
|
||||||
</Button>
|
sx={{ width: "100%" }}
|
||||||
</Container>
|
disabled={!availableTokens}
|
||||||
|
>
|
||||||
|
Sign up
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Paper>
|
||||||
)}
|
)}
|
||||||
</SpaceBetween>
|
{!availableTokens && (
|
||||||
|
<Paper
|
||||||
|
variant="outlined"
|
||||||
|
sx={{
|
||||||
|
p: 3,
|
||||||
|
bgcolor: "aliceblue",
|
||||||
|
borderRadius: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
You don't have any tokens to sign up
|
||||||
|
</Typography>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="secondary"
|
||||||
|
sx={{ width: "100%" }}
|
||||||
|
onClick={() => navigate("/buy")}
|
||||||
|
>
|
||||||
|
Buy
|
||||||
|
</Button>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ const baseServerConfigBuilder = (domain: string) => ({
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
...baseServerConfigBuilder("localhost"),
|
...baseServerConfigBuilder("localhost"),
|
||||||
host: true
|
host: true,
|
||||||
},
|
},
|
||||||
preview: baseServerConfigBuilder("paysplit-app"),
|
preview: baseServerConfigBuilder("paysplit-app"),
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue