Skip to content

Commit

Permalink
feat: lang (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
noneAuth authored Mar 26, 2024
1 parent 7c0ca71 commit cfe64b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import cx from 'classnames';
import { useState } from 'react';
import { Helmet } from 'react-helmet';
import { useMedia } from 'react-use';
import { getLocale, isBrowser, useIntl } from 'umi';
import { isBrowser, useIntl, useLocation } from 'umi';
import React from 'react';

import stylesZh from './index.less';
Expand All @@ -37,10 +37,14 @@ import JoLPlayer from '@/components/Player';
import { LayoutTemplate } from '@/components/LayoutTemplate';
import { ApplyForm } from '@/components/ApplyForm';
import AnnouncementBanner from '@/components/AnnouncementBanner';
import { getSearch } from '@/util';

export default function IndexPage() {
const intl = useIntl();
const lang = getLocale();
const location = useLocation();
const { search } = location;
const lang = getSearch(search)?.lang || 'zh-CN';

const styles = lang === 'zh-CN' ? stylesZh : stylesEn;
const isWide = useMedia('(min-width: 767.99px)', true);
const [showApplyForm, setShowApplyForm] = useState(false);
Expand Down

0 comments on commit cfe64b5

Please sign in to comment.