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) {
setHeaderOptions(headerOptions);
} else {
setHeaderOptions({ shown: true, back: true, title: "آدرس جدید" });
setHeaderOptions({
shown: true,
back: true,
title: "آدرس",
});
}
}
if (editPage) {
@ -293,7 +297,7 @@ export const Address = ({
<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 ${
location?.state?.panel ? "mt-2" : "pt-0"
}`}
} `}
// style={{ minHeight: "calc(100vh - 500px)" }}
>
{!profilePage && (
@ -365,24 +369,24 @@ export const Address = ({
className={`flex flex-row items-center mb-7 cursor-pointer
`}
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-2 h-2 rounded-full ${
activeCheckbox === false ? "bg-blueC0" : ""
activeCheckbox === true ? "bg-blueC0" : ""
}`}
></div>
</div>
<p className="font-bold text-sm ">برای خودم</p>
<p className="font-bold text-sm">برای خودم</p>
</div>
{/* someone else */}
<div
className={`flex flex-row items-center mb-7 cursor-pointer
`}
onClick={() => {
setActiveCheckbox(true);
setActiveCheckbox(false);
}}
// onClick={() => {
// 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-2 h-2 rounded-full ${
activeCheckbox === !false ? "bg-blueC0" : ""
activeCheckbox === false ? "bg-blueC0" : ""
}`}
></div>{" "}
></div>
</div>
<p className="font-bold text-sm ">گیرنده فرد دیگری است</p>
</div>

@ -32,6 +32,20 @@ const ProfileAddress = ({
return (
<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`}>
{addresses.map((address, index) => (
<Location
@ -44,36 +58,13 @@ const ProfileAddress = ({
/>
))}
</div>
{/* <FloatingButton
action={() => navigation("/createAddress", { state: { panel: true } })}
// action={() => {}}
position={{ right: isMobile ? "" : 350, bottom: 50 }}
/> */}
</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 }) => {
return (
<>
{/* */}
<div
className={`flex items-center w-full px-3 py-4 rounded-md my-4 border-2 border-solid ${
active
@ -84,7 +75,7 @@ const Location = ({ address, active, userId, isDark, update }) => {
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 && (
<div className="w-full flex justify-between mb-3">
<div className="flex items-center">

@ -1,5 +1,6 @@
import React from "react";
import { connect } from "react-redux";
import {
userAddress,
userFactor,
@ -7,6 +8,7 @@ import {
menu,
dialog,
} from "../../../../../redux/actions";
import { Link, useNavigate } from "react-router-dom";
//components
@ -73,7 +75,6 @@ const ProfileAddress = ({
/> */}
<FloatingButton
action={() => navigation("/createAddress", { state: { panel: true } })}
// action={() => {}}
position={{ bottom: 100, left: 16 }}
/>
</div>
@ -176,7 +177,7 @@ const Location = ({
</div>
)}
<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"}>
{"آدرس:" + " " + address.address}
</span>

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

Loading…
Cancel
Save