Skip to content

Commit

Permalink
docs: add footer local
Browse files Browse the repository at this point in the history
  • Loading branch information
97vack authored May 20, 2024
1 parent 5eb95d5 commit d59213b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .dumi/theme/slots/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IconFont } from '@components/IconFont';
import { Box, Popover } from '@mui/material';
import { Popover } from '@mui/material';
import { useSiteData } from 'dumi';
import React, { useImperativeHandle, useRef, useState, type FC } from 'react';
import { useLocalFormat } from 'useLocalFormat';
Expand Down Expand Up @@ -53,22 +53,24 @@ const Footer: FC = () => {
const { themeConfig } = useSiteData();
const modalRef = useRef();

const { format } = useLocalFormat();

const { resource, friendLink, author, group } = {
resource: [
{
label: 'Github',
href: 'https://github.com/easy-form/react-form-simple',
},
{
label: '使用案例',
label: format({ id: 'hero.footer.useCase' }),
href: 'https://github.com/easy-form/react-form-simple?tab=readme-ov-file#-demo',
},
{
label: 'react表单受控的实现方案',
label: format({ id: 'hero.footer.plan' }),
href: 'https://juejin.cn/post/7309692103055867939',
},
{
label: '协议',
label: format({ id: 'hero.footer.license' }),
href: 'https://github.com/easy-form/react-form-simple/blob/main/LICENSE',
},
],
Expand All @@ -79,7 +81,7 @@ const Footer: FC = () => {
],
group: [
{
label: '微信',
label: format({ id: 'hero.footer.wxin' }),
icon: 'weixin',
size: 20,
href: 'https://github.com/easy-form/react-form-simple/tree/main?tab=readme-ov-file#join-wechat-group',
Expand All @@ -89,14 +91,13 @@ const Footer: FC = () => {

if (!themeConfig.footer) return null;

const { format } = useLocalFormat();
const year = new Date().getFullYear();
return (
<>
<div className="dumi-default-footer">
<div className="dumi-default-footer-content">
<div>
<Title>相关资源</Title>
<Title>{format({ id: 'hero.footer.source' })}</Title>
<div style={{ marginTop: '20px' }}>
{resource.map((v) => (
<div style={{ marginBottom: '10px' }} key={v.href}>
Expand All @@ -114,7 +115,7 @@ const Footer: FC = () => {
</div>
</div>
<div>
<Title>友情推荐</Title>
<Title>{format({ id: 'hero.footer.friendshipLink' })}</Title>
<div style={{ marginTop: '20px' }}>
{friendLink.map((v) => (
<div style={{ marginBottom: '10px' }} key={v.href}>
Expand All @@ -131,7 +132,7 @@ const Footer: FC = () => {
))}
</div>
</div>
<div>
{/* <div>
<Title>关于作者</Title>
<div style={{ marginTop: '20px' }}>
{author.map((v) => (
Expand All @@ -152,8 +153,8 @@ const Footer: FC = () => {
</div>
))}
</div>
</div>
<div>
</div> */}
{/* <div>
<Title>社群</Title>
<div style={{ marginTop: '20px' }}>
{group.map((v) => {
Expand Down Expand Up @@ -219,7 +220,7 @@ const Footer: FC = () => {
</Box>
</div>
</div>
</div>
</div> */}
</div>
<div
style={{
Expand Down

0 comments on commit d59213b

Please sign in to comment.