feat: invitation limitation message
This commit is contained in:
@@ -131,6 +131,7 @@
|
||||
"invitation.generateButton": "Generate new code",
|
||||
"invitation.generateCost": "You can spend {{INVITATION_PRICE}} <PowerIcon /> Power to generate an invitation code for your friends.",
|
||||
"invitation.getCodeMessage": "You can get an invitation code through the following methods:",
|
||||
"invitation.limitationMessage": "Based on your usage time, you can generate up to {{limitation}} invitation codes.",
|
||||
"invitation.newInvitationSuccess": "🎉 New invitation generated, invite code is copied",
|
||||
"invitation.noInvitations": "No invitations",
|
||||
"invitation.notUsed": "Not used",
|
||||
|
||||
+23
-16
@@ -3492,21 +3492,23 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
dialect: "pg"
|
||||
}>
|
||||
declare const usersOpenApiSchema: z.ZodObject<
|
||||
{
|
||||
id: z.ZodString
|
||||
name: z.ZodNullable<z.ZodString>
|
||||
email: z.ZodString
|
||||
emailVerified: z.ZodNullable<z.ZodString>
|
||||
image: z.ZodNullable<z.ZodString>
|
||||
handle: z.ZodNullable<z.ZodString>
|
||||
createdAt: z.ZodDate
|
||||
},
|
||||
Omit<
|
||||
{
|
||||
id: z.ZodString
|
||||
name: z.ZodNullable<z.ZodString>
|
||||
email: z.ZodString
|
||||
emailVerified: z.ZodNullable<z.ZodString>
|
||||
image: z.ZodNullable<z.ZodString>
|
||||
handle: z.ZodNullable<z.ZodString>
|
||||
createdAt: z.ZodDate
|
||||
},
|
||||
"email"
|
||||
>,
|
||||
z.UnknownKeysParam,
|
||||
z.ZodTypeAny,
|
||||
{
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
@@ -3515,7 +3517,6 @@ declare const usersOpenApiSchema: z.ZodObject<
|
||||
{
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
@@ -4416,7 +4417,6 @@ declare const _routes: hono_hono_base.HonoBase<
|
||||
fromUser: {
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
@@ -4425,7 +4425,6 @@ declare const _routes: hono_hono_base.HonoBase<
|
||||
toUser: {
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
@@ -4619,7 +4618,6 @@ declare const _routes: hono_hono_base.HonoBase<
|
||||
owner: {
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
@@ -4819,7 +4817,6 @@ declare const _routes: hono_hono_base.HonoBase<
|
||||
data: {
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
@@ -4900,6 +4897,17 @@ declare const _routes: hono_hono_base.HonoBase<
|
||||
status: 200
|
||||
}
|
||||
}
|
||||
"/invitations/limitation": {
|
||||
$get: {
|
||||
input: {}
|
||||
output: {
|
||||
code: 0
|
||||
data: number
|
||||
}
|
||||
outputFormat: "json" | "text"
|
||||
status: 200
|
||||
}
|
||||
}
|
||||
} & {
|
||||
"/feeds/claim/message": {
|
||||
$get: {
|
||||
@@ -5300,7 +5308,6 @@ declare const _routes: hono_hono_base.HonoBase<
|
||||
owner: {
|
||||
name: string | null
|
||||
id: string
|
||||
email: string
|
||||
emailVerified: string | null
|
||||
image: string | null
|
||||
handle: string | null
|
||||
|
||||
@@ -33,6 +33,7 @@ import { toast } from "sonner"
|
||||
export const SettingInvitations = () => {
|
||||
const { t } = useTranslation("settings")
|
||||
const invitations = useAuthQuery(Queries.invitations.list())
|
||||
const limitation = useAuthQuery(Queries.invitations.limitation())
|
||||
|
||||
const { present } = useModalStack()
|
||||
const presentUserProfile = usePresentUserProfileModal("drawer")
|
||||
@@ -54,7 +55,16 @@ export const SettingInvitations = () => {
|
||||
PowerIcon: <i className="i-mgc-power ml-1 mr-0.5 text-base text-accent" />,
|
||||
}}
|
||||
i18nKey="invitation.generateCost"
|
||||
/>
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<Trans
|
||||
ns="settings"
|
||||
values={{
|
||||
limitation: limitation.data,
|
||||
}}
|
||||
i18nKey="invitation.limitationMessage"
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
@@ -174,7 +184,7 @@ const ConfirmModalContent = ({ dismiss }: { dismiss: () => void }) => {
|
||||
div: <div />,
|
||||
}}
|
||||
i18nKey="invitation.confirmModal.message"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
<div>{t("invitation.confirmModal.confirm")}</div>
|
||||
<div className="mt-4 flex items-center justify-end gap-3">
|
||||
|
||||
@@ -19,4 +19,10 @@ export const invitations = {
|
||||
const res = await apiClient.invitations.$get()
|
||||
return res.data
|
||||
}),
|
||||
|
||||
limitation: () =>
|
||||
defineQuery(["invitations", "limitation"], async () => {
|
||||
const res = await apiClient.invitations.limitation.$get()
|
||||
return res.data
|
||||
}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user