Commit cce1f4a6 authored by XieZhiXiong's avatar XieZhiXiong

chore: 去掉god-mobile引入

parent a93f53f7
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
import React from 'react'; import React from 'react';
import { View, Text, TouchableOpacity, ViewStyle, TextStyle } from 'react-native'; import { View, Text, TouchableOpacity, ViewStyle, TextStyle } from 'react-native';
import { Icons } from '@linkseeks/god-mobile';
import { useTheme } from '@react-navigation/native'; import { useTheme } from '@react-navigation/native';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import { ThemeStyle } from '../../constants/theme'; import { ThemeStyle } from '../../constants/theme';
...@@ -149,10 +148,13 @@ const CellItem: React.FC<CellItemProps> = (props: CellItemProps) => { ...@@ -149,10 +148,13 @@ const CellItem: React.FC<CellItemProps> = (props: CellItemProps) => {
> >
{(icon || customIcon) ? ( {(icon || customIcon) ? (
<View style={myStyle['list-item-icon']}> <View style={myStyle['list-item-icon']}>
{!customIcon ? ( {/* {!customIcon ? (
<Icons name={icon} size={iconSize} color={appTheme.fonts.black1} /> <Icons name={icon} size={iconSize} color={appTheme.fonts.black1} />
) : ( ) : (
customIcon customIcon
)} */}
{!customIcon ? null : (
customIcon
)} )}
</View> </View>
) : null} ) : null}
......
import React from 'react'; import React from 'react';
import { View, Text, ViewStyle, TouchableOpacity } from 'react-native'; import { View, Text, ViewStyle, TouchableOpacity } from 'react-native';
import { Icons } from '@linkseeks/god-mobile';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles'; import styles from './styles';
...@@ -111,9 +110,10 @@ const GridItem: React.FC<GridItemProps> = (props: GridItemProps) => { ...@@ -111,9 +110,10 @@ const GridItem: React.FC<GridItemProps> = (props: GridItemProps) => {
> >
{!isHasChildren && ( {!isHasChildren && (
<View style={myStyle['grid-item-icon']}> <View style={myStyle['grid-item-icon']}>
{!customRenderIcon ? ( {/* {!customRenderIcon ? (
<Icons name={icon} size={iconSize} /> <Icons name={icon} size={iconSize} />
) : customRenderIcon} ) : customRenderIcon} */}
{!customRenderIcon ? null : customRenderIcon}
</View> </View>
)} )}
{!isHasChildren && ( {!isHasChildren && (
......
import React, { useState } from 'react'
import { View, ViewStyle, Modal, TouchableOpacity, GestureResponderEvent, ImageResizeMode } from 'react-native'
import ImageViewer from 'react-native-image-zoom-viewer'
import { IImageInfo } from 'react-native-image-zoom-viewer/built/image-viewer.type'
import LazyImage from '../LazyImage'
import defaultImg from '../../../assets/images/default_img.png'
import styles from './styles'
interface ImageBoxPropsType {
width?: number | string;
height?: number | string;
source: string;
style?: ViewStyle;
resizeMode?: ImageResizeMode;
borderRadius?: number,
canPreview?: boolean,
onPress?: ((event: GestureResponderEvent) => void) | undefined
}
const ImageBox = (props: ImageBoxPropsType) => {
const { width, height, source = "", style, borderRadius, resizeMode = 'contain', canPreview, onPress } = props
const [previewVisible, setPreviewVisible] = useState<boolean>(false)
const showImgBg = () => {
if (canPreview && onPress) {
return (
<TouchableOpacity
activeOpacity={1}
style={{ width, height, borderRadius, overflow: 'hidden' }}
onPress={(e: GestureResponderEvent) => {
if (canPreview) {
setPreviewVisible(true)
} else if (onPress) {
onPress(e)
}
}}
>
<LazyImage
thumbnailSource={defaultImg}
fullSource={{ uri: source }}
style={{ width, height, borderRadius, overflow: 'hidden' }}
resizeMode={resizeMode}
/>
</TouchableOpacity>
)
}
return (
<LazyImage
thumbnailSource={defaultImg}
fullSource={{ uri: source }}
style={{ width, height, borderRadius, overflow: 'hidden' }}
resizeMode={resizeMode}
/>
)
}
return (
<View style={[styles.imageBox, style]}>
{
source ? showImgBg()
: (
<LazyImage
thumbnailSource={defaultImg}
fullSource={{ uri: source }}
style={{ width, height, borderRadius, overflow: 'hidden' }}
resizeMode={resizeMode}
/>
)
}
{
canPreview && (
<Modal
visible={previewVisible}
onRequestClose={() => setPreviewVisible(false)}
transparent
>
<ImageViewer imageUrls={[{ url: source }] as unknown as IImageInfo[]} index={0} onClick={() => setPreviewVisible(false)} />
</Modal>
)
}
</View>
)
}
ImageBox.defaultProps = {
width: 106,
height: 106,
style: {},
resizeMode: "cover",
borderRadius: 4,
canPreview: false,
onPress: undefined,
}
export default ImageBox
import { StyleSheet } from 'react-native'
export default StyleSheet.create({
imageBox: {
overflow: 'hidden',
},
})
import React, { useRef } from 'react';
import {
View,
StyleSheet,
ViewStyle,
Animated,
ImageResizeMode,
} from 'react-native';
import defaultImg from '../../../assets/images/default_img.png'
interface LazyImageProps {
thumbnailSource: any;
fullSource: any;
style?: ViewStyle;
resizeMode: ImageResizeMode;
}
const styles = StyleSheet.create({
image: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,
},
});
const LazyImage: React.FC<LazyImageProps> = (props) => {
const { thumbnailSource, fullSource, style, resizeMode } = props;
const opacity = useRef(new Animated.Value(0)).current;
const onImageLoad = () => {
Animated.timing(opacity, {
toValue: 1,
duration: 300,
useNativeDriver: true,
}).start();
};
return (
<View style={style}>
{
fullSource.uri ? (
<Animated.Image
source={fullSource}
defaultSource={thumbnailSource}
style={[
styles.image,
{
opacity,
},
]}
resizeMode={resizeMode}
onLoad={onImageLoad}
/>
) : (
<Animated.Image
source={defaultImg}
style={[
styles.image,
{
opacity,
},
]}
resizeMode={resizeMode}
onLoad={onImageLoad}
/>
)
}
</View>
);
};
export default LazyImage;
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
import React, { useEffect, useRef } from 'react'; import React, { useEffect, useRef } from 'react';
import { Animated, Easing, ViewStyle } from 'react-native'; import { Animated, Easing, ViewStyle } from 'react-native';
import { Icons } from '@linkseeks/god-mobile';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles'; import styles from './styles';
...@@ -73,7 +72,7 @@ const Spin: React.FC<IProps> = (props: IProps) => { ...@@ -73,7 +72,7 @@ const Spin: React.FC<IProps> = (props: IProps) => {
}, },
]} ]}
> >
<Icons name="loading2" size={size} color={color} /> {/* <Icons name="loading2" size={size} color={color} /> */}
</Animated.View> </Animated.View>
); );
}; };
......
...@@ -9,11 +9,9 @@ import React from 'react'; ...@@ -9,11 +9,9 @@ import React from 'react';
import { import {
StyleSheet, StyleSheet,
ViewStyle, ViewStyle,
} from 'react-native';
import {
View, View,
Text, Text,
} from '@linkseeks/god-mobile'; } from 'react-native';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import Spin from './Spin'; import Spin from './Spin';
import styles from './styles'; import styles from './styles';
......
...@@ -14,7 +14,6 @@ import { ...@@ -14,7 +14,6 @@ import {
ScrollView, ScrollView,
LayoutChangeEvent, LayoutChangeEvent,
} from 'react-native'; } from 'react-native';
import { Icons } from '@linkseeks/god-mobile';
import themeColors from '../../constants/theme/colors'; import themeColors from '../../constants/theme/colors';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles'; import styles from './styles';
...@@ -232,11 +231,11 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => { ...@@ -232,11 +231,11 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => {
> >
{hasIcon ? ( {hasIcon ? (
<View style={myStyle['boticeBar-icon']}> <View style={myStyle['boticeBar-icon']}>
<Icons {/* <Icons
size={16} size={16}
name={icon || 'sound'} name={icon || 'sound'}
color={PRESETS_COLOR_MAP[theme][0]} color={PRESETS_COLOR_MAP[theme][0]}
/> /> */}
</View> </View>
) : null} ) : null}
</View> </View>
...@@ -253,12 +252,12 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => { ...@@ -253,12 +252,12 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => {
myStyle['boticeBar-action'], myStyle['boticeBar-action'],
]} ]}
> >
<Icons {/* <Icons
size={16} size={16}
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
name="right" name="right"
color={PRESETS_COLOR_MAP[theme][0]} color={PRESETS_COLOR_MAP[theme][0]}
/> /> */}
</TouchableOpacity> </TouchableOpacity>
) : null} ) : null}
{closable ? ( {closable ? (
...@@ -269,12 +268,12 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => { ...@@ -269,12 +268,12 @@ const NoticeBar: React.FC<NoticeBarProps> = (props: NoticeBarProps) => {
activeOpacity={0.8} activeOpacity={0.8}
onPress={handleClose} onPress={handleClose}
> >
<Icons {/* <Icons
size={16} size={16}
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
name="close" name="close"
color={PRESETS_COLOR_MAP[theme][0]} color={PRESETS_COLOR_MAP[theme][0]}
/> /> */}
</TouchableOpacity> </TouchableOpacity>
) : null} ) : null}
</TouchableOpacity> </TouchableOpacity>
......
...@@ -16,7 +16,6 @@ import { ...@@ -16,7 +16,6 @@ import {
StyleSheet, StyleSheet,
TextStyle, TextStyle,
} from 'react-native'; } from 'react-native';
import { Icons } from '@linkseeks/god-mobile';
import Overlay from '../Overlay'; import Overlay from '../Overlay';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles'; import styles from './styles';
...@@ -211,13 +210,18 @@ const Popup: React.FC<PopupProps> = (props: PopupProps) => { ...@@ -211,13 +210,18 @@ const Popup: React.FC<PopupProps> = (props: PopupProps) => {
activeOpacity={0.8} activeOpacity={0.8}
onPress={handleCancel} onPress={handleCancel}
> >
{closeIcon === 'close' ? ( {/* {closeIcon === 'close' ? (
<View style={myStyle['popup-ship-close-icon']}> <View style={myStyle['popup-ship-close-icon']}>
<Icons name={closeIcon} size={14} color="rgb(227, 228, 229)" /> <Icons name={closeIcon} size={14} color="rgb(227, 228, 229)" />
</View> </View>
) : ( ) : (
<Icons name={closeIcon} size={24} color="rgb(227, 228, 229)" /> <Icons name={closeIcon} size={24} color="rgb(227, 228, 229)" />
)} )} */}
{closeIcon === 'close' ? (
<View style={myStyle['popup-ship-close-icon']}>
{/* <Icons name={closeIcon} size={14} color="rgb(227, 228, 229)" /> */}
</View>
) : null}
</TouchableOpacity> </TouchableOpacity>
)} )}
{title ? ( {title ? (
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
import { Icons } from '@linkseeks/god-mobile';
import { useTheme } from '@react-navigation/native'; import { useTheme } from '@react-navigation/native';
import { ThemeStyle } from '../../constants/theme'; import { ThemeStyle } from '../../constants/theme';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
...@@ -102,14 +101,14 @@ const Radio = (props: RadioProps) => { ...@@ -102,14 +101,14 @@ const Radio = (props: RadioProps) => {
finalDisabled ? myStyle['radio-icon__disabled'] : null, finalDisabled ? myStyle['radio-icon__disabled'] : null,
])} ])}
> >
<Icons {/* <Icons
name="check" name="check"
size={finalSize - 4} size={finalSize - 4}
color={!finalDisabled ? '#FFFFFF' : '#c8c9cc'} color={!finalDisabled ? '#FFFFFF' : '#c8c9cc'}
style={{ style={{
opacity: isCheck ? 1 : 0, opacity: isCheck ? 1 : 0,
}} }}
/> /> */}
</View> </View>
{!!children && ( {!!children && (
contentNode contentNode
......
...@@ -11,8 +11,9 @@ import { ...@@ -11,8 +11,9 @@ import {
StyleSheet, StyleSheet,
TextInput, TextInput,
TouchableOpacity, TouchableOpacity,
View,
Text,
} from 'react-native'; } from 'react-native';
import { View, Text, Icons } from '@linkseeks/god-mobile';
import { useTheme } from '@react-navigation/native'; import { useTheme } from '@react-navigation/native';
import { ThemeStyle } from '../../constants/theme'; import { ThemeStyle } from '../../constants/theme';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
...@@ -210,7 +211,7 @@ const Search: React.FC<SearchProps> = React.forwardRef((props: SearchProps, ref: ...@@ -210,7 +211,7 @@ const Search: React.FC<SearchProps> = React.forwardRef((props: SearchProps, ref:
<Text style={myStyle['search-label']}>{label}</Text> <Text style={myStyle['search-label']}>{label}</Text>
)} )}
<View style={[myStyle['search-control']]}> <View style={[myStyle['search-control']]}>
{!customLeftIcon ? ( {/* {!customLeftIcon ? (
<Icons <Icons
type="feather" type="feather"
name={leftIcon} name={leftIcon}
...@@ -220,6 +221,9 @@ const Search: React.FC<SearchProps> = React.forwardRef((props: SearchProps, ref: ...@@ -220,6 +221,9 @@ const Search: React.FC<SearchProps> = React.forwardRef((props: SearchProps, ref:
/> />
) : ( ) : (
customLeftIcon customLeftIcon
)} */}
{!customLeftIcon ? null : (
customLeftIcon
)} )}
<View <View
style={myStyle['search-field-wrap']} style={myStyle['search-field-wrap']}
...@@ -256,11 +260,11 @@ const Search: React.FC<SearchProps> = React.forwardRef((props: SearchProps, ref: ...@@ -256,11 +260,11 @@ const Search: React.FC<SearchProps> = React.forwardRef((props: SearchProps, ref:
style={myStyle['search-control-right-icon']} style={myStyle['search-control-right-icon']}
onPress={handleClear} onPress={handleClear}
> >
<Icons {/* <Icons
name="closecircle" name="closecircle"
size={18} size={18}
color="#C0C4CC" color="#C0C4CC"
/> /> */}
</TouchableOpacity> </TouchableOpacity>
)} )}
</View> </View>
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
* @Description: 穿梭机 * @Description: 穿梭机
*/ */
import React from 'react'; import React from 'react';
import { TextStyle, TouchableOpacity } from 'react-native'; import { TextStyle, TouchableOpacity, Text } from 'react-native';
import { Text, Icons } from '@linkseeks/god-mobile';
import useAppStyle from '../../hooks/useAppStyle'; import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles'; import styles from './styles';
...@@ -46,12 +45,12 @@ const Shuttle: React.FC<ShuttleProps> = (props: ShuttleProps) => { ...@@ -46,12 +45,12 @@ const Shuttle: React.FC<ShuttleProps> = (props: ShuttleProps) => {
<Text style={[myStyle['shuttle-describe'], customDescribeStyle]}> <Text style={[myStyle['shuttle-describe'], customDescribeStyle]}>
{describe} {describe}
</Text> </Text>
<Icons {/* <Icons
name="right" name="right"
size={12} size={12}
color="#C0C4CC" color="#C0C4CC"
style={customDescribeStyle} style={customDescribeStyle}
/> /> */}
</TouchableOpacity> </TouchableOpacity>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment