diff --git a/src/components/modules/account/AccountPage/AccountPage.module.scss b/src/components/modules/account/AccountPage/AccountPage.module.scss new file mode 100644 index 000000000..a3e3f1525 --- /dev/null +++ b/src/components/modules/account/AccountPage/AccountPage.module.scss @@ -0,0 +1,22 @@ +@import '../../../../styles/utilities'; + +.accountPage { + @apply flex spacing-horizontal; + background-color: #F5F4F2; + margin-top: -3.2rem; + padding-bottom: 3.2rem; + + .pageLeft { + padding-top: 5.6rem; + margin-right: 12.4rem; + + .accNavi{ + margin-top: 3.8rem; + } + } + + .pageRight { + padding-top: 5.6rem; + width: 100%; + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/AccountPage.tsx b/src/components/modules/account/AccountPage/AccountPage.tsx new file mode 100644 index 000000000..5f3749a28 --- /dev/null +++ b/src/components/modules/account/AccountPage/AccountPage.tsx @@ -0,0 +1,134 @@ +import React, { useEffect, useState } from "react" +import s from './AccountPage.module.scss' + +import AccountNavigation from '../AccountNavigation/AccountNavigation' +import HeadingCommon from '../../../common/HeadingCommon/HeadingCommon' +import AccountInfomation from "./components/AccountInfomation/AccountInfomation" +import OrderInfomation from './components/OrderInformation/OrderInformation' +import EditInfoModal from './components/EditInfoModal/EditInfoModal' + +interface AccountPageProps { + +} + +const AccountPage = ({} : AccountPageProps) => { + const waiting = [ + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + }, + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + }, + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + } + ] + + const delivering = [ + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + }, + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + }, + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + } + ] + + const delivered = [ + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + }, + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + }, + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + } + ] + + const account = { + name: "vu duong", + email: "vuduong@gmail.com", + address: "234 Dien Bien Phu Bis, Dakao ward, District 1, HCMC", + postalCode: "700000", + phoneNumber: "(+84) 937 937 195" + } + + const [accountInfoActive, setAccountInfoActive] = useState(false); + const [orderInfoActive, setOrderInfoActive] = useState(true); + const [favoritesActive, setFavoritesActive] = useState(false); + + function accountActive() { + setAccountInfoActive(true); + setOrderInfoActive(false); + setFavoritesActive(false); + } + + function orderActive() { + setAccountInfoActive(false); + setOrderInfoActive(true); + setFavoritesActive(false); + } + + function favActive() { + setAccountInfoActive(false); + setOrderInfoActive(false); + setFavoritesActive(true); + } + + const [modalVisible, setModalVisible] = useState(false); + + function showEditForm() { + setModalVisible(true); + } + + function closeModal() { + setModalVisible(false); + } + + return ( + <> + + + Account + + + + + + + + + + {/* Thieu cai favorite */} + {/* */} + + + + + + > + ) +} + +export default AccountPage \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/assets/avatar.png b/src/components/modules/account/AccountPage/assets/avatar.png new file mode 100644 index 000000000..b12cabed4 Binary files /dev/null and b/src/components/modules/account/AccountPage/assets/avatar.png differ diff --git a/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.module.scss b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.module.scss new file mode 100644 index 000000000..6e5e0c325 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.module.scss @@ -0,0 +1,49 @@ +@import '../../../../../../styles/utilities'; + +.accountInfomation { + transition: opacity 6s; + + .avatar { + height: 22rem; + width: 22rem; + border-radius: 50%; + margin-bottom: 4rem; + } + + .accountName { + @apply heading-3 font-heading; + } + + .horizontalSeparator{ + border: 1px solid var(--disabled); + max-width: 39.2rem; + min-width: 30rem; + margin-top: 2.4rem; + margin-bottom: 2.4rem; + } + + .shippingInfo { + @apply heading-3 font-heading; + } + + .accountAddress { + max-width: 31rem; + min-width: none; + } + + .editInfoBtn { + @apply text-center font-bold; + margin-top: 2.4rem; + margin-bottom: 2.4rem; + padding: .8rem 1.6rem; + color: #141414; + border: 1px solid #141414; + max-width: 8.8rem; + border-radius: 25%; + + &:hover { + @apply cursor-pointer; + background-color: #FBFBFB; + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.tsx b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.tsx new file mode 100644 index 000000000..b2961c8df --- /dev/null +++ b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.tsx @@ -0,0 +1,50 @@ +import React, { useState } from "react" +import s from './AccountInfomation.module.scss' + +import Image from "next/image" +import avatar from '../../assets/avatar.png'; + +interface AccountInfomationProps { + account: {name: string, email: string, address: string, postalCode: string, phoneNumber: string}; + active: boolean; + clickShowEditForm: ()=>void; +} + +const AccountInfomation = ({ account, active=false, clickShowEditForm } : AccountInfomationProps) => { + return ( + + { + active && + + + + + + {account.name} + + + {account.email} + + + + + Shipping Infomation + + + {account.address + `, ${account.postalCode}`} + + + + {account.phoneNumber} + + + Edit + + } + + + + ) +} + +export default AccountInfomation \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.module.scss b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.module.scss new file mode 100644 index 000000000..e9431f32a --- /dev/null +++ b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.module.scss @@ -0,0 +1,67 @@ +@import '../../../../../../styles/utilities'; + +.editInfoModal { + .input { + @apply bg-white; + margin-bottom: 1.6rem; + width: 100%; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .inputState { + @apply bg-white; + margin-bottom: 1.6rem; + margin-right: 1.6rem; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .inputPostalCode { + @apply bg-white; + margin-bottom: 1.6rem; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .inputPhoneNumber { + @apply bg-white; + margin-bottom: 4rem; + width: 100%; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .buttons { + @apply flex; + + .buttonCancel { + @apply bg-white text-center font-bold; + color: #141414; + border: 1px solid #141414; + border-radius: 2.5rem; + padding: 1.6rem; + margin-right: 1.6rem; + + &:hover { + @apply cursor-pointer; + } + } + + .buttonSave { + @apply text-center font-bold; + background-color: var(--primary); + color: white; + border-radius: 2.5rem; + padding: 1.6rem; + + &:hover { + @apply cursor-pointer; + } + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.tsx b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.tsx new file mode 100644 index 000000000..2d593c97e --- /dev/null +++ b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.tsx @@ -0,0 +1,52 @@ +import classNames from "classnames" +import React from "react" +import s from './EditInfoModal.module.scss' + +import {ModalCommon, MenuDropdown} from '../../../../../common' + +interface EditInfoModalProps { + visible: boolean; + closeModal: () => void; +} + +const EditInfoModal = ({ visible = false, closeModal }: EditInfoModalProps) => { + + function saveInfo() { + console.log("saved !!!"); + + closeModal(); + } + + const options = [ + {name: "hihi"}, + {name: "hihi"}, + {name: "hihi"} + ] + + return ( + + + + + + + + + {/* */} + + {/* */} + + + + + + + Cancel + Save + + + + ) +} + +export default EditInfoModal \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.module.scss b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.module.scss new file mode 100644 index 000000000..90b0450bf --- /dev/null +++ b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.module.scss @@ -0,0 +1,16 @@ +@import '../../../../../../styles/utilities'; + +.orderInformation { + .title { + @apply heading-3 font-heading; + margin-top: 1.6rem; + } + + .tabs { + margin-top: 3.2rem; + } + + .tabPanes { + margin-top: 2.4rem; + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.tsx b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.tsx new file mode 100644 index 000000000..3dce97570 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.tsx @@ -0,0 +1,68 @@ +import React, {useState} from "react" +import s from './OrderInformation.module.scss' + +import { TabCommon } from '../../../../../common' +import TabPane from '../../components/TabPane/TabPane' +import DeliveryItem from '../../../DeliveryItem/DeliveryItem' + + +interface OrderInformationProps { + waiting: {id: string, products: string[], totalPrice: number}[], + delivering: {id: string, products: string[], totalPrice: number}[], + delivered: {id: string, products: string[], totalPrice: number}[], + active: boolean +} + +const OrderInformation = ({ waiting, delivering, delivered, active=true } : OrderInformationProps) => { + const [activeTabPane, setActiveTabPane] = useState("waiting"); + + function changeTabPane(tab: string) { + setActiveTabPane(tab); + } + + return ( + + { + active && + Order Information + + + + + + + { + waiting.map((order, i) => { + return ( + + ) + }) + } + + + { + delivering.map((order, i) => { + return ( + + ) + }) + } + + + { + delivered.map((order, i) => { + return ( + + ) + }) + } + + + + + } + + ) +} + +export default OrderInformation \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/TabPane/TabPane.module.scss b/src/components/modules/account/AccountPage/components/TabPane/TabPane.module.scss new file mode 100644 index 000000000..6904a6acb --- /dev/null +++ b/src/components/modules/account/AccountPage/components/TabPane/TabPane.module.scss @@ -0,0 +1,23 @@ +@import '../../../../../../styles/utilities'; + +.tabPane { + @apply hidden; + animation-duration: 0.6s; + animation-name: appear; + @keyframes appear { + from { + margin-left: 100%; + width: 200%; + } + + to { + margin-left: 0%; + width: 100%; + } + } + + + &.active { + @apply block; + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/TabPane/TabPane.tsx b/src/components/modules/account/AccountPage/components/TabPane/TabPane.tsx new file mode 100644 index 000000000..3b39291b7 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/TabPane/TabPane.tsx @@ -0,0 +1,20 @@ +import classNames from "classnames" +import React from "react" +import s from './TabPane.module.scss' + +interface TabPaneProps { + active: string; + children?: React.ReactNode; +} + +const TabPane = ({ active="", children } : TabPaneProps) => { + return ( + + {children} + + ) +} + +export default TabPane \ No newline at end of file