Skip to content

Commit 24c2fef

Browse files
committed
refactor: update various components to improve UI consistency
1 parent 784d0b6 commit 24c2fef

File tree

104 files changed

+1323
-1580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1323
-1580
lines changed

package-lock.json

Lines changed: 183 additions & 170 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
"@gfazioli/mantine-text-animate": "^2.3.2",
4545
"@highcharts/react": "^4.0.0-beta.5",
4646
"@lukemorales/query-key-factory": "^1.3.4",
47-
"@mantine/carousel": "^8.3.5",
48-
"@mantine/charts": "^8.3.5",
49-
"@mantine/code-highlight": "^8.3.5",
50-
"@mantine/core": "^8.3.5",
51-
"@mantine/dates": "^8.3.5",
52-
"@mantine/dropzone": "^8.3.5",
53-
"@mantine/form": "^8.3.5",
54-
"@mantine/hooks": "^8.3.5",
55-
"@mantine/modals": "^8.3.5",
56-
"@mantine/notifications": "^8.3.5",
57-
"@mantine/nprogress": "^8.3.5",
58-
"@mantine/spotlight": "^8.3.5",
47+
"@mantine/carousel": "^8.3.6",
48+
"@mantine/charts": "^8.3.6",
49+
"@mantine/code-highlight": "^8.3.6",
50+
"@mantine/core": "^8.3.6",
51+
"@mantine/dates": "^8.3.6",
52+
"@mantine/dropzone": "^8.3.6",
53+
"@mantine/form": "^8.3.6",
54+
"@mantine/hooks": "^8.3.6",
55+
"@mantine/modals": "^8.3.6",
56+
"@mantine/notifications": "^8.3.6",
57+
"@mantine/nprogress": "^8.3.6",
58+
"@mantine/spotlight": "^8.3.6",
5959
"@monaco-editor/react": "^4.7.0",
6060
"@noble/post-quantum": "^0.5.2",
6161
"@paralleldrive/cuid2": "2.2.2",
@@ -68,7 +68,7 @@
6868
"@tanstack/react-query-devtools": "5.85.9",
6969
"@tanstack/react-virtual": "^3.13.12",
7070
"@virtuoso.dev/masonry": "^1.3.5",
71-
"axios": "^1.12.2",
71+
"axios": "^1.13.1",
7272
"buffer": "^6.0.3",
7373
"clsx": "^2.1.1",
7474
"color-hash": "^2.0.2",
@@ -80,7 +80,7 @@
8080
"dotenv": "^17.2.3",
8181
"generate-password-ts": "^1.6.5",
8282
"highcharts": "^12.4.0",
83-
"highcharts-react-official": "^3.2.2",
83+
"highcharts-react-official": "^3.2.3",
8484
"i18next": "^25.6.0",
8585
"i18next-browser-languagedetector": "^8.2.0",
8686
"i18next-http-backend": "^3.0.2",
@@ -92,13 +92,13 @@
9292
"mantine-react-table": "^2.0.0-beta.9",
9393
"monaco-editor": "^0.52.2",
9494
"monaco-yaml": "^5.4.0",
95-
"motion": "12.23.21",
95+
"motion": "12.23.24",
9696
"nanoid": "^5.1.6",
9797
"react": "^19.2.0",
9898
"react-country-flag": "^3.1.0",
9999
"react-dom": "^19.2.0",
100100
"react-error-boundary": "^6.0.0",
101-
"react-i18next": "^16.1.6",
101+
"react-i18next": "^16.2.2",
102102
"react-icons": "^5.5.0",
103103
"react-imask": "^7.6.1",
104104
"react-layout-masonry": "^2.0.0",

public/locales/en/remnawave.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,6 @@
540540
"registration": "Registration"
541541
}
542542
},
543-
"xray-json-template-description": {
544-
"widget": {
545-
"importing-json-subscription": "Importing JSON subscription",
546-
"description-line-1": "To use this subscription, just add",
547-
"description-line-2": "at the end of your subscription link. Make sure you're using one of the supported apps listed in the table below. Otherwise, subscription will work as usual for requested client. (e.g. Base64, Mihomo)"
548-
}
549-
},
550543
"happ-routing-builder": {
551544
"widget": {
552545
"copy-link": "Copy link",
@@ -1766,5 +1759,17 @@
17661759
"reset": "Reset",
17671760
"reset-usage": "Reset usage"
17681761
}
1762+
},
1763+
"help-drawer": {
1764+
"shared": {
1765+
"templates-xray-json": "<h2>Xray JSON Subscription Format</h2> <p> The Xray JSON format provides native JSON-based subscription support for compatible clients. Simply append <code>/json</code> to your subscription URL to enable this format. </p> <h3>Supported Applications</h3> <ul> <li><strong>v2rayNG</strong> — version 1.8.29 or higher</li> <li><strong>V2rayN</strong> — version 6.40 or higher</li> <li><strong>Streisand</strong> — all versions</li> <li><strong>Happ</strong> — all versions</li> <li><strong>V2Box</strong> — all versions</li> <li><strong>ktor-client</strong> — all versions</li> </ul> <h3>Usage Instructions</h3> <p><strong>Step 1:</strong> Modify your subscription URL</p> <p style=\"margin-left: 20px;\"> Append <code>/json</code> to the end of your subscription link:<br /> <code style=\"display: inline-block; margin-top: 8px; padding: 8px 12px; background: rgba(0,0,0,0.05); border-radius: 4px;\"> https://&lt;server&gt;/api/sub/xxxx/json </code> </p> <p><strong>Step 2:</strong> Verify compatibility</p> <p style=\"margin-left: 20px;\"> Ensure your client application meets the minimum version requirements listed above. </p> <p><strong>Alternatively:</strong> Enable JSON At the base path</p> <p style=\"margin-left: 20px;\"> Enable the \"Serve JSON at base subscription\" option in the subscription settings. This will serve the JSON subscription at the base subscription path (without having to append /json). </p> <h3>Fallback Behavior</h3> <p> For clients that don't support the JSON format (such as Base64 or Mihomo-based clients), the subscription will automatically fall back to the standard format compatible with your client. </p>",
1766+
"unknown-screen-provided": "Unknown screen provided.",
1767+
"loading-help-drawer": "Loading help drawer..."
1768+
}
1769+
},
1770+
"help-action-icon": {
1771+
"shared": {
1772+
"help-article": "Help Article"
1773+
}
17691774
}
17701775
}

src/app/layouts/dashboard/main-layout/Main.module.css

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
100dvh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
88
);
99

10-
background: light-dark(
11-
linear-gradient(135deg, var(--mantine-color-gray-0) 0%, var(--mantine-color-gray-1) 100%),
12-
linear-gradient(135deg, var(--mantine-color-dark-8) 0%, var(--mantine-color-dark-7) 100%)
10+
background: linear-gradient(
11+
135deg,
12+
var(--mantine-color-dark-8) 0%,
13+
var(--mantine-color-dark-7) 100%
1314
);
1415

1516
box-shadow:
16-
0 8px 32px rgba(0, 0, 0, 0.1),
17-
0 2px 8px rgba(0, 0, 0, 0.05),
18-
inset 0 1px 0 rgba(255, 255, 255, 0.1);
17+
0 1px 1px hsl(0deg 0% 0% / 0.075),
18+
0 2px 2px hsl(0deg 0% 0% / 0.075),
19+
0 4px 4px hsl(0deg 0% 0% / 0.075),
20+
0 8px 8px hsl(0deg 0% 0% / 0.075),
21+
0 16px 16px hsl(0deg 0% 0% / 0.075);
1922

2023
border-radius: var(--mantine-radius-lg);
2124
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
@@ -25,6 +28,16 @@
2528
}
2629
}
2730

31+
.sidebarWrapperClosedDesktop {
32+
margin-left: 0;
33+
box-shadow: none;
34+
}
35+
36+
.sidebarWrapperClosedMobile {
37+
margin-left: 0;
38+
box-shadow: none;
39+
}
40+
2841
.sidebarWrapper::before {
2942
content: '';
3043
position: absolute;
@@ -123,3 +136,16 @@
123136
transparent 100%
124137
);
125138
}
139+
140+
@keyframes fadein {
141+
from {
142+
opacity: 0;
143+
}
144+
to {
145+
opacity: 1;
146+
}
147+
}
148+
149+
.appShellFadeIn {
150+
animation: fadein 0.2s ease-out;
151+
}

src/app/layouts/dashboard/main-layout/main.layout.tsx

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import { useClickOutside, useDisclosure, useHeadroom, useMediaQuery } from '@mantine/hooks'
22
import { AppShell, Box, Burger, Container, Group, ScrollArea } from '@mantine/core'
3-
import { useQuery } from '@tanstack/react-query'
43
import { useEffect, useState } from 'react'
54
import { Outlet } from 'react-router-dom'
6-
import axios from 'axios'
5+
import clsx from 'clsx'
76

7+
import { useIsLoadingRemnawaveUpdates, useRemnawaveInfo } from '@entities/dashboard/updates-store'
88
import { ScrollToTopWrapper } from '@shared/hocs/scroll-to-top/scroll-to-top'
9-
import { useGetAuthStatus } from '@shared/api/hooks/auth/auth.query.hooks'
109
import { SidebarTitleShared } from '@shared/ui/sidebar/sidebar-title'
1110
import { SidebarLogoShared } from '@shared/ui/sidebar/sidebar-logo'
1211
import { HeaderControls } from '@shared/ui/header-buttons'
12+
import { HelpDrawerShared } from '@shared/ui/help-drawer'
1313
import { VersionBadgeShared } from '@shared/ui/sidebar'
14-
import { sToMs } from '@shared/utils/time-utils'
15-
import { LoadingScreen } from '@shared/ui'
1614

1715
import { Navigation } from './navbar/navigation.layout'
1816
import classes from './Main.module.css'
1917

2018
export function MainLayout() {
21-
const { data: authStatus, isLoading: isAuthStatusLoading } = useGetAuthStatus()
22-
2319
const [mobileOpened, { toggle: toggleMobile }] = useDisclosure()
2420
const [desktopOpened, { toggle: toggleDesktop }] = useDisclosure(true)
2521
const [isMediaQueryReady, setIsMediaQueryReady] = useState(false)
@@ -32,6 +28,9 @@ export function MainLayout() {
3228
getInitialValueInEffect: false
3329
})
3430

31+
const remnawaveInfo = useRemnawaveInfo()
32+
const isLoadingUpdates = useIsLoadingRemnawaveUpdates()
33+
3534
useEffect(() => {
3635
setIsMediaQueryReady(true)
3736
}, [isMobile, isSocialButton])
@@ -42,36 +41,21 @@ export function MainLayout() {
4241
}
4342
})
4443

45-
const { data, isLoading: isGithubLoading } = useQuery({
46-
queryKey: ['github-stars'],
47-
staleTime: sToMs(3600),
48-
refetchInterval: sToMs(3600),
49-
queryFn: async () => {
50-
const response = await axios.get<{
51-
totalStars: number
52-
}>('https://ungh.cc/stars/remnawave/*')
53-
return response.data
54-
}
55-
})
56-
57-
if (isAuthStatusLoading) {
58-
return <LoadingScreen height="100vh" />
59-
}
60-
6144
if (!isMediaQueryReady) {
6245
return <div style={{ height: '100vh' }}></div>
6346
}
6447

6548
return (
6649
<AppShell
50+
className={classes.appShellFadeIn}
6751
header={{ height: 64, collapsed: isMobile ? false : !pinned, offset: false }}
6852
layout="alt"
6953
navbar={{
7054
width: 300,
7155
breakpoint: 'lg',
7256
collapsed: { mobile: !mobileOpened, desktop: !desktopOpened }
7357
}}
74-
padding="xl"
58+
padding={isMobile ? 'md' : 'xl'}
7559
transitionDuration={500}
7660
transitionTimingFunction="ease-in-out"
7761
>
@@ -88,8 +72,8 @@ export function MainLayout() {
8872
<Group style={{ flexShrink: 0 }}>
8973
<HeaderControls
9074
githubLink="https://github.com/remnawave/panel"
91-
isGithubLoading={isGithubLoading}
92-
stars={data?.totalStars}
75+
isGithubLoading={isLoadingUpdates}
76+
stars={remnawaveInfo.starsCount || undefined}
9377
telegramLink="https://t.me/remnawave"
9478
withGithub={!isSocialButton}
9579
withSupport={!isSocialButton}
@@ -100,7 +84,10 @@ export function MainLayout() {
10084
</Container>
10185
</AppShell.Header>
10286
<AppShell.Navbar
103-
className={classes.sidebarWrapper}
87+
className={clsx(classes.sidebarWrapper, {
88+
[classes.sidebarWrapperClosedDesktop]: !isMobile && !desktopOpened,
89+
[classes.sidebarWrapperClosedMobile]: isMobile && !mobileOpened
90+
})}
10491
p="md"
10592
pb={0}
10693
ref={ref}
@@ -117,9 +104,12 @@ export function MainLayout() {
117104
/>
118105
</Box>
119106

120-
<Group gap="xs" justify="center" w="100%">
121-
<SidebarLogoShared logoUrl={authStatus?.branding.logoUrl} />
122-
<SidebarTitleShared title={authStatus?.branding.title} />
107+
<Group gap="xs" justify={isMobile ? 'center' : 'space-between'} w="100%">
108+
<Group gap={4}>
109+
<SidebarLogoShared />
110+
<SidebarTitleShared />
111+
</Group>
112+
123113
{!isMobile && <VersionBadgeShared />}
124114
</Group>
125115

@@ -143,8 +133,8 @@ export function MainLayout() {
143133
<Group justify="center" mt="md" style={{ flexShrink: 0 }}>
144134
<HeaderControls
145135
githubLink="https://github.com/remnawave/panel"
146-
isGithubLoading={isGithubLoading}
147-
stars={data?.totalStars}
136+
isGithubLoading={isLoadingUpdates}
137+
stars={remnawaveInfo.starsCount || undefined}
148138
telegramLink="https://t.me/remnawave"
149139
withLanguage={false}
150140
withLogout={false}
@@ -154,10 +144,14 @@ export function MainLayout() {
154144
)}
155145
</AppShell.Section>
156146
</AppShell.Navbar>
157-
<AppShell.Main pb="var(--mantine-spacing-md)" pt="var(--app-shell-header-height)">
147+
<AppShell.Main
148+
pb="var(--mantine-spacing-md)"
149+
pt="calc(var(--app-shell-header-height) + 10px)"
150+
>
158151
<ScrollToTopWrapper>
159152
<Outlet />
160153
</ScrollToTopWrapper>
154+
<HelpDrawerShared />
161155
</AppShell.Main>
162156
</AppShell>
163157
)

src/app/layouts/dashboard/main-layout/menu-sections/interfaces/menu-item.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import { ElementType } from 'react'
22

33
export interface MenuItem {
44
header?: string
5+
id?: string
56
section: {
67
dropdownItems?: {
78
href: string
89
icon?: ElementType
10+
id: string
911
name: string
1012
}[]
1113
href: string
1214
icon: ElementType
15+
id: string
1316
name: string
1417
newTab?: boolean
1518
}[]

0 commit comments

Comments
 (0)