优化样式
This commit is contained in:
@@ -5,10 +5,13 @@ import img from "@/config/images";
|
||||
interface IProps {
|
||||
reload?: () => void;
|
||||
text?: string;
|
||||
errorImg?: string;
|
||||
btnText?: string;
|
||||
btnImg?: string;
|
||||
}
|
||||
|
||||
const ListLoadError = (props: IProps) => {
|
||||
const { reload, text } = props;
|
||||
const { reload, text, errorImg, btnText, btnImg } = props;
|
||||
const handleReload = () => {
|
||||
reload && typeof reload === "function" && reload();
|
||||
};
|
||||
@@ -17,13 +20,13 @@ const ListLoadError = (props: IProps) => {
|
||||
<View className={styles.listLoadError}>
|
||||
<Image
|
||||
className={styles.listLoadErrorImg}
|
||||
src={img.ICON_LIST_LOAD_ERROR}
|
||||
src={errorImg ? img[errorImg] : img.ICON_LIST_LOAD_ERROR}
|
||||
/>
|
||||
{text && <Text className={styles.listLoadErrorText}>{text}</Text>}
|
||||
{reload && (
|
||||
<Button className={styles.listLoadErrorBtn} onClick={handleReload}>
|
||||
<Image src={img?.ICON_LIST_RELOAD} className={styles.reloadIcon} />
|
||||
重试
|
||||
<Image src={btnImg ? img[btnImg] : img?.ICON_LIST_RELOAD} className={styles.reloadIcon} />
|
||||
{btnText ? " " + btnText : "重试"}
|
||||
</Button>
|
||||
)}
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user