diff --git a/scripts/rn/copy-file.js b/scripts/rn/copy-file.js index 111a4eca8f..337b0e22bb 100644 --- a/scripts/rn/copy-file.js +++ b/scripts/rn/copy-file.js @@ -54,6 +54,7 @@ const copyFile = async (from, to, success, isSingle = false) => { 'griditem', 'hoverbuttonitem', 'avatargroup', + 'icon', ].includes(item) ) { modify( @@ -61,10 +62,12 @@ const copyFile = async (from, to, success, isSingle = false) => { `import '../../../styles/demo.scss';\n` ) } - modify( - `${targetBaseUrl}/packages/${item}/${item}.taro.tsx`, - `import "./${item}.harmony.css";\n` - ) + if (!['icon'].includes(item)) { + modify( + `${targetBaseUrl}/packages/${item}/${item}.taro.tsx`, + `import "./${item}.harmony.css";\n` + ) + } } }) }) diff --git a/src/packages/countdown/countdown.taro.tsx b/src/packages/countdown/countdown.taro.tsx index f62ca76715..9a8bbcfeec 100644 --- a/src/packages/countdown/countdown.taro.tsx +++ b/src/packages/countdown/countdown.taro.tsx @@ -9,7 +9,7 @@ import React, { import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { padZero } from '@/utils/pad-zero' -import { harmonyAndRn, web } from '@/utils/platform-taro' +import { web } from '@/utils/platform-taro' export interface CountDownTimeProps { d: number @@ -201,12 +201,6 @@ const InternalCountDown: ForwardRefRenderFunction< formatCache = formatCache.replace('SS', msC.slice(0, 1)) } } - formatCache = formatCache.replace( - /(\d+)/g, - type === 'primary' - ? `$1` - : `$1` - ) return formatCache } @@ -293,10 +287,6 @@ const InternalCountDown: ForwardRefRenderFunction< destroy && cancelAnimationFrame(stateRef.current.timer) } - const renderTime = (() => { - return formatRemainTime(stateRef.current.restTime) - })() - const getUnit = (unit: string) => { const formatArr = format.split(/(DD|HH|mm|ss|S)/) const index = formatArr.indexOf(unit) @@ -356,26 +346,13 @@ const InternalCountDown: ForwardRefRenderFunction< return ( <> {children || ( - <> - {!harmonyAndRn() ? ( - - ) : ( - - {renderTaroTime()} - - )} - + + {renderTaroTime()} + )} )