Skip to content

Commit d2e8785

Browse files
committed
update @pingcap-inc/tidb-community-site-components: apply @rollup/plugin-image to rollup.config.js
1 parent 7152559 commit d2e8785

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/site-components/env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ declare module "*.svg" {
33
const Icon: FC
44
export default Icon
55
}
6+
7+
declare module '*.png' {
8+
const value: any;
9+
export default value;
10+
}

packages/site-components/rollup.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from 'rollup'
33
import postcss from 'rollup-plugin-postcss'
44
import ts from 'rollup-plugin-ts'
55
import svgr from '@svgr/rollup'
6+
import image from '@rollup/plugin-image'
67
import { peerDependencies } from './package.json'
78
import { antd } from 'buildtool/plugins/rollup/antd'
89

@@ -17,6 +18,7 @@ export default defineConfig({
1718
},
1819
plugins: [
1920
svgr(),
21+
image(),
2022
postcss({
2123
to: 'index.css',
2224
extract: true,

packages/site-components/src/components/asktug/home/Sidebar/SidebarRanking.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, {useEffect, useState} from "react"
22
import axios from "axios";
33

44
import './SidebarRanking.less'
5-
//import icon from './ranking-icon.png'
65
import SidebarCard from "./SidebarCard";
76
import SiteLink from "../../../site-link";
87
import {Site} from "../../../../utils/site";
@@ -28,7 +27,6 @@ export interface ITop {
2827
const getData = async (): Promise<ITop> => {
2928
const url = 'http://localhost:3300/api/points/top'
3029
const response = await axios.get<ITop>(url)
31-
console.log('response.data', response.data)
3230
return response.data
3331
}
3432

@@ -41,7 +39,7 @@ const SidebarRanking: React.FC<IProps> = (props) => {
4139
}, [])
4240
return (
4341
<div className={'asktug-sidebar-ranking'}>
44-
<SidebarCard header={{start: '本周达人', end: (<SiteLink site={Site.asktug} newWindow url={'/x/ranking'}>更多 {'>'}</SiteLink>)}}>
42+
<SidebarCard header={{start: (<>本周达人 </>), end: (<SiteLink site={Site.asktug} newWindow url={'/x/ranking'}>更多 {'>'}</SiteLink>)}}>
4543
<table>
4644
<thead>
4745
<tr>

0 commit comments

Comments
 (0)