Skip to content

Commit

Permalink
import UserHome into lib-user dev App
Browse files Browse the repository at this point in the history
  • Loading branch information
goplayoutside3 committed Jun 7, 2024
1 parent 0965ff3 commit 0685e44
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/lib-user/dev/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Contributors,
GroupStats,
MyGroups,
UserHome,
UserStats
} from '@components'

Expand All @@ -31,7 +32,7 @@ function App({
useEffect(() => {
async function checkUserSession() {
setLoading(true)

try {
const user = await auth.checkCurrent()
setUser(user)
Expand All @@ -41,7 +42,7 @@ function App({
setLoading(false)
}
}

auth.listen('change', checkUserSession)

return function () {
Expand Down Expand Up @@ -93,13 +94,14 @@ function App({
</li>
</ul>
</ul>
{user?.id ? <UserHome authUser={user} /> : null}
</div>
)

if (groups) {
const subpaths = groups.split('/')
const groupId = subpaths[0] || ''

if (subpaths[0] === '[user_group_id]') {
content = <p>In the url query param <code>?groups=</code>, please replace <code>[user_group_id]</code> with a user group id.</p>
} else if (subpaths[1] === 'contributors') {
Expand Down Expand Up @@ -185,7 +187,7 @@ function App({
/>
</div>
</header>
{loading ?
{loading ?
<p>Loading...</p> : (
<div>
{content}
Expand Down

0 comments on commit 0685e44

Please sign in to comment.