Skip to content

Commit ee3b92e

Browse files
update sponsors
1 parent b612158 commit ee3b92e

10 files changed

Lines changed: 46 additions & 6 deletions

File tree

app/[locale]/components/Navbar/Nav.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client'
2+
13
import { RiMenuFill } from 'react-icons/ri'
24
import styles from './Nav.module.css'
35
import Link from 'next/link'
@@ -44,4 +46,4 @@ const Nav = ({ locale, pathname }: { locale: string, pathname: string }) => {
4446
)
4547
}
4648

47-
export default Nav
49+
export default Nav

app/[locale]/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Noto_Sans_SC } from 'next/font/google'
22
import { NextIntlClientProvider } from 'next-intl'
3+
import { unstable_setRequestLocale } from 'next-intl/server'
34
import { notFound } from 'next/navigation'
45
import { i18n } from '../../i18n'
56
import Footer from './components/Footer/Footer'
@@ -17,6 +18,7 @@ export function generateStaticParams() {
1718

1819
export default async function LangLayout({ children, params: { locale } }
1920
: { children: React.ReactNode, params: { locale: string } }) {
21+
unstable_setRequestLocale(locale)
2022

2123
let locales
2224
try {

components/PersonsCard/PersonsCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const PersonsCard = ({ persons, title, avatar }: { persons: Person[], title?: st
3333
height={avatarSize}
3434
title={person.name}
3535
alt={person.name}
36-
className={'rounded-full drop-shadow-sm '}
36+
className={`${person.rounded === false ? '' : 'rounded-full '}drop-shadow-sm`}
3737
/>
3838
</Link>
3939
</div>
@@ -43,4 +43,4 @@ const PersonsCard = ({ persons, title, avatar }: { persons: Person[], title?: st
4343
)
4444
}
4545

46-
export default PersonsCard
46+
export default PersonsCard

data/sponsors.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import {Sponsors} from '@/types'
33
export const sponsors: Sponsors = {
44
special: null,
55
platinum: [
6+
{
7+
name: 'Mulerun',
8+
avatarUrl: '/images/sponsors/mulerun.svg',
9+
url: 'https://mulerun.com/?utm_source=openwebgal&utm_medium=referral&utm_campaign=openwebgal',
10+
rounded: false,
11+
},
612
{
713
name: 'AnyMate',
814
avatarUrl: '/images/sponsors/any-mate.png',

hooks/useRedirect.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client'
2+
13
import { useLocale } from 'next-intl'
24

35
const useRedirect = () => {

i18n-request.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { getRequestConfig } from 'next-intl/server'
2+
import { i18n } from './i18n'
3+
4+
export default getRequestConfig(async ({ locale }) => {
5+
const resolvedLocale = i18n.locales.some((item) => item.code === locale)
6+
? locale
7+
: i18n.defaultLocale
8+
9+
return {
10+
messages: (await import(`./locales/${resolvedLocale}.json`)).default,
11+
}
12+
})

i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export const i18n = {
55
{ lang: '日本语', code: 'ja' }
66
],
77
defaultLocale: 'en',
8-
}
8+
}

next.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const withNextIntl = require('next-intl/plugin')('./i18n-request.ts')
2+
13
/** @type {import('next').NextConfig} */
24
const nextConfig = {
35
// 静态导出
@@ -11,4 +13,4 @@ const nextConfig = {
1113
},
1214
}
1315

14-
module.exports = nextConfig
16+
module.exports = withNextIntl(nextConfig)

public/images/sponsors/mulerun.svg

Lines changed: 13 additions & 0 deletions
Loading

types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type Person = {
2424
name: string,
2525
avatarUrl: string,
2626
url: string,
27+
rounded?: boolean,
2728
}
2829

2930
export type Sponsors = {
@@ -52,4 +53,4 @@ export type Post = {
5253
export type PostListItem = {
5354
slug: string,
5455
data: PostData,
55-
}
56+
}

0 commit comments

Comments
 (0)