From 12c7ed6f6d4d5c718536e1407d5cc546a2e6c3db Mon Sep 17 00:00:00 2001
From: eiinu <44915689+eiinu@users.noreply.github.com>
Date: Mon, 13 Mar 2023 09:15:35 +0800
Subject: [PATCH] =?UTF-8?q?chore(backtop):=20icon=20=E7=BB=84=E4=BB=B6?=
=?UTF-8?q?=E6=9B=BF=E6=8D=A2=20(#774)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/packages/backtop/backtop.taro.tsx | 17 ++++-------------
src/packages/backtop/backtop.tsx | 25 ++++++++++---------------
src/packages/backtop/demo.taro.tsx | 7 ++++---
src/packages/backtop/demo.tsx | 6 +++---
src/packages/backtop/doc.en-US.md | 5 +++--
src/packages/backtop/doc.md | 5 +++--
src/packages/backtop/doc.taro.md | 13 +++++++------
src/packages/backtop/doc.zh-TW.md | 6 +++---
8 files changed, 37 insertions(+), 47 deletions(-)
diff --git a/src/packages/backtop/backtop.taro.tsx b/src/packages/backtop/backtop.taro.tsx
index 2aa67fe..50faa96 100644
--- a/src/packages/backtop/backtop.taro.tsx
+++ b/src/packages/backtop/backtop.taro.tsx
@@ -1,7 +1,6 @@
-import React, { FunctionComponent, useState } from 'react'
-
+import React, { FunctionComponent, ReactNode, useState } from 'react'
import { usePageScroll, pageScrollTo } from '@tarojs/taro'
-import Icon from '@/packages/icon/index.taro'
+import { Top } from '@nutui/icons-react-taro'
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
declare const window: any
@@ -15,7 +14,7 @@ export interface BackTopProps extends BasicComponent {
zIndex: number
isAnimation: boolean
duration: number
- children?: HTMLElement | any
+ children?: ReactNode
style?: React.CSSProperties
onClick?: (event: MouseEvent) => void
}
@@ -46,8 +45,6 @@ export const BackTop: FunctionComponent<
duration,
style,
onClick,
- iconClassPrefix,
- iconFontClassName,
} = {
...defaultProps,
...props,
@@ -85,13 +82,7 @@ export const BackTop: FunctionComponent<
}}
>
{children || (
-
+
)}
>
diff --git a/src/packages/backtop/backtop.tsx b/src/packages/backtop/backtop.tsx
index 6de2a6d..c2c1f6e 100644
--- a/src/packages/backtop/backtop.tsx
+++ b/src/packages/backtop/backtop.tsx
@@ -1,6 +1,11 @@
-import React, { FunctionComponent, useEffect, useState, useRef } from 'react'
-
-import Icon from '@/packages/icon'
+import React, {
+ FunctionComponent,
+ useEffect,
+ useState,
+ useRef,
+ ReactNode,
+} from 'react'
+import { Top } from '@nutui/icons-react'
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
declare const window: any
@@ -14,7 +19,7 @@ export interface BackTopProps extends BasicComponent {
zIndex: number
isAnimation: boolean
duration: number
- children?: HTMLElement | any
+ children?: ReactNode
style?: React.CSSProperties
onClick?: (event: MouseEvent) => void
}
@@ -45,8 +50,6 @@ export const BackTop: FunctionComponent<
duration,
style,
onClick,
- iconClassPrefix,
- iconFontClassName,
} = {
...defaultProps,
...props,
@@ -152,15 +155,7 @@ export const BackTop: FunctionComponent<
goTop(e)
}}
>
- {children || (
-
- )}
+ {children || }
)
}
diff --git a/src/packages/backtop/demo.taro.tsx b/src/packages/backtop/demo.taro.tsx
index 2d42f53..4d9c970 100644
--- a/src/packages/backtop/demo.taro.tsx
+++ b/src/packages/backtop/demo.taro.tsx
@@ -1,8 +1,9 @@
import React from 'react'
-import { BackTop, Icon } from '@/packages/nutui.react.taro'
+import Taro from '@tarojs/taro'
+import { Top } from '@nutui/icons-react-taro'
+import { BackTop } from '@/packages/nutui.react.taro'
import { useTranslate } from '@/sites/assets/locale/taro'
import Header from '@/sites/components/header'
-import Taro from '@tarojs/taro'
interface T {
title: string
@@ -141,7 +142,7 @@ const BackTopDemo = () => {
alignItems: 'center',
}}
>
-
+
{translated.backText}
diff --git a/src/packages/backtop/demo.tsx b/src/packages/backtop/demo.tsx
index 990b3f7..3367f22 100644
--- a/src/packages/backtop/demo.tsx
+++ b/src/packages/backtop/demo.tsx
@@ -1,7 +1,7 @@
import React from 'react'
+import { Top } from '@nutui/icons-react'
import { BackTop } from './backtop'
import { useTranslate } from '../../sites/assets/locale'
-import Icon from '@/packages/icon'
interface T {
title: string
@@ -136,11 +136,11 @@ const BackTopDemo = () => {
alignItems: 'center',
}}
>
-
+
{translated.backText}
-
+ {/* */}
>
)
diff --git a/src/packages/backtop/doc.en-US.md b/src/packages/backtop/doc.en-US.md
index 58302dc..e3c7eb4 100644
--- a/src/packages/backtop/doc.en-US.md
+++ b/src/packages/backtop/doc.en-US.md
@@ -129,7 +129,8 @@ export default App;
```tsx
import React from "react";
-import { BackTop, Icon } from '@nutui/nutui-react';
+import { BackTop } from '@nutui/nutui-react';
+import { Top } from '@nutui/icons-react';
const App = () => {
const cellStyle = {
@@ -183,7 +184,7 @@ const App = () => {
alignItems: 'center',
}}
>
-
+
TOP
diff --git a/src/packages/backtop/doc.md b/src/packages/backtop/doc.md
index 5c2c79b..8ed7d58 100644
--- a/src/packages/backtop/doc.md
+++ b/src/packages/backtop/doc.md
@@ -132,7 +132,8 @@ export default App;
```tsx
import React from "react";
-import { BackTop,Icon } from '@nutui/nutui-react';
+import { BackTop } from '@nutui/nutui-react';
+import { Top } from '@nutui/icons-react';
const App = () => {
const cellStyle = {
@@ -186,7 +187,7 @@ const App = () => {
alignItems: 'center',
}}
>
-
+
顶部
diff --git a/src/packages/backtop/doc.taro.md b/src/packages/backtop/doc.taro.md
index 02d81f1..ff2927b 100644
--- a/src/packages/backtop/doc.taro.md
+++ b/src/packages/backtop/doc.taro.md
@@ -7,7 +7,7 @@
### 安装
```javascript
-import { BackTop } from '@/packages/nutui.react.taro'
+import { BackTop } from '@nutui/nutui-react-taro'
```
## 代码演示
@@ -18,7 +18,7 @@ import { BackTop } from '@/packages/nutui.react.taro'
```tsx
import React from "react";
-import { BackTop } from '@/packages/nutui.react.taro'
+import { BackTop } from '@nutui/nutui-react-taro'
const App = () => {
const cellStyle = {
@@ -74,7 +74,7 @@ export default App;
```tsx
import React from "react";
-import { BackTop} from '@/packages/nutui.react.taro'
+import { BackTop} from '@nutui/nutui-react-taro';
const App = () => {
const cellStyle = {
@@ -129,7 +129,8 @@ export default App;
```tsx
import React from "react";
-import { BackTop, Icon } from '@/packages/nutui.react.taro'
+import { BackTop } from '@nutui/nutui-react-taro';
+import { Top } from '@nutui/icons-react-taro';
const App = () => {
const cellStyle = {
@@ -179,7 +180,7 @@ const App = () => {
alignItems: 'center',
}}
>
-
+
顶部
@@ -197,7 +198,7 @@ export default App;
```tsx
import React from "react";
-import { BackTop} from '@/packages/nutui.react.taro'
+import { BackTop} from '@nutui/nutui-react-taro'
const App = () => {
const cellStyle = {
diff --git a/src/packages/backtop/doc.zh-TW.md b/src/packages/backtop/doc.zh-TW.md
index 54c0ae1..3f3724f 100644
--- a/src/packages/backtop/doc.zh-TW.md
+++ b/src/packages/backtop/doc.zh-TW.md
@@ -131,8 +131,8 @@ export default App;
```tsx
import React from "react";
-import { BackTop,Icon } from '@nutui/nutui-react';
-
+import { BackTop } from '@nutui/nutui-react';
+import { Top } from '@nutui/icons-react';
const App = () => {
const cellStyle = {
@@ -186,7 +186,7 @@ const App = () => {
alignItems: 'center',
}}
>
-
+
顶部
--
GitLab