Rename UserItemsPage
For consistency with what we're calling it, and with `UserItemListPage`!
This commit is contained in:
parent
f8748a2bcd
commit
faf8364aab
3 changed files with 12 additions and 10 deletions
|
@ -34,7 +34,9 @@ const PrivacyPolicyPage = loadable(() => import("./PrivacyPolicyPage"));
|
||||||
const SupportPetAppearancesPage = loadable(() =>
|
const SupportPetAppearancesPage = loadable(() =>
|
||||||
import("./SupportPetAppearancesPage")
|
import("./SupportPetAppearancesPage")
|
||||||
);
|
);
|
||||||
const UserItemsPage = loadable(() => import("./UserItemsPage"));
|
const UserItemListsIndexPage = loadable(() =>
|
||||||
|
import("./UserItemListsIndexPage")
|
||||||
|
);
|
||||||
const UserItemListPage = loadable(() => import("./UserItemListPage"));
|
const UserItemListPage = loadable(() => import("./UserItemListPage"));
|
||||||
const UserOutfitsPage = loadable(() => import("./UserOutfitsPage"));
|
const UserOutfitsPage = loadable(() => import("./UserOutfitsPage"));
|
||||||
const WardrobePage = loadable(() => import("./WardrobePage"), {
|
const WardrobePage = loadable(() => import("./WardrobePage"), {
|
||||||
|
@ -143,7 +145,7 @@ function App() {
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/user/:userId/lists">
|
<Route path="/user/:userId/lists">
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<UserItemsPage />
|
<UserItemListsIndexPage />
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/your-outfits">
|
<Route path="/your-outfits">
|
||||||
|
|
|
@ -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/lists");
|
const userItemListsIndexPageMatch = useRouteMatch("/user/:userId/lists");
|
||||||
const modelingPageMatch = useRouteMatch("/modeling");
|
const modelingPageMatch = useRouteMatch("/modeling");
|
||||||
|
|
||||||
if (itemPageMatch) {
|
if (itemPageMatch) {
|
||||||
|
@ -120,8 +120,8 @@ function useClassicDTIUrl() {
|
||||||
return `https://impress.openneo.net/items/${itemId}`;
|
return `https://impress.openneo.net/items/${itemId}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userItemsPageMatch) {
|
if (userItemListsIndexPageMatch) {
|
||||||
const { userId } = userItemsPageMatch.params;
|
const { userId } = userItemListsIndexPageMatch.params;
|
||||||
return `https://impress.openneo.net/user/${userId}/closet`;
|
return `https://impress.openneo.net/user/${userId}/closet`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,14 @@ const BadgeButton = React.forwardRef((props, ref) => (
|
||||||
<Badge as="button" ref={ref} {...props} />
|
<Badge as="button" ref={ref} {...props} />
|
||||||
));
|
));
|
||||||
|
|
||||||
function UserItemsPage() {
|
function UserItemListsIndexPage() {
|
||||||
const { userId } = useParams();
|
const { userId } = useParams();
|
||||||
const currentUser = useCurrentUser();
|
const currentUser = useCurrentUser();
|
||||||
const isCurrentUser = currentUser.id === userId;
|
const isCurrentUser = currentUser.id === userId;
|
||||||
|
|
||||||
const { loading, error, data } = useQuery(
|
const { loading, error, data } = useQuery(
|
||||||
gql`
|
gql`
|
||||||
query UserItemsPage($userId: ID!) {
|
query UserItemListsIndexPage($userId: ID!) {
|
||||||
user(id: $userId) {
|
user(id: $userId) {
|
||||||
id
|
id
|
||||||
username
|
username
|
||||||
|
@ -314,7 +314,7 @@ function UserSearchForm() {
|
||||||
query UserSearchForm($name: String!) {
|
query UserSearchForm($name: String!) {
|
||||||
userByName(name: $name) {
|
userByName(name: $name) {
|
||||||
id
|
id
|
||||||
# Consider preloading UserItemsPage fields here, too?
|
# Consider preloading UserItemListsIndexPage fields here, too?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
@ -348,7 +348,7 @@ function UserSearchForm() {
|
||||||
query UserSearchFormByEmail($email: String!, $supportSecret: String!) {
|
query UserSearchFormByEmail($email: String!, $supportSecret: String!) {
|
||||||
userByEmail(email: $email, supportSecret: $supportSecret) {
|
userByEmail(email: $email, supportSecret: $supportSecret) {
|
||||||
id
|
id
|
||||||
# Consider preloading UserItemsPage fields here, too?
|
# Consider preloading UserItemListsIndexPage fields here, too?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
@ -724,4 +724,4 @@ function UserSupportMenu({ children, user }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default UserItemsPage;
|
export default UserItemListsIndexPage;
|
Loading…
Reference in a new issue