Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(settings): lead the referral skeleton with the invite block (#23003)

YuTengjing923a9d0e9252
diff --git a/locales/en-US/subscription.json b/locales/en-US/subscription.json
index a63e07a2068..3e2073b1136 100644
--- a/locales/en-US/subscription.json
+++ b/locales/en-US/subscription.json
@@ -791,6 +791,7 @@
"referral.hero.title": "Invite friends, you both earn <0>${{reward}} in referral rewards</0>",
"referral.inviteCode.description": "Share your invite code so friends can register with it",
"referral.inviteCode.title": "Your invite code",
+ "referral.inviteLink.copy": "Copy invite link",
"referral.inviteLink.description": "Copy and share your invite link. You both earn referral rewards after your friend pays.",
"referral.inviteLink.title": "Your invite link",
"referral.rules.antiAbuse": "Anti-abuse: Fraud, such as mass sign-ups with disposable emails, leads to a permanent ban on the accounts involved",
@@ -822,6 +823,7 @@
"referral.table.columns.inviterRewardAmount": "My reward",
"referral.table.columns.rewardedAt": "Reward time",
"referral.table.columns.status": "Status",
+ "referral.table.empty": "No one has signed up with your link yet",
"referral.table.status.pending_reward": "Pending reward",
"referral.table.status.registered": "Registered",
"referral.table.status.revoked": "Revoked",
diff --git a/locales/zh-CN/subscription.json b/locales/zh-CN/subscription.json
index ab38b2445e7..c8f83288c17 100644
--- a/locales/zh-CN/subscription.json
+++ b/locales/zh-CN/subscription.json
@@ -791,6 +791,7 @@
"referral.hero.title": "邀请好友,双方各得 <0>${{reward}} 返利额度</0>",
"referral.inviteCode.description": "分享你的邀请码,好友可凭它注册",
"referral.inviteCode.title": "你的邀请码",
+ "referral.inviteLink.copy": "复制邀请链接",
"referral.inviteLink.description": "复制并分享你的邀请链接,好友付费后双方各得奖励",
"referral.inviteLink.title": "你的邀请链接",
"referral.rules.antiAbuse": "反滥用:若存在作弊行为(如用临时邮箱批量注册),相关账号将被永久封禁",
@@ -822,6 +823,7 @@
"referral.table.columns.inviterRewardAmount": "我的奖励",
"referral.table.columns.rewardedAt": "奖励时间",
"referral.table.columns.status": "状态",
+ "referral.table.empty": "还没有人通过你的链接注册",
"referral.table.status.pending_reward": "待发放",
"referral.table.status.registered": "已注册",
"referral.table.status.revoked": "已撤销",
diff --git a/packages/locales/src/default/subscription.ts b/packages/locales/src/default/subscription.ts
index 95eb64914c2..e60c732da5e 100644
--- a/packages/locales/src/default/subscription.ts
+++ b/packages/locales/src/default/subscription.ts
@@ -851,6 +851,7 @@ export default {
'referral.hero.title': 'Invite friends, you both earn <0>${{reward}} in referral rewards</0>',
'referral.inviteCode.description': 'Share your invite code so friends can register with it',
'referral.inviteCode.title': 'Your invite code',
+ 'referral.inviteLink.copy': 'Copy invite link',
'referral.inviteLink.description':
'Copy and share your invite link. You both earn referral rewards after your friend pays.',
'referral.inviteLink.title': 'Your invite link',
@@ -890,6 +891,7 @@ export default {
'referral.table.columns.inviterRewardAmount': 'My reward',
'referral.table.columns.rewardedAt': 'Reward time',
'referral.table.columns.status': 'Status',
+ 'referral.table.empty': 'No one has signed up with your link yet',
'referral.table.status.pending_reward': 'Pending reward',
'referral.table.status.registered': 'Registered',
'referral.table.status.revoked': 'Revoked',
diff --git a/src/components/Skeleton/Settings/Sections.tsx b/src/components/Skeleton/Settings/Sections.tsx
index 72a5beeb1d5..954ed40c9b5 100644
--- a/src/components/Skeleton/Settings/Sections.tsx
+++ b/src/components/Skeleton/Settings/Sections.tsx
@@ -67,6 +67,11 @@ export type SettingsSectionSkeleton =
columns?: number;
/** Table rows below the header row. */
rows?: number;
+ /**
+ * A row of this many compact label + figure columns above the table,
+ * split from it by a divider.
+ */
+ stats?: number;
/** A filter / search bar above the table. */
toolbar?: boolean;
/** A tab strip above the table. */
@@ -135,7 +140,10 @@ export type SettingsSectionSkeleton =
variant: 'cards';
})
| {
- /** An outlined block with an avatar and two text lines. */
+ /**
+ * A filled lead block above the groups: a large title, a description, a
+ * full-width input with a trailing button, and a short line under it.
+ */
variant: 'banner';
};
@@ -162,9 +170,7 @@ export type SettingsSectionsFrame = 'container' | 'header' | 'none';
const styles = stylex.create({
banner: {
- borderWidth: '1px',
- borderStyle: 'solid',
- borderColor: cssVar.colorBorderSecondary,
+ backgroundColor: cssVar.colorFillQuaternary,
borderRadius: cssVar.borderRadiusLG,
},
card: {
@@ -633,17 +639,19 @@ const Section = ({ section }: { section: SettingsSectionSkeleton }) => {
switch (section.variant) {
case 'banner': {
return (
- <Flexbox
- horizontal
- align={'center'}
- className={stylex.props(styles.banner).className}
- gap={16}
- padding={18}
- >
- <SkeletonBar height={48} radius={'50%'} width={48} />
- <Flexbox gap={10}>
- <SkeletonBar height={18} width={240} />
- <SkeletonBar height={12} width={360} />
+ <Flexbox className={stylex.props(styles.banner).className} gap={20} padding={24}>
+ <Flexbox gap={16}>
+ <SkeletonBar height={24} width={320} />
+ <SkeletonBar height={14} width={440} />
+ </Flexbox>
+ <Flexbox gap={12}>
+ <Flexbox horizontal align={'center'} gap={8}>
+ <Flexbox flex={1}>
+ <SkeletonBar height={40} />
+ </Flexbox>
+ <SkeletonBar height={40} width={136} />
+ </Flexbox>
+ <SkeletonBar height={22} width={176} />
</Flexbox>
</Flexbox>
);
@@ -727,6 +735,14 @@ const Section = ({ section }: { section: SettingsSectionSkeleton }) => {
case 'table': {
return (
<Group {...section} flush>
+ {section.stats && (
+ <>
+ <Flexbox padding={16}>
+ <InsetTiles columns={section.stats} tileHeight={50} tiles={section.stats} />
+ </Flexbox>
+ <div {...stylex.props(styles.divider)} />
+ </>
+ )}
<TableBody
columns={section.columns}
rows={section.rows ?? 3}
diff --git a/src/components/Skeleton/Settings/sectionShapes.ts b/src/components/Skeleton/Settings/sectionShapes.ts
index 3d9bdaa038f..513014c6d50 100644
--- a/src/components/Skeleton/Settings/sectionShapes.ts
+++ b/src/components/Skeleton/Settings/sectionShapes.ts
@@ -77,28 +77,12 @@ export const SETTINGS_SECTION_SHAPES: Record<string, SettingsSectionsShape> = {
sections: [
{ variant: 'banner' },
{
- descKey: ['subscription', 'referral.inviteLink.description'],
- field: 'snippet',
- heading: ['subscription', 'referral.inviteLink.title'],
- variant: 'form',
- },
- {
- descKey: ['subscription', 'referral.inviteCode.description'],
- extra: { height: 24, width: 24 },
- field: 'snippet',
- heading: ['subscription', 'referral.inviteCode.title'],
- variant: 'form',
- },
- {
- columns: 4,
- descKey: ['subscription', 'referral.stats.description'],
+ columns: 5,
heading: ['subscription', 'referral.stats.title'],
- inset: true,
- tileHeight: 61,
- tiles: 4,
- variant: 'tiles',
+ rows: 1,
+ stats: 4,
+ variant: 'table',
},
- { columns: 5, heading: ['subscription', 'referral.table.title'], rows: 1, variant: 'table' },
{
descKey: ['subscription', 'referral.rules.description'],
heading: ['subscription', 'referral.rules.title'],