From 2370d5957737959ba7b26978b47d71a623151c11 Mon Sep 17 00:00:00 2001 From: xu75 <90778107+xu75@users.noreply.github.com> Date: Mon, 29 May 2023 00:44:00 +0800 Subject: [PATCH 001/113] update and fix (#5) * update list 1.2.1& 2.2 add list 2.2.1 * update figma 1.2 & 2.2 * comment out components/Home/ FacebookPosts/Cardlist due to an error in Cardlist list.map is not a function --- .prettierrc | 6 - .prettierrc.json | 6 + components/Home/FacebookPosts/index.jsx | 4 +- components/Profile/Accountsetting/index.jsx | 108 ++++++++++ .../Profile/Contact/ContactDone/index.jsx | 81 ++++++++ .../Profile/Contact/ContactError/index.jsx | 66 ++++++ components/Profile/Contact/index.jsx | 176 ++++++++++++++++ .../Profile/Edit}/index.jsx | 20 +- components/Profile/UserCard/index.jsx | 60 +++++- components/Profile/index.jsx | 33 ++- package.json | 2 + pages/login/index.jsx | 3 +- pages/profile/index.jsx | 99 ++++++++- pages/profile/myprofile/index.jsx | 22 ++ pages/signin/index.jsx | 4 +- pages/signin/interest/index.jsx | 6 +- public/assets/contactdone.png | Bin 0 -> 42580 bytes public/assets/contacterror.png | Bin 0 -> 95057 bytes redux/reducers/index.js | 12 +- redux/reducers/resource.js | 6 +- redux/reducers/search.js | 190 +++++++++--------- redux/reducers/theme.js | 10 +- .../MainNav/SubList/UserAvatar/index.jsx | 6 +- yarn.lock | 5 + 24 files changed, 778 insertions(+), 147 deletions(-) delete mode 100644 .prettierrc create mode 100644 .prettierrc.json create mode 100644 components/Profile/Accountsetting/index.jsx create mode 100644 components/Profile/Contact/ContactDone/index.jsx create mode 100644 components/Profile/Contact/ContactError/index.jsx create mode 100644 components/Profile/Contact/index.jsx rename {pages/profile/edit => components/Profile/Edit}/index.jsx (98%) create mode 100644 pages/profile/myprofile/index.jsx create mode 100644 public/assets/contactdone.png create mode 100644 public/assets/contacterror.png diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0238bf0f..00000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trailingComma": "all", - "singleQuote": true, - "printWidth": 80, - "tabWidth": 2 -} diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..ab823d15 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "printWidth": 80, + "tabWidth": 2 +} diff --git a/components/Home/FacebookPosts/index.jsx b/components/Home/FacebookPosts/index.jsx index e0b355f3..2ba90240 100644 --- a/components/Home/FacebookPosts/index.jsx +++ b/components/Home/FacebookPosts/index.jsx @@ -81,12 +81,12 @@ const Guide = () => { isLoading={isLoadingInstagramPosts} direction="right" /> - + /> */} ); }; diff --git a/components/Profile/Accountsetting/index.jsx b/components/Profile/Accountsetting/index.jsx new file mode 100644 index 00000000..cdddf5f1 --- /dev/null +++ b/components/Profile/Accountsetting/index.jsx @@ -0,0 +1,108 @@ +import React from 'react'; +import { + Box, + Typography, + Checkbox, + Button, + Divider, + FormControlLabel, +} from '@mui/material'; +import { useRouter } from 'next/router'; +import useFirebase from '../../../hooks/useFirebase'; + +const TypographyStyle = { + fontFamily: 'Noto Sans TC', + fontStyle: 'normal', + fontWeight: '500', + fontSize: '16px', + lineHeight: '140%', + color: '#293A3D', +}; + +const AccountSetting = () => { + const { push } = useRouter(); + const { auth, user, signInWithFacebook, signOutWithGoogle } = useFirebase(); + return ( + + + 帳號設定 + + + + 電子信箱 + + + + 電話驗證 + + + + 電子報 + } + label="訂閱電子報與島島阿學的新資訊" + /> + + + + 登出帳號 + + + + + ); +}; + +export default AccountSetting; diff --git a/components/Profile/Contact/ContactDone/index.jsx b/components/Profile/Contact/ContactDone/index.jsx new file mode 100644 index 00000000..921df664 --- /dev/null +++ b/components/Profile/Contact/ContactDone/index.jsx @@ -0,0 +1,81 @@ +import { Modal, Box, Typography, Button } from '@mui/material'; + +function ContactDoneModal() { + return ( + + + + nobody-land + + + 已送出邀請 + + + 請耐心等候夥伴的回應 + + + + + ); +} + +export default ContactDoneModal; diff --git a/components/Profile/Contact/ContactError/index.jsx b/components/Profile/Contact/ContactError/index.jsx new file mode 100644 index 00000000..2f344132 --- /dev/null +++ b/components/Profile/Contact/ContactError/index.jsx @@ -0,0 +1,66 @@ +import { Modal, Box, Typography, Button } from '@mui/material'; + +function ContactErrorModal() { + return ( + + + + nobody-land + + + 哎呀!有不明錯誤 + + + + + ); +} + +export default ContactErrorModal; diff --git a/components/Profile/Contact/index.jsx b/components/Profile/Contact/index.jsx new file mode 100644 index 00000000..a8c38f5c --- /dev/null +++ b/components/Profile/Contact/index.jsx @@ -0,0 +1,176 @@ +import React, { useState } from 'react'; +import { + Modal, + Box, + Typography, + Button, + TextareaAutosize, + Avatar, +} from '@mui/material'; + +function ContactModal({ onClose, onOk, isLoadingSubmit, open }) { + return ( + + + + 聯繫夥伴 + + + + + + + 黃芊宇 + + + 實驗教育學生 + + + + + 邀請訊息 + + + + + 聯繫資訊 + + + + + + + + + + + ); +} + +export default ContactModal; diff --git a/pages/profile/edit/index.jsx b/components/Profile/Edit/index.jsx similarity index 98% rename from pages/profile/edit/index.jsx rename to components/Profile/Edit/index.jsx index 28825561..5934cda4 100644 --- a/pages/profile/edit/index.jsx +++ b/components/Profile/Edit/index.jsx @@ -47,7 +47,6 @@ import COUNTIES from '../../../constants/countries.json'; const HomePageWrapper = styled.div` --section-height: calc(100vh - 80px); --section-height-offset: 80px; - background: linear-gradient(0deg, #f3fcfc, #f3fcfc), #f7f8fa; `; const ContentWrapper = styled.div` @@ -55,14 +54,13 @@ const ContentWrapper = styled.div` flex-direction: column; justify-content: center; align-items: center; - background: linear-gradient(0deg, #f3fcfc, #f3fcfc), #f7f8fa; - border-radius: 8px; - margin: 60px auto; + background: white; + border-radius: 16px; + margin: 0 auto; padding: 40px 10px; - max-width: 50%; - width: 100%; + width: 672px; @media (max-width: 767px) { - max-width: 80%; + width: 80%; .title { text-overflow: ellipsis; width: 100%; @@ -93,7 +91,7 @@ function EditPage() { if (!isLoading) { const db = getFirestore(); if (user?.uid) { - const docRef = doc(db, 'user', user?.uid); + const docRef = doc(db, 'partnerlist', user?.uid); getDoc(docRef).then((docSnap) => { const data = docSnap.data(); console.log('data', data); @@ -135,7 +133,7 @@ function EditPage() { const db = getFirestore(); - const docRef = doc(db, 'user', user?.uid); + const docRef = doc(db, 'partnerlist', user?.uid); const partnerlistDocRef = doc(db, 'partnerlist', user?.uid); getDoc(docRef).then((docSnap) => { setIsLoadingSubmit(true); @@ -193,7 +191,6 @@ function EditPage() { return ( - { - router.push('/profile'); + router.push('/profile/myprofile'); }} > 查看我的頁面 @@ -852,7 +849,6 @@ function EditPage() { -