diff --git a/client-web/src/pages/AppBuilder/AppBuilder.tsx b/client-web/src/pages/AppBuilder/AppBuilder.tsx index c0dd71bf..0ccf6c1c 100644 --- a/client-web/src/pages/AppBuilder/AppBuilder.tsx +++ b/client-web/src/pages/AppBuilder/AppBuilder.tsx @@ -1,6 +1,14 @@ import { useEffect, useRef, useState } from "react"; import AppMock from "../../components/AppBuilder/AppMock"; -import { Box, Button, TextField, Typography } from "@mui/material"; +import { + Box, + Button, + Chip, + Divider, + TextField, + Tooltip, + Typography, +} from "@mui/material"; import { httpWithAuth, updateAppSettings } from "../../http"; import { useParams } from "react-router"; import { intervalToDuration } from "date-fns"; @@ -13,7 +21,10 @@ import { } from "../../utils"; import { config } from "../../config"; import useDebounce from "../../hooks/useDebounce"; - +import UploadFileIcon from "@mui/icons-material/UploadFile"; +import DownloadIcon from "@mui/icons-material/Download"; +import InfoIcon from "@mui/icons-material/Info"; +import OpenInNewIcon from "@mui/icons-material/OpenInNew"; export interface TCustomDetails { primaryColor: string; secondaryColor: string; @@ -209,6 +220,7 @@ export default function AppBuilder() { try { const res = await updateAppSettings(appId, data); updateApp(res.data.result); + showSnackbar('success', 'Your app is ready to use') } catch (error) { showSnackbar("error", "Cannot save settings"); console.log({ error }); @@ -266,6 +278,10 @@ export default function AppBuilder() { } setLoading(false); }; + const openAppDomain = () => { + const url = "https://" + app.domainName + "." + config.DOMAIN_NAME; + window.open(url, "_blank"); + }; return (
- - General Appearance - - - - setPrimaryColor(e.target.value)} + + - - - - - + + + + setPrimaryColor(e.target.value)} + style={{ + outline: "none", + border: "1px solid grey", + + borderRadius: "100%", + width: 40, + height: 40, + backgroundColor: primaryColor, + padding: 10, + }} + /> + + - - setSecondaryColor(e.target.value)} - /> - - - setCoinName(e.target.value)} - helperText={ - "Name of your internal coin used for gamification and token economy. Leave “Coin” if unsure." - } - /> - - {/* + + setSecondaryColor(e.target.value)} + style={{ + outline: "none", + borderRadius: "100%", + width: 40, + height: 40, + backgroundColor: secondaryColor, + border: "1px solid grey", + padding: 10, + }} + /> + + + + + + + setCoinName(e.target.value)} + // helperText={ + // "Name of your internal coin used for gamification and token economy. Leave “Coin” if unsure." + // } + /> + + + + + {/* setCoinSymbol(e.target.value)} /> */} - - App Logo - - - - - Recommended size: 500px x 500px - - - - - Login Screen Background - + + - OR - - setLoginScreenBackground({ - file: undefined, - value: e.target.value, - }) - } - sx={{ minWidth: 150 }} - /> + + Recommended size: 500px x 500px + - - - - - Mobile App - - - - - setBundleId(e.target.value)} - value={bundleId} - helperText={ - "Bundle ID should be unique to identify your app for Appstore and other purposes." - } - /> - {buildStage === "download" ? ( + + - - Expires in {fileTimeToLive && fileTimeToLive.hours + "h"}{" "} - {fileTimeToLive && fileTimeToLive.minutes + "m"} - + OR + + + + setLoginScreenBackground({ + file: undefined, + value: e.target.value, + }) + } + style={{ + outline: "none", + borderRadius: "100%", + width: 40, + height: 40, + backgroundColor: isValidHexCode( + loginScreenBackground.value + ) + ? loginScreenBackground.value + : "#fffff", + border: "1px solid grey", + padding: 10, + }} + /> + + + + + + - ) : ( - - {buildStage === "preparing" ? "Preparing" : "Prepare"} React - Native build - - )} + - - - Web App - - - - +
+ + + + + + setBundleId(e.target.value)} + value={bundleId} + helperText={ + "Bundle ID should be unique to identify your app for Appstore and other purposes." + } + /> + {buildStage === "download" ? ( + + + + Expires in {fileTimeToLive && fileTimeToLive.hours + "h"}{" "} + {fileTimeToLive && fileTimeToLive.minutes + "m"} + + + ) : ( + } + > + {buildStage === "preparing" ? "Preparing" : "Prepare"} React + Native build + + )} + + +
+
+ + + + - {"." + config.DOMAIN_NAME} - - + + + + {"." + config.DOMAIN_NAME} + + + + +
); -} \ No newline at end of file +}