parent
69d3df4678
commit
eb2613114b
|
|
@ -4,9 +4,11 @@ import { forwardRef, memo, useCallback, useLayoutEffect, useState } from "react"
|
|||
import { useTranslation } from "react-i18next"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
|
||||
import { useUserRole } from "~/atoms/user"
|
||||
import { useSignOut } from "~/hooks/biz/useSignOut"
|
||||
import { useMeasure } from "~/hooks/common"
|
||||
import { nextFrame } from "~/lib/dom"
|
||||
import { UserRole } from "~/lib/enum"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useAchievementModal } from "~/modules/achievement/hooks"
|
||||
import { usePresentUserProfileModal } from "~/modules/profile/hooks"
|
||||
|
|
@ -42,6 +44,8 @@ export const ProfileButton: FC<LoginProps> = memo((props) => {
|
|||
|
||||
const navigate = useNavigate()
|
||||
|
||||
const role = useUserRole()
|
||||
|
||||
if (status !== "authenticated") {
|
||||
return <LoginButton {...props} />
|
||||
}
|
||||
|
|
@ -88,15 +92,17 @@ export const ProfileButton: FC<LoginProps> = memo((props) => {
|
|||
{t("user_button.profile")}
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuItem
|
||||
className="pl-3"
|
||||
onClick={() => {
|
||||
presentAchievement()
|
||||
}}
|
||||
icon={<i className="i-mgc-trophy-cute-re" />}
|
||||
>
|
||||
{t("user_button.achievement")}
|
||||
</DropdownMenuItem>
|
||||
{role !== UserRole.Trial && (
|
||||
<DropdownMenuItem
|
||||
className="pl-3"
|
||||
onClick={() => {
|
||||
presentAchievement()
|
||||
}}
|
||||
icon={<i className="i-mgc-trophy-cute-re" />}
|
||||
>
|
||||
{t("user_button.achievement")}
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem
|
||||
|
|
|
|||
|
|
@ -35,7 +35,10 @@ const absoluteConfettiUrl = new URL(confettiUrl, import.meta.url).href
|
|||
const formSchema = z.object({
|
||||
code: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export function Component() {
|
||||
const { t } = useTranslation("external")
|
||||
const navigate = useNavigate()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { UserRole } from "~/lib/enum"
|
||||
import { SettingInvitations } from "~/modules/settings/tabs/invitations"
|
||||
import { SettingsTitle } from "~/modules/settings/title"
|
||||
import { defineSettingPageData } from "~/modules/settings/utils"
|
||||
|
|
@ -9,6 +10,9 @@ export const loader = defineSettingPageData({
|
|||
iconName,
|
||||
name: "titles.invitations",
|
||||
priority,
|
||||
hideIf(ctx) {
|
||||
return ctx.role !== UserRole.Trial
|
||||
},
|
||||
})
|
||||
|
||||
export function Component() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { UserRole } from "~/lib/enum"
|
||||
import { SettingLists } from "~/modules/settings/tabs/lists"
|
||||
import { SettingsTitle } from "~/modules/settings/title"
|
||||
import { defineSettingPageData } from "~/modules/settings/utils"
|
||||
|
|
@ -9,6 +10,9 @@ export const loader = defineSettingPageData({
|
|||
iconName,
|
||||
name: "titles.lists",
|
||||
priority,
|
||||
hideIf(ctx) {
|
||||
return ctx.role !== UserRole.Trial
|
||||
},
|
||||
})
|
||||
|
||||
export function Component() {
|
||||
|
|
|
|||
|
|
@ -3869,15 +3869,15 @@ declare const walletsOpenAPISchema: zod.ZodObject<{
|
|||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
createdAt: string;
|
||||
userId: string;
|
||||
addressIndex: number;
|
||||
address: string | null;
|
||||
addressIndex: number;
|
||||
dailyPowerToken: string;
|
||||
cashablePowerToken: string;
|
||||
}, {
|
||||
createdAt: string;
|
||||
userId: string;
|
||||
addressIndex: number;
|
||||
address: string | null;
|
||||
addressIndex: number;
|
||||
dailyPowerToken: string;
|
||||
cashablePowerToken: string;
|
||||
}>;
|
||||
|
|
@ -4770,14 +4770,19 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
|
|||
};
|
||||
"/wallets": {
|
||||
$get: {
|
||||
input: {};
|
||||
input: {
|
||||
query: {
|
||||
userId?: string | string[] | undefined;
|
||||
address?: string | string[] | undefined;
|
||||
};
|
||||
};
|
||||
output: {
|
||||
code: 0;
|
||||
data: {
|
||||
createdAt: string;
|
||||
userId: string;
|
||||
addressIndex: number;
|
||||
address: string | null;
|
||||
addressIndex: number;
|
||||
dailyPowerToken: string;
|
||||
cashablePowerToken: string;
|
||||
}[];
|
||||
|
|
|
|||
Loading…
Reference in New Issue