Skip to content

Commit

Permalink
🐛 fix(billing): I18n and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
web-ppanel committed Nov 27, 2024
1 parent e85e545 commit 81e0f21
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
14 changes: 5 additions & 9 deletions apps/admin/components/billing.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Avatar, AvatarFallback, AvatarImage } from '@shadcn/ui/avatar';
import { Card, CardDescription, CardHeader, CardTitle } from '@shadcn/ui/card';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@shadcn/ui/tooltip';
import { getLocale } from 'next-intl/server';
import { getTranslations } from 'next-intl/server';
import Image from 'next/legacy/image';
import Link from 'next/link';

Expand All @@ -21,7 +21,7 @@ interface ItemType {
}

export default async function Billing({ type }: BillingProps) {
const locale = await getLocale();
const t = await getTranslations('common.billing');
let list: ItemType[] = [];
try {
const response = await fetch(BASE_URL, { cache: 'no-store' });
Expand All @@ -39,14 +39,10 @@ export default async function Billing({ type }: BillingProps) {
return (
<TooltipProvider>
<h1 className='text mt-2 font-bold'>
<span>{locale === 'en-US' ? 'Advertisement' : '广告合作'}</span>
<span className='text-muted-foreground ml-2 text-xs'>
{locale === 'en-US'
? 'Ad revenue helps PPanel continue to release updates'
: '广告收入有助于 PPanel 继续发布更新'}
</span>
<span>{t('title')}</span>
<span className='text-muted-foreground ml-2 text-xs'>{t('description')}</span>
</h1>
<div className='grid grid-cols-1 gap-3 md:grid-cols-3 lg:grid-cols-5'>
<div className='grid gap-3 md:grid-cols-3 lg:grid-cols-6'>
{list.map((item, index) => (
<Tooltip key={index}>
<TooltipTrigger asChild>
Expand Down
1 change: 1 addition & 0 deletions apps/admin/components/dashboard/statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default function Statistics() {
const currentData = trafficData[dataType][timeFrame];
return (
<>
<h1 className='text-lg font-semibold'>统计</h1>
<div className='grid grid-cols-2 gap-3 md:grid-cols-4 lg:grid-cols-8'>
{[
{
Expand Down
4 changes: 4 additions & 0 deletions apps/admin/locales/en-US/common.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"billing": {
"title": "赞助商",
"description": "赞助有助于 PPanel 继续发布更新!"
},
"empty": [
"Imagine this place filled with exciting content! For now, you'll have to use your imagination...",
"This area mysteriously disappeared, but we're summoning it back!",
Expand Down
4 changes: 4 additions & 0 deletions apps/admin/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"billing": {
"title": "赞助商",
"description": "赞助有助于 PPanel 继续发布更新!"
},
"empty": [
"想象一下这里充满了精彩的内容!暂时只能靠想象了…",
"这片区域神秘消失了,我们正在召唤它回来!",
Expand Down

0 comments on commit 81e0f21

Please sign in to comment.