@momo-kits/logo 0.81.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.tsx +39 -0
- package/package.json +15 -0
- package/publish.sh +28 -0
- package/styles.ts +24 -0
- package/types.ts +13 -0
package/index.tsx
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, {FC} from 'react';
|
|
2
|
+
import {View} from 'react-native';
|
|
3
|
+
import {LogoProps} from './types';
|
|
4
|
+
import {Colors, Image} from '@momo-kits/foundation';
|
|
5
|
+
import styles from './styles';
|
|
6
|
+
|
|
7
|
+
const Logo: FC<LogoProps> = ({
|
|
8
|
+
type = 'image',
|
|
9
|
+
useShadow = true,
|
|
10
|
+
useBorder = true,
|
|
11
|
+
useBackground = true,
|
|
12
|
+
backgroundColor = Colors.black_01,
|
|
13
|
+
shadowColor = '#d9d9d9',
|
|
14
|
+
borderColor = '#e2e2e2',
|
|
15
|
+
source,
|
|
16
|
+
style,
|
|
17
|
+
}) => {
|
|
18
|
+
const isIcon = type === 'icon';
|
|
19
|
+
const containerStyle = !isIcon ? styles.image : styles.icon;
|
|
20
|
+
const shadowStyle = useShadow ? [styles.shadow, {shadowColor}] : {};
|
|
21
|
+
const backgroundStyle = useBackground && !isIcon ? {backgroundColor} : {};
|
|
22
|
+
const borderStyle = useBorder && !isIcon ? {borderColor, borderWidth: 2} : {};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<View
|
|
26
|
+
style={[
|
|
27
|
+
style,
|
|
28
|
+
styles.container,
|
|
29
|
+
containerStyle,
|
|
30
|
+
backgroundStyle,
|
|
31
|
+
shadowStyle,
|
|
32
|
+
borderStyle,
|
|
33
|
+
]}>
|
|
34
|
+
<Image source={{uri: source}} style={styles.logo} />
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Logo;
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@momo-kits/logo",
|
|
3
|
+
"version": "0.81.1-beta.5",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@momo-kits/foundation": "latest",
|
|
8
|
+
"react": "16.9.0",
|
|
9
|
+
"react-native": ">=0.55",
|
|
10
|
+
"prop-types": "^15.7.2"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {},
|
|
13
|
+
"license": "MoMo",
|
|
14
|
+
"dependencies": {}
|
|
15
|
+
}
|
package/publish.sh
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
rm -rf dist
|
|
3
|
+
mkdir dist
|
|
4
|
+
|
|
5
|
+
cp . ./dist
|
|
6
|
+
|
|
7
|
+
# GET VERSION from mck_package.json
|
|
8
|
+
VERSIONSTRING=( v$(jq .version package.json) )
|
|
9
|
+
VERSION=(${VERSIONSTRING//[\"]/})
|
|
10
|
+
echo VERSION: $VERSION
|
|
11
|
+
|
|
12
|
+
rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
|
|
13
|
+
|
|
14
|
+
# #babel component to dist
|
|
15
|
+
#babel ./dist -d dist --copy-files
|
|
16
|
+
|
|
17
|
+
#copy option
|
|
18
|
+
#cp -r ./src/ dist
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#npm login
|
|
22
|
+
#publish dist to npm
|
|
23
|
+
cd dist
|
|
24
|
+
npm publish --tag beta --access=public
|
|
25
|
+
cd ..
|
|
26
|
+
rm -rf dist
|
|
27
|
+
|
|
28
|
+
##curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/bank new version release: '*"$VERSION"*' `https://www.npmjs.com/package/@momo-kits/avatar`"}'
|
package/styles.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
width: 28,
|
|
6
|
+
height: 28,
|
|
7
|
+
},
|
|
8
|
+
image: {
|
|
9
|
+
borderRadius: 8,
|
|
10
|
+
},
|
|
11
|
+
icon: {},
|
|
12
|
+
logo: {
|
|
13
|
+
width: '100%',
|
|
14
|
+
height: '100%',
|
|
15
|
+
},
|
|
16
|
+
shadow: {
|
|
17
|
+
shadowOffset: {
|
|
18
|
+
width: 0,
|
|
19
|
+
height: 2,
|
|
20
|
+
},
|
|
21
|
+
shadowOpacity: 1,
|
|
22
|
+
shadowRadius: 2,
|
|
23
|
+
},
|
|
24
|
+
});
|
package/types.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {ViewStyle} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type LogoProps = {
|
|
4
|
+
type?: 'icon' | 'image';
|
|
5
|
+
useShadow?: boolean;
|
|
6
|
+
useBorder?: boolean;
|
|
7
|
+
useBackground?: boolean;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
shadowColor?: string;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
source: string;
|
|
12
|
+
style?: ViewStyle | ViewStyle[];
|
|
13
|
+
};
|