diff --git a/apps/backend/src/app/api/v1/internal/metrics/route.tsx b/apps/backend/src/app/api/v1/internal/metrics/route.tsx index 22295e3b2..9f7884fd2 100644 --- a/apps/backend/src/app/api/v1/internal/metrics/route.tsx +++ b/apps/backend/src/app/api/v1/internal/metrics/route.tsx @@ -64,7 +64,7 @@ async function loadTotalUsers(projectId: string, now: Date): Promise GROUP BY ds.registration_day ORDER BY ds.registration_day `).map((x) => ({ - date: x.date.toLocaleDateString('en-US', { month: 'short', day: '2-digit' }), + date: x.date.toISOString().split('T')[0], activity: Number(x.dailyUsers), })); } @@ -98,7 +98,7 @@ async function loadDailyActiveUsers(projectId: string, now: Date) { `; return res.map(x => ({ - date: x.day.toLocaleDateString('en-US', { month: 'short', day: '2-digit' }), + date: x.day.toISOString().split('T')[0], activity: Number(x.dau), })); } diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/globe.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/globe.tsx index 1e85ef9e1..5399022ee 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/globe.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/globe.tsx @@ -132,12 +132,12 @@ export function GlobeSection({ countryData, totalUsers, children }: {countryData >
{!isGlobeReady && ( - - + + + } /> - + fillOpacity={1} + isAnimationActive={false} + >{datapoints.map(x => ( + + ))} + value} /> - + @@ -161,6 +172,7 @@ export function DonutChartDisplay({ nameKey="method" innerRadius={60} labelLine={false} + isAnimationActive={false} label={(x) => `${new Map(Object.entries(BRAND_CONFIG)).get(x.method)?.label ?? x.method}: ${x.count}`} /> diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/page-client.tsx index d4c668ce7..bfbc3a656 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/metrics/page-client.tsx @@ -1,7 +1,8 @@ 'use client'; +import { UserAvatar } from '@stackframe/stack'; import { fromNow } from '@stackframe/stack-shared/dist/utils/dates'; -import { Card, CardContent, CardHeader, CardTitle, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@stackframe/stack-ui'; +import { Card, CardContent, CardHeader, CardTitle, Table, TableBody, TableCell, TableRow, Typography } from '@stackframe/stack-ui'; import { PageLayout } from "../page-layout"; import { useAdminApp } from '../use-admin-app'; import { GlobeSection } from './globe'; @@ -57,19 +58,16 @@ export default function PageClient() { - - - Display Name - Registered at - - - { - data.recently_registered.map((user: any) => - {user.display_name} - {fromNow(new Date(user.signed_up_at_millis))} - ) - } + {data.recently_registered.map((user: any) => + + + {user.display_name ?? user.primary_email} + + signed up {fromNow(new Date(user.signed_up_at_millis))} + + + )}
@@ -80,19 +78,16 @@ export default function PageClient() { - - - Display Name - Last Active at - - - { - data.recently_active.map((user: any) => - {user.display_name} - {fromNow(new Date(user.last_active_at_millis))} - ) - } + {data.recently_active.map((user: any) => + + + {user.display_name ?? user.primary_email} + + last active {fromNow(new Date(user.last_active_at_millis))} + + + )}
diff --git a/packages/stack-shared/src/utils/dates.tsx b/packages/stack-shared/src/utils/dates.tsx index 9a4a9d8d3..a62d6708f 100644 --- a/packages/stack-shared/src/utils/dates.tsx +++ b/packages/stack-shared/src/utils/dates.tsx @@ -1,5 +1,9 @@ import { remainder } from "./math"; +export function isWeekend(date: Date): boolean { + return date.getDay() === 0 || date.getDay() === 6; +} + const agoUnits = [ [60, 'second'], [60, 'minute'], diff --git a/packages/stack/src/index.tsx b/packages/stack/src/index.tsx index b3d289172..4fc8ef55d 100644 --- a/packages/stack/src/index.tsx +++ b/packages/stack/src/index.tsx @@ -1,24 +1,26 @@ -export { default as StackProvider } from "./providers/stack-provider"; -export { useUser, useStackApp } from "./lib/hooks"; export { default as StackHandler } from "./components-page/stack-handler"; -export { StackTheme } from './providers/theme-provider'; +export { useStackApp, useUser } from "./lib/hooks"; export * from './lib/stack-app'; +export { default as StackProvider } from "./providers/stack-provider"; +export { StackTheme } from './providers/theme-provider'; -export { SignIn } from "./components-page/sign-in"; -export { SignUp } from "./components-page/sign-up"; -export { EmailVerification } from "./components-page/email-verification"; -export { PasswordReset } from "./components-page/password-reset"; -export { ForgotPassword } from "./components-page/forgot-password"; -export { MessageCard } from "./components/message-cards/message-card"; -export { UserButton } from "./components/user-button"; export { AccountSettings } from "./components-page/account-settings"; export { AuthPage } from "./components-page/auth-page"; +export { EmailVerification } from "./components-page/email-verification"; +export { ForgotPassword } from "./components-page/forgot-password"; +export { PasswordReset } from "./components-page/password-reset"; +export { SignIn } from "./components-page/sign-in"; +export { SignUp } from "./components-page/sign-up"; export { CredentialSignIn as CredentialSignIn } from "./components/credential-sign-in"; export { CredentialSignUp as CredentialSignUp } from "./components/credential-sign-up"; +export { UserAvatar } from "./components/elements/user-avatar"; export { MagicLinkSignIn as MagicLinkSignIn } from "./components/magic-link-sign-in"; +export { MessageCard } from "./components/message-cards/message-card"; export { OAuthButton } from "./components/oauth-button"; export { OAuthButtonGroup } from "./components/oauth-button-group"; +export { UserButton } from "./components/user-button"; export { - SelectedTeamSwitcher, + SelectedTeamSwitcher } from "./components/selected-team-switcher"; +