Oops, fix Lists page links!

Right, oops, the redirect works when you navigate directly to a URL, but not client-side! Fixed a bunch of 'em 😅
This commit is contained in:
Emi Matchu 2021-06-15 22:46:43 -07:00
parent cf30b25be0
commit 5c5bdb11ff
5 changed files with 16 additions and 12 deletions

View file

@ -112,7 +112,7 @@ function ColorModeButton() {
function useClassicDTIUrl() { function useClassicDTIUrl() {
const itemPageMatch = useRouteMatch("/items/:itemId"); const itemPageMatch = useRouteMatch("/items/:itemId");
const userItemsPageMatch = useRouteMatch("/user/:userId/items"); const userItemsPageMatch = useRouteMatch("/user/:userId/lists");
const modelingPageMatch = useRouteMatch("/modeling"); const modelingPageMatch = useRouteMatch("/modeling");
if (itemPageMatch) { if (itemPageMatch) {

View file

@ -128,7 +128,7 @@ function UserNavBarSection() {
)} )}
<NavLinksList> <NavLinksList>
{id && ( {id && (
<NavLinkItem as={Link} to={`/user/${id}/items`}> <NavLinkItem as={Link} to={`/user/${id}/lists`}>
Lists Lists
</NavLinkItem> </NavLinkItem>
)} )}

View file

@ -251,7 +251,7 @@ function ItemTradesTable({
trades.map((trade) => ( trades.map((trade) => (
<ItemTradesTableRow <ItemTradesTableRow
key={trade.id} key={trade.id}
href={`/user/${trade.user.id}/items#list-${trade.closetList.id}`} href={`/user/${trade.user.id}/lists#list-${trade.closetList.id}`}
username={trade.user.username} username={trade.user.username}
listName={trade.closetList.name} listName={trade.closetList.name}
lastTradeActivity={trade.user.lastTradeActivity} lastTradeActivity={trade.user.lastTradeActivity}

View file

@ -313,7 +313,7 @@ function UserSearchForm() {
return; return;
} }
history.push(`/user/${user.id}/items`); history.push(`/user/${user.id}/lists`);
}, },
onError: (error) => { onError: (error) => {
console.error(error); console.error(error);
@ -549,13 +549,17 @@ function ClosetList({ closetList, isCurrentUser, showHeading }) {
lineHeight="1.2" // to match Input lineHeight="1.2" // to match Input
paddingY="2px" // to account for Input border/padding paddingY="2px" // to account for Input border/padding
> >
{closetList.isDefaultList ? closetList.name : <Box {closetList.isDefaultList ? (
as={Link} closetList.name
to={buildClosetListPath(closetList)} ) : (
_hover={{ textDecoration: "underline" }} <Box
> as={Link}
{closetList.name} to={buildClosetListPath(closetList)}
</Box>} _hover={{ textDecoration: "underline" }}
>
{closetList.name}
</Box>
)}
</Heading3> </Heading3>
))} ))}
<Box flex="1 0 auto" width="4" /> <Box flex="1 0 auto" width="4" />

View file

@ -205,7 +205,7 @@ const resolvers = {
}, },
], ],
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
url: `https://impress-2020.openneo.net/user/${user.id}/items#list-${closetListId}`, url: `https://impress-2020.openneo.net/user/${user.id}/lists#list-${closetListId}`,
}, },
], ],
}); });