Skip to content

Commit

Permalink
Merge branch 'dev' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentxuu committed Jul 21, 2024
2 parents 896b983 + b332bf1 commit b908ef9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 37 deletions.
10 changes: 7 additions & 3 deletions components/Profile/Accountsetting/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const StyledLogoutBtn = styled(Button)`
background: #fff;
color: #1f4645;
padding: 5px 0;
width: 100%;
/* shadow-light-gray */
box-shadow: 0px 4px 10px 0px rgba(196, 194, 193, 0.4);
`;
Expand Down Expand Up @@ -59,9 +60,10 @@ const AccountSetting = () => {
<Box
sx={{
backgroundColor: '#ffffff',
width: '672px',
width: '100%',
maxWidth: '672px',
borderRadius: '16px',
padding: '36px 40px',
padding: { xs: '16px 20px', md: '36px 40px' },
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
Expand All @@ -76,7 +78,8 @@ const AccountSetting = () => {
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
width: '544px',
width: '100%',
maxWidth: '544px',
}}
>
<Box sx={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
Expand All @@ -90,6 +93,7 @@ const AccountSetting = () => {
background: '#F3F3F3',
padding: '12px 16px',
color: '#92989A',
wordBreak: 'break-all',
}}
>
{user.email}
Expand Down
41 changes: 7 additions & 34 deletions shared/components/Navigation_v2/MainNav/Hamberger/MenuList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import styled from '@emotion/styled';
import { Box } from '@mui/material';
import { useRouter } from 'next/router';
import MenuItem from './MenuItem';
import UserAvatar from './UserAvatar';
import useFirebase from '../../../../../hooks/useFirebase';
import UserAvatar from '../SubList/UserAvatar';
import { useSelector } from 'react-redux';

const MenuWrapper = styled.div`
position: fixed;
Expand All @@ -31,42 +31,15 @@ const MenuListWrapper = styled.div`

const Menu = ({ open, list, onCloseMenu }) => {
const router = useRouter();
const {
auth,
user,
signInWithFacebook,
signOutWithFacebook,
signOutWithGoogle,
} = useFirebase();


const user = useSelector((state) => state.user);
console.log("MenuList", user);
return (
<MenuWrapper open={open}>
{open && (
<MenuListWrapper>
{user && <UserAvatar onCloseMenu={onCloseMenu} />}
{user ? (
<MenuItem
key="登出"
delay="0.1s"
onClick={() => {
// signOutWithFacebook();
onCloseMenu();
signOutWithGoogle();
router.push('/');
}}
text="登出"
/>
) : (
<MenuItem
key="登入"
delay="0.1s"
onClick={() => {
router.push('/login');
// signInWithFacebook();
}}
text="登入"
/>
)}

<UserAvatar user={user} />
{list.map((value, index) => {
return (
<MenuItem
Expand Down

0 comments on commit b908ef9

Please sign in to comment.