Skip to content

fix: fix site error #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .dumi/pages/case/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import React from 'react';
import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO';
import SEO from '@antv/dumi-theme-antv/dist/common/SEO';
import ShowCase from 'site/components/ShowCase/ShowCase';
import { useIntl, useLocale } from 'dumi'
import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'
import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'
import { useIntl, useLocale } from 'dumi';
import { Header } from '@antv/dumi-theme-antv/dist/slots/Header';
import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer';

const CaseIndex: React.FC = () => {
const locale = useLocale()
const intl = useIntl()
const locale = useLocale();
const intl = useIntl();
return (
<>
<Header />
<SEO title={intl.formatMessage({
id: '场景案例'
}) } lang={locale.id} />
<SEO
title={intl.formatMessage({
id: '场景案例',
})}
lang={locale.id}
/>
<div className="home-container" style={{ marginTop: '-24px' }}>
<ShowCase />
</div>
Expand Down
24 changes: 13 additions & 11 deletions .dumi/pages/quick/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import React from 'react';
import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO';
import { useIntl, useLocale } from 'dumi'
import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'
import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'
import SEO from '@antv/dumi-theme-antv/dist/common/SEO';
import { useIntl, useLocale } from 'dumi';
import { Header } from '@antv/dumi-theme-antv/dist/slots/Header';
import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer';
import QuickIssue from 'site/components/quickIssue/QuickIssue';


const QuickIssueIndex: React.FC = () => {
const locale = useLocale()
const intl = useIntl()
const locale = useLocale();
const intl = useIntl();
return (
<>
<Header />
<SEO title={intl.formatMessage({
id: 'quickIssue'
}) } lang={locale.id} />
<SEO
title={intl.formatMessage({
id: 'quickIssue',
})}
lang={locale.id}
/>
<div className="home-container">
<QuickIssue/>
<QuickIssue />
</div>
<Footer />
</>
Expand Down
57 changes: 21 additions & 36 deletions .dumi/theme/slots/Detail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { debounce } from 'lodash';
import SEO from '@antv/dumi-theme-antv/dist/common/SEO';
import { useIntl, useLocale } from 'dumi';
import { debounce } from 'lodash';
import React, { useEffect, useRef } from 'react';
import Banner from 'site/components/Banner/Banner';
import { ComplexCharts } from 'site/components/ComplexCharts';
import { FamousPersons } from 'site/components/FamousPersons';
import { LinkCharts } from 'site/components/LinkCharts';
import { ThemeCharts } from 'site/components/ThemeCharts';
import { ProjectCard } from 'site/components/ProjectCard';
import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO';
import React, { useEffect, useState, useRef } from 'react';
import { FamousPersons } from 'site/components/FamousPersons';
import { ComplexCharts } from 'site/components/ComplexCharts';
interface NotificationProps {
index?: number;
type: string;
title: string;
date: string;
link: string;
}
import { ThemeCharts } from 'site/components/ThemeCharts';

export const Detail: React.FC = () => {
const locale = useLocale();
Expand All @@ -23,19 +16,9 @@ export const Detail: React.FC = () => {

const useT = (transformedMessage: string) => {
return intl.formatMessage({
id: transformedMessage
})
}
const notificationsUrl = `https://my-json-server.typicode.com/antvis/antvis-sites-data/notifications?lang=${locale.id}`;
const [remoteNews, setRemoteNews] = useState<NotificationProps[]>([]);
useEffect(() => {
fetch(notificationsUrl)
.then((res) => res.json())
.then((data) => {
// 根据设计,目前只取最新的两条
setRemoteNews(data.slice(0, 2));
});
}, [notificationsUrl]);
id: transformedMessage,
});
};

useEffect(() => {
const onResize = debounce(() => {
Expand All @@ -49,11 +32,17 @@ export const Detail: React.FC = () => {

return () => {
window.removeEventListener('resize', onResize);
}
};
}, []);

return (
<div className="home-container" style={{ backgroundImage: 'linear-gradient(180deg, #F0E5FF 0%, #FFFFFF 13%, #FFFFFF 92%, #F7F8FD 100%)' }} >
<div
className="home-container"
style={{
backgroundImage:
'linear-gradient(180deg, #F0E5FF 0%, #FFFFFF 13%, #FFFFFF 92%, #F7F8FD 100%)',
}}
>
<SEO
title={useT('AntV')}
titleSuffix={useT('蚂蚁数据可视化')}
Expand All @@ -62,12 +51,9 @@ export const Detail: React.FC = () => {
)}
lang={locale.id}
/>
<div
style={{ overflowX: 'auto' }}
ref={ref}
>
<div style={{ overflowX: 'auto' }} ref={ref}>
<div style={{ minWidth: '1280px', scrollSnapAlign: 'center' }}>
<Banner remoteNews={remoteNews} />
<Banner />
<ThemeCharts />
<ComplexCharts />
<LinkCharts />
Expand All @@ -76,6 +62,5 @@ export const Detail: React.FC = () => {
</div>
</div>
</div>
)
}

);
};
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: build

on:
push:

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Type Check
run: npm run type-check

- name: Build
run: npm run build
30 changes: 0 additions & 30 deletions .github/workflows/mirror.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AntV New Site 📈

New AntV site built on [@antv/gatsby-theme-antv](https://github.com/antvis/gatsby-theme-antv).
New AntV site built on [@antv/dumi-theme-antv](https://github.com/antvis/dumi-theme-antv).

![CI status](https://github.com/antvis/antvis.github.io/workflows/Node%20CI/badge.svg) [![Dependency Status](https://david-dm.org/antvis/antvis.github.io.svg?style=flat-square)](https://david-dm.org/antvis/antvis.github.io) [![devDependencies Status](https://david-dm.org/antvis/antvis.github.io/dev-status.svg)](https://david-dm.org/antvis/antvis.github.io?type=dev) ![prettier code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)
![prettier code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)

## Install & Preview

Expand Down
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
"url": "https://github.com/antvis/antvis.github.io/issues"
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@ant-design/icons": "^4.8.3",
"@antv/dumi-theme-antv": "^0.5.2",
"@antv/g2plot": "^2.3.1",
"@antv/g6": "3.3.7",
"@antv/knowledge": "^0.1.3-alpha.17",
"@antv/matrix-util": "2.0.7",
"@antv/util": "^3.3.1",
"antd": "5.10.2",
"chroma-js": "^2.1.0",
Expand All @@ -36,21 +34,18 @@
"new-github-issue-url": "^1.0.0",
"prettier": "^2.0.0",
"pretty-quick": "^3.1.3",
"react": "^18.2.0",
"react-github-btn": "^1.4.0",
"react-use": "^17.4.0"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-github-btn": "^1.4.0"
},
"devDependencies": {
"@types/classnames": "^2.2.9",
"@types/d3": "^7.4.2",
"@types/lodash": "^4.14.189",
"@types/parse-github-url": "^1.0.0",
"@types/react": "^16.9.5",
"@types/react-dom": "^16.9.1",
"@types/react-github-button": "^0.1.0",
"@types/react-helmet": "^6.0.0",
"i": "^0.3.7",
"npm": "^9.1.2"
"@types/react-helmet": "^6.0.0"
},
"license": "MIT",
"scripts": {
Expand All @@ -63,7 +58,8 @@
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,less}\"",
"pretty-quick": "pretty-quick",
"tsc": "tsc",
"serve": "dumi preview"
"serve": "dumi preview",
"type-check": "tsc --noEmit"
},
"husky": {
"hooks": {
Expand Down
Loading
Loading