worked | 150

temp
mahdi 2 years ago
parent c5d7e2030a
commit a7b1da36fd
  1. 16
      src/views/Address/index.js
  2. 37
      src/views/Dashboard/layouts/Main/Addresses/index.js
  3. 3
      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) {
@ -365,13 +369,13 @@ 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>
@ -382,7 +386,7 @@ 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(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

@ -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>

@ -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