From c2fb6adfd89917855678195c3dc7cf4b9ed65cc2 Mon Sep 17 00:00:00 2001 From: Cats Juice Date: Wed, 22 Oct 2025 00:29:06 +0800 Subject: [PATCH] feat(mobile): add discord link in setting (#13789) ## Summary by CodeRabbit * **New Features** * Added a new Discord community link in the mobile settings Others section with an animated "Hot" badge * **Localization** * Added multilingual support for the new Discord link across all supported languages --- .../dialogs/setting/others/index.css.ts | 49 +++++++++++++++++++ .../mobile/dialogs/setting/others/index.tsx | 10 ++++ packages/frontend/i18n/src/i18n.gen.ts | 4 ++ packages/frontend/i18n/src/resources/en.json | 1 + 4 files changed, 64 insertions(+) create mode 100644 packages/frontend/core/src/mobile/dialogs/setting/others/index.css.ts diff --git a/packages/frontend/core/src/mobile/dialogs/setting/others/index.css.ts b/packages/frontend/core/src/mobile/dialogs/setting/others/index.css.ts new file mode 100644 index 000000000..c6443c808 --- /dev/null +++ b/packages/frontend/core/src/mobile/dialogs/setting/others/index.css.ts @@ -0,0 +1,49 @@ +import { cssVarV2 } from '@toeverything/theme/v2'; +import { keyframes, style } from '@vanilla-extract/css'; + +const shineAnimation = keyframes({ + '0%': { + backgroundPosition: 'calc(var(--shine-size) * -1) 0, 0 0', + }, + '100%': { + backgroundPosition: 'calc(100% + var(--shine-size)) 0, 0 0', + }, +}); +export const hotTag = style({ + background: cssVarV2('chip/tag/red'), + padding: '0px 8px', + borderRadius: 20, + lineHeight: '20px', + fontSize: 12, + fontWeight: 500, + color: 'white', + position: 'relative', + overflow: 'hidden', + + border: '0.5px solid red', + boxShadow: '0px 2px 3px rgba(0,0,0,0.1), 0px 0px 3px rgba(255,0,0, 0.5)', + + vars: { + '--shine-size': '100px', + '--shine-color': 'rgba(255,255,255,0.5)', + }, + + selectors: { + '&::after': { + content: "''", + position: 'absolute', + left: 0, + top: 0, + pointerEvents: 'none', + width: '100%', + height: '100%', + // animate a shine effect + animation: `${shineAnimation} 3.6s infinite`, + + backgroundImage: `linear-gradient(90deg, transparent 0%, var(--shine-color) 50%, transparent 100%)`, + backgroundRepeat: 'no-repeat, no-repeat', + backgroundSize: '100% 100%', + backgroundPosition: 'calc(var(--shine-size) * -1) 0, 0 0', + }, + }, +}); diff --git a/packages/frontend/core/src/mobile/dialogs/setting/others/index.tsx b/packages/frontend/core/src/mobile/dialogs/setting/others/index.tsx index 4f9eb2577..7a94ad5dd 100644 --- a/packages/frontend/core/src/mobile/dialogs/setting/others/index.tsx +++ b/packages/frontend/core/src/mobile/dialogs/setting/others/index.tsx @@ -3,12 +3,22 @@ import { useI18n } from '@affine/i18n'; import { SettingGroup } from '../group'; import { RowLayout } from '../row.layout'; import { DeleteAccount } from './delete-account'; +import { hotTag } from './index.css'; export const OthersGroup = () => { const t = useI18n(); return ( + + {t['com.affine.mobile.setting.others.discord']()} +
Hot
+ + } + href="https://discord.com/invite/whd5mjYqVw" + />