Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zolplay-cn/website
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: zolplay-cn/website
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 10,303 additions and 4,714 deletions.
  1. +4 −1 .env.example
  2. +10 −0 .eslintrc.js
  3. +0 −10 .eslintrc.json
  4. +1 −1 .github/workflows/ci.yml
  5. +4 −1 .github/workflows/prettier.yml
  6. +2 −0 .gitignore
  7. +14 −2 .vscode/settings.json
  8. +5 −1 README.md
  9. +0 −6 app/Analytics.tsx
  10. +2 −25 app/Footer.tsx
  11. +2 −3 app/IntlProvider.tsx
  12. +15 −19 app/LocaleSelector.tsx
  13. +35 −0 app/PostHogProvider.tsx
  14. +1 −1 app/Rulers.tsx
  15. +44 −27 app/Sidebar.tsx
  16. +5 −3 app/ThemeSelector.tsx
  17. +0 −1 app/Toasts.tsx
  18. +17 −0 app/[locale]/[...slug]/CustomPage.tsx
  19. +62 −0 app/[locale]/[...slug]/page.tsx
  20. +1 −2 app/[locale]/about/page.tsx
  21. +60 −467 app/[locale]/careers/Careers.tsx
  22. +19 −14 app/[locale]/careers/[id]/page.tsx
  23. BIN app/[locale]/careers/no-meetings.png
  24. +4 −6 app/[locale]/careers/page.tsx
  25. +3 −9 app/[locale]/contact/Contact.tsx
  26. +1 −2 app/[locale]/contact/page.tsx
  27. +57 −33 app/[locale]/layout.tsx
  28. +7 −0 app/[locale]/not-found.tsx
  29. +3 −0 app/[locale]/og/page.tsx
  30. +61 −0 app/[locale]/og/uwu/page.tsx
  31. +9 −4 app/[locale]/page.tsx
  32. +4 −5 app/[locale]/portfolios/PortfolioCard.tsx
  33. +1 −2 app/[locale]/portfolios/Portfolios.tsx
  34. +4 −5 app/[locale]/portfolios/[slug]/PortfolioPage.tsx
  35. +2 −3 app/[locale]/portfolios/[slug]/page.tsx
  36. +1 −2 app/[locale]/portfolios/page.tsx
  37. BIN app/[locale]/zolplay-logo-uwu.png
  38. +2 −2 app/api/contact/route.ts
  39. +16 −6 app/globals.css
  40. +2 −0 components/Benefits.tsx
  41. +2 −3 components/ImageBlock.tsx
  42. +27 −55 components/Logo.tsx
  43. +3 −2 components/OurTools.tsx
  44. +18 −0 components/icons/BrandXIcon.tsx
  45. +32 −0 components/icons/ShopIcon.tsx
  46. +17 −0 components/icons/XiaohongshuIcon.tsx
  47. +30 −13 components/members/OurMembers.tsx
  48. +1 −2 components/ui/Clock.tsx
  49. +2 −3 components/ui/Form.tsx
  50. +2 −3 components/ui/RichText.tsx
  51. +3 −3 components/ui/Select.tsx
  52. +5 −0 hooks/useUWU.ts
  53. +49 −0 lib/ashbyhq.queries.ts
  54. +0 −1 lib/sanity.client.ts
  55. +35 −3 lib/sanity.queries.ts
  56. +84 −18 messages/en.json
  57. +86 −20 messages/zh-CN.json
  58. +5 −26 middleware.ts
  59. +55 −0 modules/careers/formItem/email.tsx
  60. +66 −0 modules/careers/formItem/input.tsx
  61. +50 −0 modules/careers/formItem/longText.tsx
  62. +102 −0 modules/careers/formItem/resume.tsx
  63. +347 −0 modules/careers/job.tsx
  64. +20 −10 next.config.mjs
  65. +36 −29 package.json
  66. +87 −97 pages/api/careers.ts
  67. +1 −2 pages/api/og.tsx
  68. +18 −18 pages/api/revalidate.ts
  69. +1 −1 pages/studio/[[...index]].tsx
  70. +1 −1 plugins/previewPane/index.tsx
  71. +8,552 −3,681 pnpm-lock.yaml
  72. +4 −7 prettier.config.js
  73. +1 −0 public/29f57913ffd7e20819ae33051df453aa.txt
  74. BIN public/assets/android-chrome-192x192.png
  75. BIN public/assets/android-chrome-512x512.png
  76. BIN public/assets/apple-touch-icon.png
  77. BIN public/assets/favicon-16x16.png
  78. BIN public/assets/favicon-32x32.png
  79. BIN public/assets/favicon-v2.ico
  80. BIN public/assets/favicon.ico
  81. +17 −17 public/assets/site.webmanifest
  82. BIN public/favicon.ico
  83. +4 −5 sanity.config.ts
  84. +28 −0 schemas/documents/career.ts
  85. +11 −3 schemas/documents/job.ts
  86. +2 −3 schemas/documents/member.ts
  87. +11 −1 schemas/documents/page.ts
  88. +1 −2 schemas/documents/portfolio.ts
  89. +1 −2 schemas/documents/squad.ts
  90. +1 −2 schemas/objects/localeString.ts
  91. +1 −1 tailwind.config.js
  92. +4 −17 tsconfig.json
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -21,4 +21,7 @@ SANITY_REQUIRE_PREVIEW_SECRET=
NEXT_PUBLIC_UPLOAD_API_KEY=
CAREERS_WEBHOOK_URL=
CONTACT_WEBHOOK_URL=
NEXT_PUBLIC_OG_URL_PREFIX=
NEXT_PUBLIC_OG_URL=

NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @ts-check
const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
extends: '@zolplay',
rules: {
'react-hooks/exhaustive-deps': 'error',
'no-console': 'off',
},
})
10 changes: 0 additions & 10 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
5 changes: 4 additions & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -20,11 +20,14 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -35,3 +35,5 @@ yarn-error.log*

*.code-workspace
tsconfig.tsbuildinfo
.vercel
.env*.local
16 changes: 14 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"typescript.tsdk": "node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.enable": true,
"eslint.validate": ["javascript", "typescript", "typescriptreact"],
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"githubPullRequests.ignoredPullRequestBranches": ["dev"],
"i18n-ally.localesPaths": ["messages"]
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Zolplay Official Website

## Introduction

This repo contains the code for the official website of Zolplay.

- [English (zolplay.com)](https://zolplay.com)
- [简体中文 (zolplay.cn)](https://zolplay.cn)
- [简体中文 (zolplay.com/zh-CN)](https://zolplay.com/zh-CN)

## Tech Stack

- [Next.js 13 (app router)](https://nextjs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)
@@ -14,6 +17,7 @@ This repo contains the code for the official website of Zolplay.
- [pnpm](https://pnpm.io/)

## Set up local environment

```bash
pnpm i
pnpm dev
6 changes: 0 additions & 6 deletions app/Analytics.tsx

This file was deleted.

27 changes: 2 additions & 25 deletions app/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
'use client'

import { clsxm } from '@zolplay/utils'
import Link from 'next/link'
import { useLocale, useTranslations } from 'next-intl'
import { TbArrowUpRight } from 'react-icons/tb'

import { i18n } from '~/i18n'
import { useTranslations } from 'next-intl'

export function Footer() {
const locale = useLocale()
const t = useTranslations('Copyright')

return (
@@ -19,29 +14,11 @@ export function Footer() {
>
<div className="h-px w-1/2 rounded-xl bg-gradient-to-r from-stone-50 to-stone-200 dark:from-stone-900 dark:to-stone-700" />

<p className="mt-4 mb-1 text-sm dark:text-stone-400">
<p className="mb-1 mt-4 text-sm dark:text-stone-400">
{t('Text', {
year: new Date().getFullYear(),
})}
</p>
{locale === i18n.defaultLocale && <ICPLicense />}
</footer>
)
}

function ICPLicense() {
return (
<p className="text-sm text-stone-500">
<Link
href="https://beian.miit.gov.cn/#/Integrated/index"
target="_blank"
rel="noopener noreferrer"
className="text-xs tracking-wide hover:underline"
title="Fuckin' ICP"
>
粤ICP备2021175747号-1
<TbArrowUpRight className="ml-0.5 inline-block h-3 w-3" />
</Link>
</p>
)
}
5 changes: 2 additions & 3 deletions app/IntlProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client'

import { AbstractIntlMessages } from 'next-intl'
import { DefaultRichTextComponents } from '~/components/ui/RichText'
import type { AbstractIntlMessages } from 'next-intl'
import { NextIntlClientProvider } from 'next-intl/client'
import React from 'react'

import { DefaultRichTextComponents } from '~/components/ui/RichText'

type Props = {
messages: AbstractIntlMessages
locale: string
34 changes: 15 additions & 19 deletions app/LocaleSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
'use client'

import { useRouter } from 'next/navigation'
import { useLocale } from 'next-intl'
import { Select } from '~/components/ui/Select'
import { useLocale, useTranslations } from 'next-intl'
import { usePathname } from 'next-intl/client'
import { useRouter } from 'next/navigation'
import React from 'react'

import { Select } from '~/components/ui/Select'

const languages = [
{
label: 'English',
value: 'en',
icon: () => <span>🇺🇸</span>,
url: 'https://zolplay.com',
url: '/',
},
{
label: '简体中文',
value: 'zh-CN',
icon: () => <span>🇨🇳</span>,
url: 'https://cn.zolplay.com',
url: '/zh-CN',
},
]
export function LocaleSelector() {
@@ -28,34 +25,33 @@ export function LocaleSelector() {
const pathname = usePathname()
const onChange = React.useCallback(
(locale: string) => {
if (process.env.NODE_ENV === 'development') {
router.push(`/${locale}${pathname}`)
} else {
const domain =
languages.find((lang) => lang.value === locale)?.url || ''
router.push(`${domain}/${pathname}`)
}
router.push(`${locale}${pathname}`)
},
[router, pathname]
)

React.useEffect(() => setMounted(true), [])

const t = useTranslations('Languages')

if (!mounted) {
return null
}

return (
<Select.Root value={locale} onValueChange={onChange}>
<Select.Trigger className="flex w-fit justify-start space-x-1 border-none font-bold text-stone-400 transition-colors hover:text-stone-600 dark:text-stone-500 dark:hover:text-stone-200 md:w-40">
<Select.Value placeholder="Select a language" />
<Select.Trigger
className="flex w-fit justify-start space-x-1 border-none font-bold text-stone-400 transition-colors hover:text-stone-600 dark:text-stone-500 dark:hover:text-stone-200 md:w-40"
aria-label={t('Placeholder')}
>
<Select.Value placeholder={t('Placeholder')} />
</Select.Trigger>
<Select.Content className="relative z-50" position="popper">
{languages.map(({ label, value, icon: Icon }) => (
{languages.map(({ value, icon: Icon }) => (
<Select.Item key={value} value={value}>
<span className="inline-flex select-none items-center space-x-2 font-bold">
<Icon />
<span>{label}</span>
<span>{t(value as any)}</span>
</span>
</Select.Item>
))}
35 changes: 35 additions & 0 deletions app/PostHogProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use client'

import { usePathname, useSearchParams } from 'next/navigation'
import posthog from 'posthog-js'
import { PostHogProvider } from 'posthog-js/react'
import { useEffect } from 'react'

if (typeof window !== 'undefined' && process.env.NEXT_PUBLIC_POSTHOG_KEY) {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
capture_pageview: false, // Disable automatic pageview capture, as we capture manually
})
}

export function PostHogPageview() {
const pathname = usePathname()
const searchParams = useSearchParams()
// Track pageviews
useEffect(() => {
if (pathname) {
let url = window.origin + pathname
if (searchParams && searchParams.toString()) {
url = url + `?${searchParams.toString()}`
}
posthog.capture('$pageview', {
$current_url: url,
})
}
}, [pathname, searchParams])
return <></>
}

export function PHProvider({ children }: { children: React.ReactNode }) {
return <PostHogProvider client={posthog}>{children}</PostHogProvider>
}
2 changes: 1 addition & 1 deletion app/Rulers.tsx
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ export function Rulers() {
return (
<>
{/* Left line */}
<div className="fixed top-0 left-0 hidden h-screen w-px bg-gradient-to-b from-stone-200 dark:from-stone-700 md:block md:translate-x-[11rem] lg:left-1/2 lg:-translate-x-[287px]" />
<div className="fixed left-0 top-0 hidden h-screen w-px bg-gradient-to-b from-stone-200 dark:from-stone-700 md:block md:translate-x-[11rem] lg:left-1/2 lg:-translate-x-[287px]" />
{/* Right line */}
<div className="fixed bottom-0 right-1/2 hidden h-screen w-px translate-x-[462px] bg-gradient-to-t from-stone-200 opacity-70 dark:from-stone-700 lg:block" />
</>
Loading