worked | 150

temp
mahdi 2 years ago
parent c5d7e2030a
commit a7b1da36fd
  1. 20
      src/views/Address/index.js
  2. 39
      src/views/Dashboard/layouts/Main/Addresses/index.js
  3. 5
      src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js
  4. 3
      src/views/DeliveryForm/Address/index.js

@ -58,7 +58,11 @@ export const Address = ({
if (editPage || profilePage) { if (editPage || profilePage) {
setHeaderOptions(headerOptions); setHeaderOptions(headerOptions);
} else { } else {
setHeaderOptions({ shown: true, back: true, title: "آدرس جدید" }); setHeaderOptions({
shown: true,
back: true,
title: "آدرس",
});
} }
} }
if (editPage) { if (editPage) {
@ -293,7 +297,7 @@ export const Address = ({
<div <div
className={`flex flex-col lg:flex-row-reverse px-4 flex-1 lg:pt-0 pb-20 gap-5 lg:divide-x lg:divide-solid lg:divide-gray-200 ${ className={`flex flex-col lg:flex-row-reverse px-4 flex-1 lg:pt-0 pb-20 gap-5 lg:divide-x lg:divide-solid lg:divide-gray-200 ${
location?.state?.panel ? "mt-2" : "pt-0" location?.state?.panel ? "mt-2" : "pt-0"
}`} } `}
// style={{ minHeight: "calc(100vh - 500px)" }} // style={{ minHeight: "calc(100vh - 500px)" }}
> >
{!profilePage && ( {!profilePage && (
@ -365,24 +369,24 @@ export const Address = ({
className={`flex flex-row items-center mb-7 cursor-pointer className={`flex flex-row items-center mb-7 cursor-pointer
`} `}
onClick={() => { onClick={() => {
setActiveCheckbox(false); setActiveCheckbox(true);
}} }}
> >
<div className="w-4 h-4 flex flex-col items-center justify-center ml-1 bg-gray-200 rounded-full"> <div className="w-4 h-4 flex flex-col items-center justify-center ml-1 bg-gray-200 rounded-full">
<div <div
className={`w-2 h-2 rounded-full ${ className={`w-2 h-2 rounded-full ${
activeCheckbox === false ? "bg-blueC0" : "" activeCheckbox === true ? "bg-blueC0" : ""
}`} }`}
></div> ></div>
</div> </div>
<p className="font-bold text-sm ">برای خودم</p> <p className="font-bold text-sm">برای خودم</p>
</div> </div>
{/* someone else */} {/* someone else */}
<div <div
className={`flex flex-row items-center mb-7 cursor-pointer className={`flex flex-row items-center mb-7 cursor-pointer
`} `}
onClick={() => { onClick={() => {
setActiveCheckbox(true); setActiveCheckbox(false);
}} }}
// onClick={() => { // onClick={() => {
// setActiveCheckbox(!activeCheckbox); // setActiveCheckbox(!activeCheckbox);
@ -391,9 +395,9 @@ export const Address = ({
<div className="w-4 h-4 flex flex-col items-center justify-center ml-1 bg-gray-200 rounded-full"> <div className="w-4 h-4 flex flex-col items-center justify-center ml-1 bg-gray-200 rounded-full">
<div <div
className={`w-2 h-2 rounded-full ${ className={`w-2 h-2 rounded-full ${
activeCheckbox === !false ? "bg-blueC0" : "" activeCheckbox === false ? "bg-blueC0" : ""
}`} }`}
></div>{" "} ></div>
</div> </div>
<p className="font-bold text-sm ">گیرنده فرد دیگری است</p> <p className="font-bold text-sm ">گیرنده فرد دیگری است</p>
</div> </div>

@ -32,6 +32,20 @@ const ProfileAddress = ({
return ( return (
<div className={`flex-1 ${isMobile ? "" : "w-1/2"} mx-auto`}> <div className={`flex-1 ${isMobile ? "" : "w-1/2"} mx-auto`}>
<div className="w-full flex flex-row justify-between items-center mt-4">
<button
className={`flex justify-center text-tiny lg:text-sm rounded-md py-3 bg-grayF9 dark:bg-blueC0 dark:bg-opacity-30 cursor:pointer ${
isDark ? "text-white" : "text-gray70"
} items-center w-full`}
onClick={() => navigation("/createAddress")}
style={{
border: `1px solid ${isDark ? "#DBDBDB22" : "#DBDBDB"}`,
}}
>
&nbsp;یک آدرس جدید اضافه کنید
<strong className="text-lg transform translate-y-0.5 mr-1">+</strong>
</button>
</div>
<div className={`p-0 m-0 flex flex-col mb-4`}> <div className={`p-0 m-0 flex flex-col mb-4`}>
{addresses.map((address, index) => ( {addresses.map((address, index) => (
<Location <Location
@ -44,36 +58,13 @@ const ProfileAddress = ({
/> />
))} ))}
</div> </div>
{/* <FloatingButton
action={() => navigation("/createAddress", { state: { panel: true } })}
// action={() => {}}
position={{ right: isMobile ? "" : 350, bottom: 50 }}
/> */}
</div> </div>
); );
}; };
{
/* <div className="w-full flex flex-row justify-between items-center mt-4">
<button
className={`flex justify-center text-tiny lg:text-sm rounded-md py-3 bg-grayF9 dark:bg-blueC0 dark:bg-opacity-30 cursor:pointer ${
isDark ? "text-white" : "text-gray70"
} items-center w-full`}
action={() => navigation("/createAddress")}
style={{
border: `1px solid ${isDark ? "#DBDBDB22" : "#DBDBDB"}`,
}}
>
&nbsp;یک آدرس جدید اضافه کنید
<strong className="text-lg transform translate-y-0.5 mr-1">+</strong>
</button>
</div> */
}
const Location = ({ address, active, userId, isDark, update }) => { const Location = ({ address, active, userId, isDark, update }) => {
return ( return (
<> <>
{/* */}
<div <div
className={`flex items-center w-full px-3 py-4 rounded-md my-4 border-2 border-solid ${ className={`flex items-center w-full px-3 py-4 rounded-md my-4 border-2 border-solid ${
active active
@ -84,7 +75,7 @@ const Location = ({ address, active, userId, isDark, update }) => {
active ? {} : update({ userAddressId: address.id, userId }) active ? {} : update({ userAddressId: address.id, userId })
} }
> >
<div className="flex flex-1 flex-col mr-2"> <div className="flex flex-1 flex-col mr-2">
{active && ( {active && (
<div className="w-full flex justify-between mb-3"> <div className="w-full flex justify-between mb-3">
<div className="flex items-center"> <div className="flex items-center">

@ -1,5 +1,6 @@
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { import {
userAddress, userAddress,
userFactor, userFactor,
@ -7,6 +8,7 @@ import {
menu, menu,
dialog, dialog,
} from "../../../../../redux/actions"; } from "../../../../../redux/actions";
import { Link, useNavigate } from "react-router-dom"; import { Link, useNavigate } from "react-router-dom";
//components //components
@ -73,7 +75,6 @@ const ProfileAddress = ({
/> */} /> */}
<FloatingButton <FloatingButton
action={() => navigation("/createAddress", { state: { panel: true } })} action={() => navigation("/createAddress", { state: { panel: true } })}
// action={() => {}}
position={{ bottom: 100, left: 16 }} position={{ bottom: 100, left: 16 }}
/> />
</div> </div>
@ -176,7 +177,7 @@ const Location = ({
</div> </div>
)} )}
<div className={`flex w-full ${active ? "" : "flex-row"}`}> <div className={`flex w-full ${active ? "" : "flex-row"}`}>
<div className={"flex flex-col flex-1 mb-4"}> <div className={"flex flex-col flex-1 mb-4"}>
<span className={"text-sm leading-6"}> <span className={"text-sm leading-6"}>
{"آدرس:" + " " + address.address} {"آدرس:" + " " + address.address}
</span> </span>

@ -11,13 +11,13 @@ import trash from "../../../assets/icons/trash.svg";
function Address({ function Address({
addresses, addresses,
isDark,
isMobile, isMobile,
setPhase, setPhase,
update, update,
userId, userId,
userAddressId, userAddressId,
loading, loading,
isDark,
}) { }) {
const Location = ({ address, active }) => { const Location = ({ address, active }) => {
return isMobile ? ( return isMobile ? (
@ -125,6 +125,7 @@ function Address({
</button> </button>
); );
}; };
return isMobile ? ( return isMobile ? (
<section className="mt-2 w-full"> <section className="mt-2 w-full">
<strong className="font-bold text-green7B dark:text-white lg:text-tiny"> <strong className="font-bold text-green7B dark:text-white lg:text-tiny">

Loading…
Cancel
Save