add publish script and work on registery pages

This commit is contained in:
2023-07-24 12:52:58 +03:30
parent 14b13e1309
commit a9929e8a09
8 changed files with 68 additions and 23 deletions

View File

@@ -1,3 +1,4 @@
import LinkRouting from "@/core/components/LinkRouting";
import Notifications from "@/core/components/notifications";
import StyledForm from "@/core/components/StyledForm";
import { REGISTER } from "@/core/data/apiRoutes";
@@ -6,12 +7,17 @@ import FullPageLayout from "@/layouts/FullPageLayout";
import useDirection from "@/lib/app/hooks/useDirection";
import useUser from "@/lib/app/hooks/useUser";
import LoginIcon from "@mui/icons-material/Login";
import ReplyAllIcon from "@mui/icons-material/ReplyAll";
import {
Box,
Button,
Container,
Grid,
Link,
Paper,
Stack, TextField, Typography
Stack,
TextField,
Typography,
} from "@mui/material";
import axios from "axios";
import { Field, Formik } from "formik";
@@ -19,7 +25,7 @@ import { useTranslations } from "next-intl";
import Image from "next/image";
import * as Yup from "yup";
const SendToken = ({ PhoneNumber, nationalId, navganId, typeId }) => {
const SendToken = ({ PhoneNumber, nationalId, navganId, typeId, setOtpToken }) => {
const t = useTranslations();
const { directionApp } = useDirection();
const { setToken } = useUser();
@@ -106,6 +112,33 @@ const SendToken = ({ PhoneNumber, nationalId, navganId, typeId }) => {
: null
}
/>
{/* <Grid
container
rowSpacing={{ xs: 1, sm: 0 }}
sx={{
flexDirection: { xs: "column-reverse", sm: "row" },
}}
>
<Grid item xs={12} sm={6} sx={{ pr: { xs: 0, sm: 1 } }}>
<Button
fullWidth
type="back"
variant="outlined"
size="large"
onClick={() => setOtpToken(false)}
endIcon={<ReplyAllIcon />}
disabled={props.isSubmitting ? true : false}
>
{t("RegisterPage.button_back_to_send_data")}
</Button>
</Grid> */}
{/* <Grid item xs={12} sm={6} sx={{ pl: { xs: 0, sm: 1 } }}> */}
<Button size="small" onClick={() => setOtpToken(false)}>
<Link underline="hover">
{t("RegisterPage.sent_token_to")}: {PhoneNumber}{" "}
{t("RegisterPage.change_phone_number")}
</Link>
</Button>
<Button
fullWidth
type="submit"
@@ -116,6 +149,8 @@ const SendToken = ({ PhoneNumber, nationalId, navganId, typeId }) => {
>
{t("RegisterPage.button_submit")}
</Button>
{/* </Grid> */}
{/* </Grid> */}
</Stack>
</StyledForm>
</Stack>

View File

@@ -23,8 +23,11 @@ import * as Yup from "yup";
const SendUserData = ({
setOtpToken,
setPhoneNumber,
PhoneNumber,
setNationalId,
nationalId,
setNavganId,
navganId,
setTypeId,
}) => {
const t = useTranslations();
@@ -35,9 +38,9 @@ const SendUserData = ({
const initialValues = {
type_id: "1",
phone_number: "",
national_id: "",
navgan_id: "",
phone_number: PhoneNumber,
national_id: nationalId,
navgan_id: navganId,
};
const validationSchema = Yup.object().shape({
phone_number: Yup.string().required(

View File

@@ -17,6 +17,9 @@ const RegisterNavyComponent = () => {
setNationalId={setNationalId}
setNavganId={setNavganId}
setTypeId={setTypeId}
PhoneNumber={PhoneNumber}
nationalId={nationalId}
navganId={navganId}
/>
);
} else {
@@ -26,6 +29,7 @@ const RegisterNavyComponent = () => {
nationalId={nationalId}
navganId={navganId}
typeId={typeId}
setOtpToken={setOtpToken}
/>
);
}