Skip to content

Commit

Permalink
💄 style: Update changelog style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 authored and arvinxx committed Dec 1, 2024
1 parent 9a6bcbe commit 49430c4
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 65 deletions.
18 changes: 0 additions & 18 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,6 @@ const nextConfig = {
},
];
},

images: {
remotePatterns: [
{
hostname: 'localhost',
protocol: 'http',
},
{
hostname: '127.0.0.1',
protocol: 'http',
},
{
hostname: '**',
protocol: 'https',
},
],
// unoptimized: true,
},
output: buildWithDocker ? 'standalone' : undefined,
reactStrictMode: true,
redirects: async () => [
Expand Down
18 changes: 2 additions & 16 deletions src/app/(main)/(mobile)/me/(home)/features/useCategory.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { DiscordIcon } from '@lobehub/ui';
import {
Book,
CircleUserRound,
Database,
Download,
Feather,
FileClockIcon,
FileTextIcon,
LogOut,
Settings2,
} from 'lucide-react';
import { useRouter } from 'next/navigation';
import { useTranslation } from 'react-i18next';

import { CellProps } from '@/components/Cell';
import { CHANGELOG_URL, DISCORD, DOCUMENTS, FEEDBACK } from '@/const/url';
import { DOCUMENTS, FEEDBACK } from '@/const/url';
import { isServerMode } from '@/const/version';
import { usePWAInstall } from '@/hooks/usePWAInstall';
import { useUserStore } from '@/store/user';
Expand Down Expand Up @@ -106,23 +104,11 @@ export const useCategory = () => {
onClick: () => window.open(FEEDBACK, '__blank'),
},
{
icon: DiscordIcon,
key: 'discord',
label: 'Discord',
onClick: () => window.open(DISCORD, '__blank'),
},
{
icon: FileTextIcon,
icon: FileClockIcon,
key: 'changelog',
label: t('changelog'),
onClick: () => router.push('/changelog'),
},
{
icon: FileClockIcon,
key: 'releaseNotes',
label: t('releaseNotes'),
onClick: () => window.open(CHANGELOG_URL, '__blank'),
},
];

const nextAuthSignOut: CellProps[] = [
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/_layout/Desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfi

import { LayoutProps } from './type';

const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'), { ssr: false });
const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'));
const ChangelogModal = dynamic(() => import('@/features/ChangelogModal'), { ssr: false });

const Layout = memo<LayoutProps>(({ children, nav }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/_layout/Mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfi

import { LayoutProps } from './type';

const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'), { ssr: false });
const CloudBanner = dynamic(() => import('@/features/AlertBanner/CloudBanner'));
const ChangelogModal = dynamic(() => import('@/features/ChangelogModal'), { ssr: false });

const MOBILE_NAV_ROUTES = new Set([
Expand Down
3 changes: 2 additions & 1 deletion src/app/@modal/(.)changelog/features/Cover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const Cover = memo<{ alt: string; mobile?: boolean; src: string }>(({ alt, mobil
height: 'auto',
width: '100%',
}}
width={580}
unoptimized
width={600}
/>
</Flexbox>
);
Expand Down
12 changes: 9 additions & 3 deletions src/app/@modal/(.)changelog/features/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
'use client';

import { FluentEmoji } from '@lobehub/ui';
import { useTheme } from 'antd-style';
import { createStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

const useStyles = createStyles(
({ css, token }) => css`
background: linear-gradient(to bottom, ${token.colorFillTertiary}, transparent);
`,
);

const Hero = memo(() => {
const theme = useTheme();
const { theme, styles } = useStyles();
const { t } = useTranslation('changelog');
return (
<Flexbox gap={8} paddingBlock={32} paddingInline={24}>
<Flexbox className={styles} gap={8} padding={24}>
<Flexbox align={'center'} gap={12} horizontal>
<h1 style={{ fontSize: 24, fontWeight: 'bold', margin: 0 }}>{t('welcomeBack')}</h1>
<FluentEmoji emoji={'🤯'} size={28} type={'anim'} />
Expand Down
12 changes: 10 additions & 2 deletions src/app/@modal/(.)changelog/features/Post.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Typography } from '@lobehub/ui';
import Link from 'next/link';
import { Flexbox } from 'react-layout-kit';
import urlJoin from 'url-join';

import { CustomMDX } from '@/components/mdx';
import { OFFICIAL_SITE } from '@/const/url';
import { Locales } from '@/locales/resources';
import { ChangelogIndexItem, changelogService } from '@/services/changelog';

Expand All @@ -16,13 +19,18 @@ const Post = async ({
locale,
}: ChangelogIndexItem & { branch?: string; locale: Locales; mobile?: boolean }) => {
const data = await changelogService.getPostById(id, { locale });
const url = urlJoin(OFFICIAL_SITE, 'changelog', id);

return (
<Flexbox gap={8}>
<Cover alt={data.title} src={data.image} />
<Link href={url} style={{ color: 'inherit' }} target={'_blank'}>
<Cover alt={data.title} src={data.image} />
</Link>
<Flexbox gap={8} paddingInline={24}>
<Typography headerMultiple={0.2} style={{ width: '100%' }}>
<h1 id={id}>{data.rawTitle || data.title}</h1>
<Link href={url} style={{ color: 'inherit' }} target={'_blank'}>
<h1 id={id}>{data.rawTitle || data.title}</h1>
</Link>
<CustomMDX source={data.content} />
</Typography>
<Flexbox align={'center'} gap={8} horizontal justify={'space-between'} width={'100%'}>
Expand Down
2 changes: 1 addition & 1 deletion src/app/@modal/(.)changelog/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Layout: FC<PropsWithChildren> = ({ children }) => {
console.log(data);
updateSystemStatus({ latestChangelogId: data });
}}
width={'min(90vw, 580px)'}
width={'min(90vw, 600px)'}
>
<Flexbox
style={{ overflowX: 'hidden', overflowY: 'auto', position: 'relative' }}
Expand Down
34 changes: 12 additions & 22 deletions src/features/User/UserPanel/useMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Download,
Feather,
FileClockIcon,
FileTextIcon,
HardDriveDownload,
HardDriveUpload,
LifeBuoy,
Expand All @@ -26,7 +25,6 @@ import urlJoin from 'url-join';
import type { MenuProps } from '@/components/Menu';
import { LOBE_CHAT_CLOUD } from '@/const/branding';
import {
CHANGELOG_URL,
DISCORD,
DOCUMENTS_REFER_URL,
EMAIL_SUPPORT,
Expand Down Expand Up @@ -190,14 +188,11 @@ export const useMenu = () => {
),
},
{
icon: <Icon icon={DiscordIcon} />,
key: 'discord',
label: (
<Link href={DISCORD} target={'_blank'}>
{t('userPanel.discord')}
</Link>
),
icon: <Icon icon={FileClockIcon} />,
key: 'changelog',
label: <Link href={'/changelog'}>{t('changelog')}</Link>,
},

{
children: [
{
Expand All @@ -219,25 +214,20 @@ export const useMenu = () => {
),
},
{
icon: <Icon icon={Mail} />,
key: 'email',
icon: <Icon icon={DiscordIcon} />,
key: 'discord',
label: (
<Link href={mailTo(EMAIL_SUPPORT)} target={'_blank'}>
{t('userPanel.email')}
<Link href={DISCORD} target={'_blank'}>
{t('userPanel.discord')}
</Link>
),
},
{
icon: <Icon icon={FileTextIcon} />,
key: 'changelog',
label: <Link href={'/changelog'}>{t('changelog')}</Link>,
},
{
icon: <Icon icon={FileClockIcon} />,
key: 'releaseNotes',
icon: <Icon icon={Mail} />,
key: 'email',
label: (
<Link href={CHANGELOG_URL} target={'_blank'}>
{t('releaseNotes')}
<Link href={mailTo(EMAIL_SUPPORT)} target={'_blank'}>
{t('userPanel.email')}
</Link>
),
},
Expand Down

0 comments on commit 49430c4

Please sign in to comment.