Skip to content

Commit

Permalink
fix: loading support text style
Browse files Browse the repository at this point in the history
  • Loading branch information
linjinze999 committed Jun 5, 2024
1 parent 165fd5d commit 6118c9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface LoadingProps {
loadingGifProps?: LoadingGifProps;
/** 点击事件 */
onPress?: () => void;
/** 容器样式 */
/** 容器样式(可设置文字样式,会被透传下去) */
style?: GenericStyleProp<ViewStyle>;
/** 开启无障碍阅读 */
accessible?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/hippy_ui_react/src/components/Loading/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Loading/>
<Loading text={"加载中..."}/>
<Loading loadingGifProps={{percent: 50}} text={"加载中..."}/>
<Loading gif={null} text={"加载中..."}/>
<Loading style={{color:"#000"}} gif={null} text={"加载中..."}/>
<Loading
gif={
<Image
Expand Down
8 changes: 6 additions & 2 deletions packages/hippy_ui_react/src/components/Loading/renderInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { ViewStyle } from '@hippy/react';
import { LoadingRenderParams, LoadingRenderInfo, loadingConfig } from './config';
import { transferStyle } from '../../utils/Styles';
import { pickTextStyle, transferStyle } from '../../utils/Styles';
import LoadingGif from '../LoadingGif';
import HiText from '../HiText';

Expand All @@ -28,7 +28,11 @@ export default function getRenderInfo(params: LoadingRenderParams): LoadingRende
typeof text === 'string' ? (
<HiText
{...themeConfig.loadingTextProps}
style={transferStyle([{ color: themeConfig.colorTextSecondary }, themeConfig.loadingTextProps.style])}
style={transferStyle([
{ color: themeConfig.colorTextSecondary },
themeConfig.loadingTextProps.style,
pickTextStyle(wrapStyle),
])}
>
{text}
</HiText>
Expand Down

0 comments on commit 6118c9f

Please sign in to comment.