Skip to content

Commit 904166e

Browse files
committed
fix: UI functionality repair
- 添加 Mega Logo 组织图标组件 - 移除开发环境标识(DEV 红框) - 精简用户菜单:删除 Support 和 Apps & integrations 选项 - 移除组织切换器中的 "New Organization" 按钮
1 parent 71a8bd6 commit 904166e

4 files changed

Lines changed: 141 additions & 98 deletions

File tree

moon/apps/web/components/NavigationSidebar/OrganizationSwitcher.tsx

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import {
1111
ChevronSelectIcon,
1212
GearIcon,
1313
GlobeIcon,
14-
PlusIcon,
14+
MegaLogoIcon,
15+
// PlusIcon,
1516
ProjectIcon,
1617
ReorderHandlesIcon,
18+
// RocketIcon,
1719
UIText,
1820
useBreakpoint,
1921
UserCircleIcon
@@ -155,13 +157,13 @@ export function OrganizationSwitcher({ trigger }: { trigger?: React.ReactNode })
155157
const allItems = buildMenuItems([
156158
...items,
157159
!isLg && items.length > 0 && { type: 'separator' },
158-
...(!isLg ? mobileItems : []),
159-
(!isLg || memberships?.length === 1) && {
160-
type: 'item',
161-
leftSlot: <PlusIcon />,
162-
label: 'New organization',
163-
url: '/new'
164-
}
160+
...(!isLg ? mobileItems : [])
161+
// (!isLg || memberships?.length === 1) && {
162+
// type: 'item',
163+
// leftSlot: <PlusIcon />,
164+
// label: 'New organization',
165+
// url: '/new'
166+
// }
165167
])
166168

167169
if (allItems.length === 0) {
@@ -211,13 +213,17 @@ function OrganizationAvatarAndName({
211213
<div className={cn('flex min-w-[0] items-center gap-2 text-left', className)}>
212214
<div className='shrink-0'>
213215
{organization ? (
214-
<Avatar
215-
rounded='rounded'
216-
key={organization?.id}
217-
size='xs'
218-
name={organization?.name}
219-
urls={organization?.avatar_urls}
220-
/>
216+
organization?.name === 'Mega' ? (
217+
<MegaLogoIcon size={20} />
218+
) : (
219+
<Avatar
220+
rounded='rounded'
221+
key={organization?.id}
222+
size='xs'
223+
name={organization?.name}
224+
urls={organization?.avatar_urls}
225+
/>
226+
)
221227
) : (
222228
<ReorderHandlesIcon />
223229
)}

moon/apps/web/components/NavigationSidebar/ProfileDropdown.tsx

Lines changed: 82 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
import React, { forwardRef, useState } from 'react'
22
import { useSignoutUser } from 'hooks/useSignoutUser'
3-
import { isMobile } from 'react-device-detect'
43
import * as R from 'remeda'
54

6-
import { SITE_URL } from '@gitmono/config'
5+
// import { isMobile } from 'react-device-detect'
6+
// import { SITE_URL } from '@gitmono/config'
7+
// import { useIsDesktopApp } from '@gitmono/ui/src/hooks'
8+
79
import {
8-
AccessIcon,
9-
AppsIcon,
1010
Button,
11-
CalendarIcon,
12-
CodeIcon,
1311
DotsHorizontal,
14-
FigmaOutlineIcon,
1512
GearIcon,
16-
HelpIcon,
17-
LinearIcon,
1813
Link,
1914
LogOutIcon,
20-
MonitorIcon,
21-
UserCircleIcon,
22-
ZapierIcon
15+
UserCircleIcon
16+
// HelpIcon,
17+
// LinearIcon,
18+
// MonitorIcon,
19+
// ZapierIcon,
20+
// FigmaOutlineIcon,
21+
// CalendarIcon,
22+
// CodeIcon,
23+
// AccessIcon,
24+
// AppsIcon
2325
} from '@gitmono/ui'
2426
import { DropdownMenu } from '@gitmono/ui/DropdownMenu'
2527
import { buildMenuItems } from '@gitmono/ui/Menu'
26-
import { useIsDesktopApp } from '@gitmono/ui/src/hooks'
2728

2829
import { NotificationPauseCalendarDialog } from '@/components/NotificationPause/NotificationPauseCalendarDialog'
2930
import { NotificationScheduleDialog } from '@/components/NotificationPause/NotificationScheduleDialog'
@@ -62,7 +63,7 @@ export function ProfileDropdown({
6263
const { scope } = useScope()
6364
const { data: currentUser } = useGetCurrentUser()
6465
const signout = useSignoutUser()
65-
const isDesktop = useIsDesktopApp()
66+
// const isDesktop = useIsDesktopApp()
6667
const isStaff = useCurrentUserIsStaff()
6768
const [open, setOpen] = useState(false)
6869
const [notificationPauseCalendarDialogOpen, setNotificationPauseCalendarDialogOpen] = useState(false)
@@ -90,73 +91,73 @@ export function ProfileDropdown({
9091
},
9192
pauseNotificationsMenuItem,
9293
{ type: 'separator' },
93-
{
94-
type: 'item',
95-
label: 'Support',
96-
leftSlot: <HelpIcon />,
97-
url: `mailto:support@gitmono.com`
98-
},
99-
{ type: 'separator' },
100-
!isMobile && {
101-
type: 'sub',
102-
label: 'Apps & integrations',
103-
leftSlot: <AppsIcon />,
104-
items: buildMenuItems([
105-
!isDesktop && {
106-
type: 'item',
107-
label: 'Desktop app',
108-
leftSlot: <MonitorIcon />,
109-
external: true,
110-
url: `${SITE_URL}/desktop/download`
111-
},
112-
{
113-
type: 'item',
114-
label: 'Linear',
115-
leftSlot: <LinearIcon />,
116-
external: true,
117-
url: 'https://linear.app/integrations/campsite'
118-
},
119-
{
120-
type: 'item',
121-
label: 'Zapier',
122-
leftSlot: <ZapierIcon />,
123-
external: true,
124-
url: 'https://zapier.com/apps/campsite/integrations'
125-
},
126-
{
127-
type: 'item',
128-
label: 'Figma',
129-
leftSlot: <FigmaOutlineIcon />,
130-
external: true,
131-
url: `${SITE_URL}/figma/plugin`
132-
},
133-
{
134-
type: 'item',
135-
label: 'Cal.com',
136-
leftSlot: <CalendarIcon />,
137-
external: true,
138-
url: 'https://app.cal.com/apps/campsite'
139-
},
140-
{
141-
type: 'item',
142-
label: 'API',
143-
leftSlot: <CodeIcon />,
144-
external: true,
145-
url: 'https://developers.campsite.com'
146-
}
147-
])
148-
},
149-
!isMobile && { type: 'separator' },
150-
isStaff && {
151-
type: 'item',
152-
label: 'Feature flags',
153-
leftSlot: <AccessIcon />,
154-
external: true,
155-
url:
156-
!process.env.NODE_ENV || process.env.NODE_ENV === 'development'
157-
? 'http://admin.gitmega.com/admin/features/'
158-
: 'https://admin.campsite.com/admin/features'
159-
},
94+
// {
95+
// type: 'item',
96+
// label: 'Support',
97+
// leftSlot: <HelpIcon />,
98+
// url: `mailto:support@gitmono.com`
99+
// },
100+
// { type: 'separator' },
101+
// !isMobile && {
102+
// type: 'sub',
103+
// label: 'Apps & integrations',
104+
// leftSlot: <AppsIcon />,
105+
// items: buildMenuItems([
106+
// !isDesktop && {
107+
// type: 'item',
108+
// label: 'Desktop app',
109+
// leftSlot: <MonitorIcon />,
110+
// external: true,
111+
// url: `${SITE_URL}/desktop/download`
112+
// },
113+
// {
114+
// type: 'item',
115+
// label: 'Linear',
116+
// leftSlot: <LinearIcon />,
117+
// external: true,
118+
// url: 'https://linear.app/integrations/campsite'
119+
// },
120+
// {
121+
// type: 'item',
122+
// label: 'Zapier',
123+
// leftSlot: <ZapierIcon />,
124+
// external: true,
125+
// url: 'https://zapier.com/apps/campsite/integrations'
126+
// },
127+
// {
128+
// type: 'item',
129+
// label: 'Figma',
130+
// leftSlot: <FigmaOutlineIcon />,
131+
// external: true,
132+
// url: `${SITE_URL}/figma/plugin`
133+
// },
134+
// {
135+
// type: 'item',
136+
// label: 'Cal.com',
137+
// leftSlot: <CalendarIcon />,
138+
// external: true,
139+
// url: 'https://app.cal.com/apps/campsite'
140+
// },
141+
// {
142+
// type: 'item',
143+
// label: 'API',
144+
// leftSlot: <CodeIcon />,
145+
// external: true,
146+
// url: 'https://developers.campsite.com'
147+
// }
148+
// ])
149+
// },
150+
// !isMobile && { type: 'separator' },
151+
// isStaff && {
152+
// type: 'item',
153+
// label: 'Feature flags',
154+
// leftSlot: <AccessIcon />,
155+
// external: true,
156+
// url:
157+
// !process.env.NODE_ENV || process.env.NODE_ENV === 'development'
158+
// ? 'http://admin.gitmega.com/admin/features/'
159+
// : 'https://admin.campsite.com/admin/features'
160+
// },
160161
isStaff && { type: 'separator' },
161162
{
162163
type: 'item',

moon/apps/web/components/Providers/AuthAppProviders.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { IncomingCallRoomInvitationToast } from '@/components/Call/IncomingCallR
1414
import { LocalCommandMenu } from '@/components/CommandMenu'
1515
import { FeedbackDialog } from '@/components/Feedback/FeedbackDialog'
1616
import { GlobalKeyboardShortcuts } from '@/components/GlobalKeyboardShortcuts'
17-
import { DevModeBanner } from '@/components/NavigationSidebar/DevModeBanner'
1817
import { PostComposer } from '@/components/PostComposer'
1918
import { AuthProvider } from '@/components/Providers/AuthProvider'
2019
import { BackgroundAppRefresh } from '@/components/Providers/BackgroundAppRefresh'
@@ -69,7 +68,6 @@ export const AuthAppProviders: PageWithProviders<any> = ({ children, allowLogged
6968
<FeedbackDialog />
7069
<LocalCommandMenu />
7170
<BackgroundAppRefresh />
72-
<DevModeBanner />
7371
<GlobalKeyboardShortcuts />
7472
<DesktopProtocolUrlHandler />
7573
<PostComposer />

moon/packages/ui/src/Icons/index.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6603,3 +6603,41 @@ export function ServerStackIcon(props: IconProps) {
66036603
</svg>
66046604
)
66056605
}
6606+
6607+
export function MegaLogoIcon(props: IconProps) {
6608+
const { size = 20, ...rest } = props
6609+
6610+
return (
6611+
<svg width={size} height={size} viewBox='0 0 356 356' fill='none' xmlns='http://www.w3.org/2000/svg' {...rest}>
6612+
<path d='M146.152 34.3454L178.06 3.02734L209.948 34.3454H146.152Z' fill='#9DD7FF' />
6613+
<path d='M127.29 3.1875H178.129L146.147 34.3508L103.109 23.3889L127.29 3.1875Z' fill='#3EA5DF' />
6614+
<path d='M228.969 3.1875H178.129L209.952 34.3534L253.301 23.5009L228.969 3.1875Z' fill='#BCE3FF' />
6615+
<path d='M79.5781 57.0409L103.115 23.3867L146.337 34.3955L97.5997 94.1505L79.5781 57.0409Z' fill='#006BBF' />
6616+
<path d='M276.602 57.0409L253.065 23.3867L209.962 34.346L258.706 93.8747L276.602 57.0409Z' fill='#9BD4F0' />
6617+
<path d='M156.127 54.0289L146.159 34.3555L97.6016 94.1468L156.127 54.0289Z' fill='#80CBF5' />
6618+
<path d='M200.053 54.0276L209.959 34.3438L258.699 93.8552L200.053 54.0276Z' fill='#CFF7FF' />
6619+
<path d='M200.176 54.0809H156.122L146.152 34.3438H209.961L200.176 54.0809Z' fill='#E1F7FC' />
6620+
<path
6621+
d='M147.699 59.8026L156.123 54.082H200.262L208.537 59.8271L179.382 90.2929L147.699 59.8026Z'
6622+
fill='#0155A6'
6623+
/>
6624+
<path d='M10.2266 248.042L79.6524 57.1289L110.188 118.976L102.013 304.902L10.2266 248.042Z' fill='#003153' />
6625+
<path d='M345.945 248.982L276.519 57.1289L246.189 119.17L254.162 305.189L345.945 248.982Z' fill='#9BD4F0' />
6626+
<path d='M178.148 352.969L102.008 304.899L109.888 119.117L178.182 141.467L178.148 352.969Z' fill='#076AAF' />
6627+
<path d='M178.144 352.972L254.164 305.186L246.283 119.117L178.144 141.467V352.972Z' fill='#69B7E1' />
6628+
<path d='M132.215 150.921L149.682 116.359H221.568L230.829 150.921H132.215Z' fill='#076AAF' />
6629+
<path d='M137.696 212.598L125.809 149.432L147.953 135.68L137.696 212.598Z' fill='#E1F7FC' />
6630+
<path d='M221.777 212.598L233.664 149.432L211.52 135.68L221.777 212.598Z' fill='#E1F7FC' />
6631+
<path
6632+
d='M92.9492 124.136L97.6016 94.1434L147.696 59.8008L179.378 90.284V122.727L120.262 158.119L100.002 143.629L92.9492 124.136Z'
6633+
fill='#0E86D4'
6634+
/>
6635+
<path
6636+
d='M265.809 124.135L258.714 93.8151L208.519 59.8164L179.38 90.2822V122.725L238.495 158.117L258.756 143.627L265.809 124.135Z'
6637+
fill='#71C8FB'
6638+
/>
6639+
<circle cx='122.372' cy='49.0084' r='8.11782' fill='#042A69' />
6640+
<circle cx='233.844' cy='49.0084' r='8.11782' fill='#042A69' />
6641+
</svg>
6642+
)
6643+
}

0 commit comments

Comments
 (0)