Skip to content

Commit

Permalink
Migrate to Lens v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoginth committed Dec 9, 2024
1 parent 939e43f commit cdd8f34
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/Account/CreatorTool.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ToggleWrapper from "@components/Staff/Users/Overview/Tool/ToggleWrapper";
import ToggleWrapper from "@components/Staff/Accounts/Overview/Tool/ToggleWrapper";
import errorToast from "@helpers/errorToast";
import { getAuthApiHeaders } from "@helpers/getAuthApiHeaders";
import { HEY_API_URL } from "@hey/data/constants";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Mod/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MetaTags from "@components/Common/MetaTags";
import Footer from "@components/Shared/Footer";
import List from "@components/Staff/Users/List";
import List from "@components/Staff/Accounts/List";
import { APP_NAME } from "@hey/data/constants";
import { ModFeedType } from "@hey/data/enums";
import { FeatureFlag } from "@hey/data/feature-flags";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Shared/Account/Suspend.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ToggleWrapper from "@components/Staff/Users/Overview/Tool/ToggleWrapper";
import ToggleWrapper from "@components/Staff/Accounts/Overview/Tool/ToggleWrapper";
import errorToast from "@helpers/errorToast";
import {
getAuthApiHeaders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ManagedAccounts: FC<ManagedAccountsProps> = ({ address }) => {
{data?.lastLoggedInAccount ? (
<div>
<Link
href={`/staff/users/${data?.lastLoggedInAccount?.address}`}
href={`/staff/accounts/${data?.lastLoggedInAccount?.address}`}
>
<SmallSingleAccount
account={data?.lastLoggedInAccount as Account}
Expand All @@ -42,7 +42,9 @@ const ManagedAccounts: FC<ManagedAccountsProps> = ({ address }) => {
) : null}
{data?.accountsAvailable.items.map((accountAvailable) => (
<div key={accountAvailable.account.address}>
<Link href={`/staff/users/${accountAvailable.account.address}`}>
<Link
href={`/staff/accounts/${accountAvailable.account.address}`}
>
<SmallSingleAccount
account={accountAvailable.account as Account}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import MetaTags from "@components/Common/MetaTags";
import Loader from "@components/Shared/Loader";
import AccountStaffTool from "@components/Staff/Accounts/Overview/Tool";
import StaffSidebar from "@components/Staff/Sidebar";
import AccountStaffTool from "@components/Staff/Users/Overview/Tool";
import { UserIcon } from "@heroicons/react/24/outline";
import { APP_NAME } from "@hey/data/constants";
import { FeatureFlag } from "@hey/data/feature-flags";
import type { Account } from "@hey/indexer";
import { type Account, useAccountQuery } from "@hey/indexer";
import {
Card,
EmptyState,
Expand All @@ -23,16 +23,16 @@ import { useAccountStore } from "src/store/persisted/useAccountStore";
const Overview: NextPage = () => {
const {
isReady,
query: { id }
query: { address }
} = useRouter();
const { currentAccount } = useAccountStore();
const isStaff = useFlag(FeatureFlag.Staff);

const { data, error, loading } = useProfileQuery({
skip: !id || !isReady,
variables: { request: { forProfileId: id } }
const { data, error, loading } = useAccountQuery({
skip: !address || !isReady,
variables: { request: { address: address } }
});
const account = data?.profile as Account;
const account = data?.account as Account;

if (!currentAccount || !isStaff) {
return <Custom404 />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useAccountStore } from "src/store/persisted/useAccountStore";
import StaffSidebar from "../Sidebar";
import List from "./List";

const Users: NextPage = () => {
const Accounts: NextPage = () => {
const { currentAccount } = useAccountStore();
const isStaff = useFlag(FeatureFlag.Staff);

Expand All @@ -30,4 +30,4 @@ const Users: NextPage = () => {
);
};

export default Users;
export default Accounts;
4 changes: 2 additions & 2 deletions apps/web/src/components/Staff/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const sidebarItems = [
},
{
icon: <UserIcon className="size-4" />,
title: "Users",
url: "/staff/users"
title: "Accounts",
url: "/staff/accounts"
},
{
icon: <CurrencyDollarIcon className="size-4" />,
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/pages/staff/accounts/[id].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Overview from "@components/Staff/Accounts/Overview";

export default Overview;
3 changes: 3 additions & 0 deletions apps/web/src/pages/staff/accounts/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Accounts from "@components/Staff/Accounts";

export default Accounts;
3 changes: 0 additions & 3 deletions apps/web/src/pages/staff/users/[id].tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/web/src/pages/staff/users/index.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/helpers/getAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const getAccount = (
slug,
slugWithPrefix: `${prefix}${slug}`,
sourceLink: source ? `${link}?source=${source}` : link,
staffLink: `/staff/users/${account.address}`
staffLink: `/staff/accounts/${account.address}`
};
};

Expand Down

0 comments on commit cdd8f34

Please sign in to comment.