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() {
const itemPageMatch = useRouteMatch("/items/:itemId");
const userItemsPageMatch = useRouteMatch("/user/:userId/items");
const userItemsPageMatch = useRouteMatch("/user/:userId/lists");
const modelingPageMatch = useRouteMatch("/modeling");
if (itemPageMatch) {

View file

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

View file

@ -251,7 +251,7 @@ function ItemTradesTable({
trades.map((trade) => (
<ItemTradesTableRow
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}
listName={trade.closetList.name}
lastTradeActivity={trade.user.lastTradeActivity}

View file

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

View file

@ -205,7 +205,7 @@ const resolvers = {
},
],
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}`,
},
],
});