Skip to content

Commit a544569

Browse files
committed
bot icon
1 parent 184511f commit a544569

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

components/page/roleIcons.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import User from '@root/models/db/user';
2+
import { Bot } from 'lucide-react';
23
import Image from 'next/image';
34
import Link from 'next/link';
45
import React from 'react';
@@ -25,6 +26,10 @@ export function RoleIcon({ id, role, size = 18 }: RoleIconProps) {
2526
// TODO: curator icon
2627
tooltip = 'Curator';
2728
break;
29+
case (Role.BOT):
30+
tooltip = 'Approved Bot';
31+
icon = <Bot stroke='green' size={size} />;
32+
break;
2833
case (Role.PRO):
2934
icon = <Image alt='pro' src='/pro.svg' width={size} height={size} style={{ minWidth: size, minHeight: size }} />;
3035
tooltip = 'Pro Subscriber';

constants/role.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
enum Role {
22
ADMIN = 'Admin',
3+
BOT = 'Bot',
34
CURATOR = 'Curator',
45
FORMER_GUEST = 'FormerGuest',
56
GUEST = 'Guest',

pages/_app.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,11 @@ export default function MyApp({ Component, pageProps, userAgent, initGame }: App
432432
console.log('IDENTIFYING USER WITH POSTHOG', user.name);
433433
// Identify user with PostHog
434434
posthog.identify(user._id.toString(), {
435-
name: user.name,
436-
email: user.email || '',
437-
roles: user.roles,
438-
created_at: user.ts ? new Date(user.ts * 1000).toISOString() : undefined,
439-
last_game: user.lastGame,
435+
name: user?.name,
436+
email: user?.email || '',
437+
roles: user?.roles,
438+
created_at: user?.ts ? new Date(user.ts * 1000).toISOString() : undefined,
439+
last_game: user?.lastGame,
440440
utm_source: user.utm_source,
441441
has_pro: isPro(user),
442442
email_confirmed: user.emailConfirmed,

0 commit comments

Comments
 (0)