-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from daodaoedu/feature/2.2_partner_profile
feat(partner): 串接 user/:id 及 調整頁面路徑
- Loading branch information
Showing
9 changed files
with
126 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useEffect } from 'react'; | ||
import { useRouter } from 'next/router'; | ||
import { useSelector, useDispatch } from 'react-redux'; | ||
|
||
import styled from '@emotion/styled'; | ||
import Navigation from '@/shared/components/Navigation_v2'; | ||
import Footer from '@/shared/components/Footer_v2'; | ||
import Profile from '@/components/Profile'; | ||
|
||
import { fetchPartnerById } from '@/redux/actions/partners'; | ||
|
||
const HomePageWrapper = styled.div` | ||
--section-height: calc(100vh - 80px); | ||
--section-height-offset: 80px; | ||
`; | ||
|
||
const Detail = () => { | ||
const dispatch = useDispatch(); | ||
const { partner } = useSelector((state) => state?.partners); | ||
|
||
const router = useRouter(); | ||
const { id } = router.query; | ||
|
||
const fetchUser = async () => { | ||
dispatch(fetchPartnerById({ id })); | ||
}; | ||
useEffect(() => { | ||
if (id) { | ||
fetchUser(); | ||
} | ||
}, [id]); | ||
|
||
return ( | ||
<HomePageWrapper> | ||
<Navigation /> | ||
<Profile {...partner} /> | ||
<Footer /> | ||
</HomePageWrapper> | ||
); | ||
}; | ||
|
||
export default Detail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82d9d9a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
daodao-f2e – ./
daodao-f2e.vercel.app
daodao-f2e-daodaoedu.vercel.app
daodao-f2e-git-dev-daodaoedu.vercel.app