Skip to content

Commit

Permalink
added ability to see 'other' PCDs
Browse files Browse the repository at this point in the history
  • Loading branch information
ichub committed Jul 25, 2024
1 parent 958289a commit 60c4317
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 17 additions & 3 deletions apps/passport-client/components/screens/HomeScreen/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, {
useMemo,
useState
} from "react";
import { useNavigate, useSearchParams } from "react-router-dom";
import { useLocation, useNavigate, useSearchParams } from "react-router-dom";
import styled, { CSSProperties } from "styled-components";
import {
useDispatch,
Expand Down Expand Up @@ -60,6 +60,7 @@ export function HomeScreenImpl(): JSX.Element | null {
const navigate = useNavigate();
const dispatch = useDispatch();
const loadedIssuedPCDs = useLoadedIssuedPCDs();
const isOther = useLocation().pathname.startsWith("/other");

const [searchParams, setSearchParams] = useSearchParams();
const defaultBrowsingFolder = useMemo(() => {
Expand Down Expand Up @@ -167,8 +168,21 @@ export function HomeScreenImpl(): JSX.Element | null {
<MaybeModal />
<AppContainer bg="gray">
<Spacer h={24} />
{isRoot && <AppHeader isEdgeCity={isEdgeCity} />}
{isRoot && !isOther && <AppHeader isEdgeCity={isEdgeCity} />}
<Placeholder minH={540}>
{isRoot && isOther && (
<>
<FolderDetails
noChildFolders={isEdgeCity || foldersInFolder.length === 0}
folder={browsingFolder}
onFolderClick={() => {
window.location.href = "#/";
}}
/>
<div className="h-[0.75rem]"></div>
</>
)}

{/* {isRoot && (
<div className="font-bold text-3xl mb-4 text-center">My Events</div>
)} */}
Expand All @@ -191,7 +205,7 @@ export function HomeScreenImpl(): JSX.Element | null {
// FrogCrypto is a special and rendered by <FrogFolder />
(folder) => folder !== FrogCryptoFolderName
)
.filter(isEvent)
.filter((f) => (isOther ? !isEvent(f) : isEvent(f)))
.sort((a, b) => a.localeCompare(b))
.map((folder) => {
return (
Expand Down
1 change: 1 addition & 0 deletions apps/passport-client/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ function RouterImpl(): JSX.Element {
<Route path="/">
<Route path="terms" element={<TermsScreen />} />
<Route index element={<HomeScreen />} />
<Route path="other" element={<HomeScreen />} />
<Route path="login" element={<LoginScreen />} />
<Route
path="login-interstitial"
Expand Down

0 comments on commit 60c4317

Please sign in to comment.