Skip to content

Commit

Permalink
💄 style: Update style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed May 15, 2024
1 parent 680554e commit 8fd035c
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 69 deletions.
121 changes: 76 additions & 45 deletions javascript/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
},
"dependencies": {
"@bluelovers/auto1111-pnginfo": "^2.0.2",
"@icons-pack/react-simple-icons": "^9.5.0",
"@lobehub/ui": "^1.138.24",
"@rollup/rollup-win32-x64-msvc": "^4.17.2",
"ahooks": "^3.7.11",
Expand Down
19 changes: 18 additions & 1 deletion src/components/Logo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Logo as LobeLogo } from '@lobehub/ui';
import isEqual from 'fast-deep-equal';
import { type CSSProperties, memo } from 'react';

import { GITHUB_REPO_URL } from '@/const/url';
import { selectors, useAppStore } from '@/store';

import CustomLogo from './CustomLogo';
Expand Down Expand Up @@ -31,7 +32,23 @@ const Logo = memo<LogoProps>(({ size = 32, style }) => {
);
}

return <LobeLogo extra="SD" size={size} style={style} type="combine" />;
return (
<LobeLogo
extra={
<a
href={GITHUB_REPO_URL}
rel="noreferrer"
style={{ color: 'inherit', fontWeight: 400 }}
target="_blank"
>
SD
</a>
}
size={size}
style={style}
type="combine"
/>
);
});

export default Logo;
2 changes: 2 additions & 0 deletions src/const/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export const SITE_URL = location.origin;
export const EMAIL_SUPPORT = 'support@lobehub.com';
export const EMAIL_BUSINESS = 'hello@lobehub.com';
export const X = 'https://x.com/lobehub';
export const MEDIDUM_URL = 'https://medium.com/@lobehub';
export const STATUS_URL = 'https://status.lobehub.com';
59 changes: 59 additions & 0 deletions src/features/Footer/Brand.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Logo } from '@lobehub/ui';
import { createStyles, useThemeMode } from 'antd-style';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
import urlJoin from 'url-join';

import { OFFICIAL_SITE, STATUS_URL } from '@/const/url';

import Follow from './Follow';

export const COPYRIGHT = `© 2023-${new Date().getFullYear()} LobeHub, LLC`;

const useStyles = createStyles(({ css, token }) => {
return {
container: css`
font-size: 14px;
`,
description: css`
color: ${token.colorTextDescription};
`,
logo: css`
display: flex;
flex: none;
align-items: center;
color: inherit !important;
`,
status: css`
color-scheme: none;
background: transparent;
border: none !important;
`,
};
});

const Brand = memo(() => {
const { styles } = useStyles();
const { isDarkMode } = useThemeMode();

return (
<Flexbox className={styles.container} gap={16}>
<a className={styles.logo} href={OFFICIAL_SITE}>
<Logo type={'combine'} />
</a>
<div>Empowering your AI dreams</div>
<div className={styles.description}>{COPYRIGHT}</div>
<Follow />
<iframe
className={styles.status}
height="30"
loading={'lazy'}
scrolling="no"
src={urlJoin(STATUS_URL, `badge?theme=${isDarkMode ? 'dark' : 'light'}`)}
width="250"
/>
</Flexbox>
);
});

export default Brand;
59 changes: 59 additions & 0 deletions src/features/Footer/Follow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { SiDiscord, SiGithub, SiMedium, SiX } from '@icons-pack/react-simple-icons';
import { ActionIcon } from '@lobehub/ui';
import { createStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

import { DISCORD_URL, GITHUB_REPO_URL, MEDIDUM_URL, X } from '@/const/url';

const useStyles = createStyles(({ css, token }) => {
return {
icon: css`
svg {
fill: ${token.colorTextDescription};
}
&:hover {
svg {
fill: ${token.colorText};
}
}
`,
};
});

const Follow = memo(() => {
const { styles } = useStyles();
const { t } = useTranslation('common');
return (
<Flexbox gap={8} horizontal>
<a href={GITHUB_REPO_URL} rel="noreferrer" target={'_blank'}>
<ActionIcon
className={styles.icon}
icon={SiGithub as any}
title={t('follow', { name: 'GitHub' })}
/>
</a>
<a href={X} rel="noreferrer" target={'_blank'}>
<ActionIcon className={styles.icon} icon={SiX as any} title={t('follow', { name: 'X' })} />
</a>
<a href={DISCORD_URL} rel="noreferrer" target={'_blank'}>
<ActionIcon
className={styles.icon}
icon={SiDiscord as any}
title={t('follow', { name: 'Discord' })}
/>
</a>
<a href={MEDIDUM_URL} rel="noreferrer" target={'_blank'}>
<ActionIcon
className={styles.icon}
icon={SiMedium as any}
title={t('follow', { name: 'Medium' })}
/>
</a>
</Flexbox>
);
});

export default Follow;
27 changes: 12 additions & 15 deletions src/features/Footer/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ export const Resources = [
];

export const Community = [
{
icon: <Icon icon={Github} size="small" />,
openExternal: true,
title: 'GitHub',
url: GITHUB_REPO_URL,
},
{
icon: <Icon icon={FileClock} size="small" />,
openExternal: true,
title: 'Changelog',
url: `${GITHUB_REPO_URL}/blob/main/CHANGELOG.md`,
},
{
icon: <Icon icon={Heart} size="small" />,
openExternal: true,
Expand All @@ -57,21 +69,6 @@ export const Community = [
},
];

export const Help = [
{
icon: <Icon icon={Github} size="small" />,
openExternal: true,
title: 'GitHub',
url: GITHUB_REPO_URL,
},
{
icon: <Icon icon={FileClock} size="small" />,
openExternal: true,
title: 'Changelog',
url: `${GITHUB_REPO_URL}/blob/main/CHANGELOG.md`,
},
];

export const MoreProducts = [
{
description: 'Stable Diffusion Extension',
Expand Down
11 changes: 6 additions & 5 deletions src/features/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { useInject } from '@/hooks/useInject';
import { selectors, useAppStore } from '@/store';
import { type DivProps } from '@/types';

import { Community, Help, MoreProducts, Resources } from './data';
import Brand from './Brand';
import { Community, MoreProducts, Resources } from './data';
import { useStyles } from './style';

const Footer = memo<DivProps>(({ className, ...props }) => {
Expand Down Expand Up @@ -37,6 +38,9 @@ const Footer = memo<DivProps>(({ className, ...props }) => {
setting.layoutHideFooter ?
[] :
[
{
title: <Brand />,
},
{
items: Resources,
title: t('footer.resources'),
Expand All @@ -45,16 +49,13 @@ const Footer = memo<DivProps>(({ className, ...props }) => {
items: Community,
title: t('footer.community'),
},
{
items: Help,
title: t('footer.help'),
},
{
items: MoreProducts,
title: t('footer.moreProducts'),
},
]
}
contentMaxWidth={1280}
/>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/features/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from 'antd-style';
import { memo } from 'react';

import { Logo } from '@/components';
import { GITHUB_REPO_URL } from '@/const/url';
import { OFFICIAL_SITE } from '@/const/url';
import { useAppStore } from '@/store';
import { type DivProps } from '@/types';

Expand All @@ -23,7 +23,7 @@ const Header = memo<DivProps>(({ children }) => {
actionsStyle={{ flex: 0 }}
logo={
<a
href={`${GITHUB_REPO_URL}/releases`}
href={OFFICIAL_SITE}
rel="noreferrer"
style={{ alignItems: 'center', color: theme.colorText, display: 'flex' }}
target="_blank"
Expand Down
2 changes: 1 addition & 1 deletion src/features/Setting/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Sidebar = memo<SidebarProps>(({ tab, setTab }) => {
return (
<SidebarLayout
desc={
<Flexbox align={'center'} gap={4} horizontal>
<Flexbox align={'center'} gap={8} horizontal wrap={'wrap'}>
{t('modal.themeSetting.desc')}
<VersionTag />
</Flexbox>
Expand Down

0 comments on commit 8fd035c

Please sign in to comment.