@momo-kits/logo 0.74.2-react-native.1

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 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 {Logo};
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@momo-kits/logo",
3
+ "version": "0.74.2-react-native.1",
4
+ "private": false,
5
+ "main": "index.tsx",
6
+ "peerDependencies": {
7
+ "@momo-kits/foundation": "latest",
8
+ "react": "*",
9
+ "react-native": "*",
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,25 @@
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: 9,
10
+ },
11
+ icon: {},
12
+ logo: {
13
+ width: '100%',
14
+ height: '100%',
15
+ borderRadius: 7,
16
+ },
17
+ shadow: {
18
+ shadowOffset: {
19
+ width: 0,
20
+ height: 2,
21
+ },
22
+ shadowOpacity: 1,
23
+ shadowRadius: 2,
24
+ },
25
+ });
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
+ };