bug: fix conflict

This commit is contained in:
Quangnhankie
2021-10-15 17:00:43 +07:00
42 changed files with 933 additions and 142 deletions

View File

@@ -13,7 +13,6 @@ import { PRODUCT_CART_DATA_TEST } from 'src/utils/demo-data';
import { ACCOUNT_TAB, QUERY_KEY } from "src/utils/constanst.utils"
import { useRouter } from "next/router"
import { useActiveCustomer } from 'src/components/hooks/auth'
const waiting = [
{
id: "NO 123456",
@@ -53,16 +52,6 @@ const delivered = [
}
]
let account = {
name: "vu duong",
email: "vuduong@gmail.com",
address: "234 Dien Bien Phu Bis, Dakao ward",
state: "District 1",
city: "HCMC",
postalCode: "700000",
phoneNumber: "(+84) 937 937 195"
}
interface AccountPageProps {
defaultActiveContent?: "info" | "orders" | "favorites"
}
@@ -81,6 +70,10 @@ const getTabIndex = (tab?: string): number => {
const AccountPage = ({ defaultActiveContent="orders" } : AccountPageProps) => {
const router = useRouter()
const {userInfo} = useActiveCustomer();
const [activeTab, setActiveTab] = useState(defaultActiveContent==="info" ? 0 : defaultActiveContent==="orders" ? 1 : 2)
const [modalVisible, setModalVisible] = useState(false);
// const { itemWishlist } = useActiveCustomer();
@@ -109,7 +102,7 @@ const AccountPage = ({ defaultActiveContent="orders" } : AccountPageProps) => {
<AccountNavigation defaultActiveIndex={activeTab}>
<TabPane tabName="Customer Information">
<AccountInfomation account={account} onClick={showModal} />
<AccountInfomation account={userInfo} onClick={showModal} />
</TabPane>
<TabPane tabName="Your Orders">
<OrderInfomation waiting={waiting} delivering={delivering} delivered={delivered} />
@@ -119,7 +112,7 @@ const AccountPage = ({ defaultActiveContent="orders" } : AccountPageProps) => {
</TabPane>
</AccountNavigation>
</section>
<EditInfoModal accountInfo={account} closeModal={closeModal} visible={modalVisible} />
<EditInfoModal accountInfo={userInfo} closeModal={closeModal} visible={modalVisible} />
</>
)
}