Merge branch 'main' of http://git.wdipl.com/Siddhesh.More/SSA-Admin-Panel into yasin
This commit is contained in:
4
.env
4
.env
@@ -1,2 +1,4 @@
|
||||
VITE_API_URL=https://ssa.betadelivery.com/apia
|
||||
VITE_API_URL=https://ssa.betadelivery.com/apia/v1
|
||||
VITE_USER_NAME="Admin"
|
||||
VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt"
|
||||
VITE_APP_NAME=MyViteApp
|
||||
@@ -27,26 +27,47 @@ const Login = () => {
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
} = useForm<FormValues>();
|
||||
} = useForm<FormValues>()
|
||||
|
||||
const onSubmit = handleSubmit(async (data) => {
|
||||
setIsLoading(true);
|
||||
|
||||
// Encode Basic Auth Credentials
|
||||
const username = import.meta.env.VITE_USER_NAME||''; // Replace with actual username
|
||||
const password = import.meta.env.VITE_PASSWORD||''; // Replace with actual password
|
||||
const basicAuth = btoa(`${username}:${password}`); // Encode to Base64
|
||||
|
||||
try {
|
||||
const response = await axios.post(
|
||||
`${import.meta.env.VITE_API_URL}/v1/login`,
|
||||
{
|
||||
mobile_number: data.mobileNumber,
|
||||
password: data.password,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Basic ${basicAuth}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
console.log("====================================");
|
||||
console.log(response);
|
||||
console.log("====================================");
|
||||
dispatch(setToken(String(response.data["access-token"])));
|
||||
} catch (error) {
|
||||
console.error("Login failed", error);
|
||||
if (error) {
|
||||
|
||||
console.error("Login failed", error);
|
||||
setIsLoading(false)
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<VStack w={"100%"} h={"100vh"} bg={"#ffffff"}>
|
||||
|
||||
@@ -20,7 +20,7 @@ const AboutUs = () => {
|
||||
AboutUs
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<HStack>
|
||||
|
||||
<AboutUsAddModel />
|
||||
</HStack>
|
||||
|
||||
@@ -7,9 +7,9 @@ function EditDetails() {
|
||||
|
||||
<DialogRoot placement="center">
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", }} color="#000" />
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize:'16px' }} color="#000" />
|
||||
|
||||
{/* <Button><FaRegEdit /></Button> */}
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, Button, HStack, Image, Input, Text } from "@chakra-ui/react";
|
||||
import { Box, HStack, Image, Input, Text } from "@chakra-ui/react";
|
||||
import MainFrame from "../../../components/MainFrame"
|
||||
import EditDetails from "./EditDetails";
|
||||
import { InputGroup } from "../../../components/ui/input-group";
|
||||
|
||||
@@ -20,7 +20,7 @@ const PrivacyPolicy = () => {
|
||||
Privacy Policy
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<HStack >
|
||||
|
||||
<PrivacyPolicyAddModel />
|
||||
</HStack>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FaRegEdit } from "react-icons/fa"
|
||||
import { DialogBody, DialogCloseTrigger, DialogContent, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger } from "../../../components/ui/dialog"
|
||||
import { Field, Input, Stack, Text, Textarea } from "@chakra-ui/react"
|
||||
import { Field, Stack, Text, Textarea } from "@chakra-ui/react"
|
||||
import { Button } from "../../../components/ui/button"
|
||||
|
||||
function PrivacyPolicyAddModel() {
|
||||
|
||||
@@ -20,7 +20,7 @@ const TermsAndConditions = () => {
|
||||
Terms And Conditions
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<HStack >
|
||||
|
||||
<TermsAndConditionsAddModel />
|
||||
</HStack>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, HStack, Image, Input, Text } from "@chakra-ui/react";
|
||||
import { Box, HStack, Input, Text } from "@chakra-ui/react";
|
||||
import MainFrame from "../../components/MainFrame"
|
||||
import PendingRequests from "../../Pages/ManageContact/PendingRequests"
|
||||
import { InputGroup } from "../../components/ui/input-group";
|
||||
@@ -46,8 +46,8 @@ const ManageContact = () => {
|
||||
Contact Requests
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ function EditDetailGroups() {
|
||||
|
||||
<DialogRoot placement="center" >
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize:'16px'}} color="#000"/>
|
||||
|
||||
{/* <Button><FaRegEdit /></Button> */}
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -10,9 +10,9 @@ function ViewManageGroup() {
|
||||
|
||||
<DialogRoot placement="center" >
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize:'16px'}} color="#000"/>
|
||||
|
||||
{/* <Button><FaRegEdit /></Button> */}
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -73,8 +73,8 @@ const ManageJobs = () => {
|
||||
View job Posting
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ function ManageJobsAdd() {
|
||||
|
||||
<DialogRoot placement="center">
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000" />
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000" />
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent
|
||||
|
||||
@@ -20,9 +20,9 @@ function ViewManageJob() {
|
||||
|
||||
<DialogRoot placement="center">
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent
|
||||
|
||||
@@ -8,9 +8,9 @@ function ViewDailog() {
|
||||
|
||||
<DialogRoot placement="center">
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} color="#000" />
|
||||
</Button>
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, HStack, Image, Input, Text } from "@chakra-ui/react";
|
||||
import { Box, HStack, Input, Text } from "@chakra-ui/react";
|
||||
import MainFrame from "../../../components/MainFrame"
|
||||
import { InputGroup } from "../../../components/ui/input-group";
|
||||
import { LuSearch } from "react-icons/lu";
|
||||
@@ -62,8 +62,8 @@ const AgencyMaster = () => {
|
||||
Agency Master
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ function EditAgencyMaster() {
|
||||
|
||||
<DialogRoot placement="center">
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DialogBody, DialogCloseTrigger, DialogContent, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger } from "../../../components/ui/dialog"
|
||||
import { Field, Input, Stack, Text, Textarea } from "@chakra-ui/react"
|
||||
import { Field, Input, Stack, Text } from "@chakra-ui/react"
|
||||
import { IoMdAdd } from "react-icons/io"
|
||||
import { Button } from "../../../components/ui/button"
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ function ViewAgencyMaster() {
|
||||
|
||||
<DialogRoot placement="center">
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, HStack, Image, Input, Text } from "@chakra-ui/react";
|
||||
import { Box, HStack, Input, Text } from "@chakra-ui/react";
|
||||
import MainFrame from "../../../components/MainFrame"
|
||||
import { InputGroup } from "../../../components/ui/input-group";
|
||||
import { LuSearch } from "react-icons/lu";
|
||||
@@ -49,8 +49,8 @@ const Country = () => {
|
||||
Country
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ function EditCountryModel() {
|
||||
{/* <Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
|
||||
</Button> */}
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ function EditJobStatusModel() {
|
||||
{/* <Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
|
||||
</Button> */}
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ const JobStatus = () => {
|
||||
Job Status
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ function EditJobeModel() {
|
||||
{/* <Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
|
||||
</Button> */}
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ const JobType = () => {
|
||||
Job Type
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ function EditTemplateModel() {
|
||||
{/* <Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
|
||||
</Button> */}
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ const TemplateMaster = () => {
|
||||
Template Master
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ function EditWorkModel() {
|
||||
{/* <Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize: "16px" }} />
|
||||
</Button> */}
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "14px" }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<FaRegEdit style={{ cursor: "pointer", fontSize: "16px" }} color="#000"/>
|
||||
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ const WorkspaceMode = () => {
|
||||
Workspace Mode
|
||||
</Text>
|
||||
|
||||
<HStack mr={5}>
|
||||
<InputGroup marginRight={"1rem"}
|
||||
<HStack >
|
||||
<InputGroup
|
||||
startElement={
|
||||
<LuSearch fontSize={"xs"} style={{ position: 'relative', left: '10px' }} />
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ function ViewSubAdmin() {
|
||||
|
||||
<DialogRoot placement="center" >
|
||||
<DialogTrigger asChild>
|
||||
<Button bg={"transparent"} size="sm">
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", }} color="#000"/>
|
||||
</Button>
|
||||
|
||||
<MdOutlineRemoveRedEye style={{ cursor: "pointer", fontSize:'16px'}} color="#000"/>
|
||||
|
||||
{/* <Button><FaRegEdit /></Button> */}
|
||||
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { logout } from "./authSlice"; // Import logout action from authSlice
|
||||
import { RootState } from "../Store";
|
||||
|
||||
const baseQuery = fetchBaseQuery({
|
||||
baseUrl: "https://api.example.com",
|
||||
baseUrl: `${import.meta.env.VITE_API_URL}`,
|
||||
prepareHeaders: (headers, { getState }) => {
|
||||
const token = (getState() as RootState).auth.token; // Get token from Redux store
|
||||
if (token) {
|
||||
@@ -42,7 +42,7 @@ export const apiSlice = createApi({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ const AlertDailog: React.FC<DeleteConfirmationDialogProps> = ({
|
||||
onConfirm,
|
||||
alertText,
|
||||
alertCaption,
|
||||
alertIcon,
|
||||
AltertTiggerIcon,
|
||||
button,
|
||||
iconColor,
|
||||
|
||||
Reference in New Issue
Block a user