diff --git a/.eslintignore b/.eslintignore index edbbafa1ea..29a1133e40 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1 @@ -/src/style/typography.js -**/*.ts -**/*.tsx +/src/style/typography.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 252aa3ce14..4d7d143455 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,12 @@ module.exports = { extends: ['plugin:@typescript-eslint/recommended', 'wix/react-native', 'plugin:react-hooks/recommended'], parser: '@typescript-eslint/parser', + // plugins: ['@typescript-eslint'], rules: { + /* Disabled rules for typescript */ + 'no-dupe-class-members': 'off', + /* Other Rules */ + 'no-unused-expressions': 'off', 'arrow-parens': 'off', // TODO: remove after migration of legacy lifecycle methods camelcase: 'off', @@ -9,98 +14,31 @@ module.exports = { 'no-mixed-operators': ['off'], 'no-trailing-spaces': 'off', 'operator-linebreak': 'off', - 'max-len': ['warn', {code: 120}], + 'max-len': ['warn', {code: 120, ignoreComments: true, ignoreStrings: true}], 'react/jsx-no-bind': [ - 'warn', + 'off', { ignoreRefs: true, allowArrowFunctions: false, - allowBind: false, - }, + allowBind: false + } ], 'function-paren-newline': ['warn', 'never'], 'new-cap': ['off'], // TODO: fix this in colors.js and remove this 'default-case': ['off'], - "@typescript-eslint/no-use-before-define": 0, - "@typescript-eslint/explicit-function-return-type": 0, - "@typescript-eslint/no-var-requires": 0, - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/member-delimiter-style": 0, - // "@typescript-eslint/no-unused-vars": [2, {"args": "all", "argsIgnorePattern": "^_"}], - "@typescript-eslint/no-unused-vars": 0, //todo: uncomment this line and use the the better unused rule above ^ - "@typescript-eslint/no-non-null-assertion": 0, - "@typescript-eslint/explicit-member-accessibility": 0, - "@typescript-eslint/prefer-optional-chain": "error", - "@typescript-eslint/ban-ts-ignore": 0, - "@typescript-eslint/no-empty-function": 0, - "@typescript-eslint/camelcase": 0, - "@typescript-eslint/indent": 0 - }, - plugins: ['@typescript-eslint'], + '@typescript-eslint/no-use-before-define': 0, + '@typescript-eslint/explicit-function-return-type': 0, + '@typescript-eslint/no-var-requires': 0, + '@typescript-eslint/no-explicit-any': 0, + '@typescript-eslint/member-delimiter-style': 0, + '@typescript-eslint/no-unused-vars': [2, {args: 'all', argsIgnorePattern: '^_'}], + // "@typescript-eslint/no-unused-vars": 0, //todo: uncomment this line and use the the better unused rule above ^ + '@typescript-eslint/no-non-null-assertion': 0, + '@typescript-eslint/explicit-member-accessibility': 0, + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/ban-ts-ignore': 0, + '@typescript-eslint/no-empty-function': 0, + '@typescript-eslint/camelcase': 0, + '@typescript-eslint/indent': 0 + } }; - -// OLD ESlint configuration -// const validColors = require('./src/style/colorsPalette').colorsPalette; -// const extraFixColorsMap = require('./src/style/colorsPalette').extraFixColorsMap; -// const assetsDepJson = require('./eslint-rules/tests/assets_deprecation.json'); -// const deprecationsJson = require('./eslint-rules/tests/component_deprecation.json'); - -// module.exports = { -// parser: 'babel-eslint', -// extends: 'wix/react-native', -// // plugins: ['react', 'react-native', 'uilib'], -// // extends: ['airbnb'], -// rules: { -// 'arrow-body-style': 'off', -// 'arrow-parens': 'off', -// // TODO: remove after migration of legacy lifecycle methods -// 'camelcase': 'off', -// 'class-methods-use-this': 'off', -// 'consistent-return': 'off', -// 'comma-dangle': 'off', -// 'global-require': 'off', -// 'max-len': [2, 130, 4, {ignoreUrls: true}], -// 'no-nested-ternary': 'off', -// 'no-else-return': 'off', -// 'no-mixed-operators': ['off'], -// 'no-param-reassign': ['warn'], -// 'no-plusplus': 'off', -// 'no-return-assign': 'off', -// 'no-trailing-spaces': 'off', -// 'no-use-before-define': 'off', -// 'no-unneeded-ternary': 'off', -// 'no-mixed-operators': 'off', -// 'no-underscore-dangle': ['error', {'allowAfterThis': true}], -// 'object-curly-spacing': 'off', -// 'operator-linebreak': 'off', -// 'react/forbid-prop-types': 'off', -// 'react/jsx-filename-extension': 'off', -// 'react/jsx-space-before-closing': 'off', -// 'react/jsx-tag-spacing': 'off', -// 'react/prefer-stateless-function': 'off', -// 'react/prop-types': ['error', {ignore: ['children', 'style', 'testID']}], -// 'react/require-default-props': 'off', -// "react/sort-comp": ['warn'], -// 'react/jsx-no-bind': [ -// 'warn', -// { -// ignoreRefs: true, -// allowArrowFunctions: false, -// allowBind: false, -// }, -// ], -// 'import/prefer-default-export': 'off' -// }, -// env: { -// browser: true, -// node: true, -// jest: true, -// }, -// settings: { -// 'import/resolver': { -// node: { -// extensions: ['.js', '.ios.js', '.android.js'], -// }, -// }, -// }, -// }; diff --git a/android/app/src/main/ic_launcher-playstore.png b/android/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000000..1bf75b2cf3 Binary files /dev/null and b/android/app/src/main/ic_launcher-playstore.png differ diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml index 2408e30d17..ca3826a46c 100644 --- a/android/app/src/main/res/drawable/ic_launcher_background.xml +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -5,7 +5,7 @@ android:viewportHeight="108" android:viewportWidth="108" xmlns:android="http://schemas.android.com/apk/res/android"> - diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 95e940aa34..ef2adddcae 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index 69a1f5ecfe..0dfe76be09 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index 0785738e2e..1f63abc41a 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index a8033f6f8e..e73a68fb50 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index acc26a34fe..1a6ea551af 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 633aa4c710..a7dbafab03 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index cb9947b568..578642d390 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index b7da35431e..5b7a00ee50 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index a31ce8bbdb..8aa2baaccc 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 8416bfbc98..29f589dde2 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index 3f92ebe445..866d44ad44 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 9678a85730..b442fb5870 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 209c04a651..1e8e558e11 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index 51069134e4..571d815d86 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index 17c925af05..72fb0f05a5 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/demo/src/assets/icons/bell.png b/demo/src/assets/icons/bell.png new file mode 100644 index 0000000000..4936f84574 Binary files /dev/null and b/demo/src/assets/icons/bell.png differ diff --git a/demo/src/assets/icons/bell@2x.png b/demo/src/assets/icons/bell@2x.png new file mode 100644 index 0000000000..5c2f33b0d9 Binary files /dev/null and b/demo/src/assets/icons/bell@2x.png differ diff --git a/demo/src/assets/icons/bell@3x.png b/demo/src/assets/icons/bell@3x.png new file mode 100644 index 0000000000..44a2212a6c Binary files /dev/null and b/demo/src/assets/icons/bell@3x.png differ diff --git a/demo/src/screens/componentScreens/BadgesScreen.tsx b/demo/src/screens/componentScreens/BadgesScreen.tsx index ec9bd525d6..3d78352d86 100644 --- a/demo/src/screens/componentScreens/BadgesScreen.tsx +++ b/demo/src/screens/componentScreens/BadgesScreen.tsx @@ -5,8 +5,7 @@ const BadgesSpace = 30; const plusIcon = require('../../assets/icons/chevronUp.png'); const minusIcon = require('../../assets/icons/chevronDown.png'); const star = require('../../assets/icons/star.png'); -const search = require('../../assets/icons/search.png'); - +const bell = require('../../assets/icons/bell.png'); export default class BadgesScreen extends Component { constructor(props) { @@ -137,6 +136,15 @@ export default class BadgesScreen extends Component { + + + Counter Icon Badges + + + + + + ); } diff --git a/demo/src/screens/componentScreens/CardsScreen.tsx b/demo/src/screens/componentScreens/CardsScreen.tsx index b72342f8b7..7be94f87cb 100644 --- a/demo/src/screens/componentScreens/CardsScreen.tsx +++ b/demo/src/screens/componentScreens/CardsScreen.tsx @@ -1,16 +1,7 @@ import _ from 'lodash'; import React, {Component} from 'react'; import {StyleSheet, ScrollView} from 'react-native'; -import { - Constants, - Colors, - View, - Card, - CardProps, - Button, - Text, - Image -} from 'react-native-ui-lib'; +import {Constants, Colors, View, Card, CardProps, Button, Text, Image} from 'react-native-ui-lib'; // @ts-ignore import posts from '../../data/posts'; @@ -26,10 +17,7 @@ type CardsScreenState = { selected2: boolean; }; -export default class CardsScreen extends Component< - CardsScreenProps, - CardsScreenState -> { +export default class CardsScreen extends Component { state = { selected1: true, selected2: true @@ -47,7 +35,7 @@ export default class CardsScreen extends Component< activeOpacity={1} marginR-20 > - + - + ); @@ -73,8 +61,7 @@ export default class CardsScreen extends Component< content={[ {text: 'You’re Invited!', text70: true, dark10: true}, { - text: - '222 Join Old The Town Barbershop Official Store. Download the Wix app to...', + text: '222 Join Old The Town Barbershop Official Store. Download the Wix app to...', text80: true, dark10: true }, @@ -92,8 +79,7 @@ export default class CardsScreen extends Component< You’re Invited! - 222 Join Old The Town Barbershop Official Store. Download the Wix app - to... + 222 Join Old The Town Barbershop Official Store. Download the Wix app to... wix.to/A465c @@ -102,11 +88,7 @@ export default class CardsScreen extends Component< ); }; - renderHorizontalCard = ( - isImageOnLeft: boolean, - borderRadius: number, - useSection: boolean - ) => { + renderHorizontalCard = (isImageOnLeft: boolean, borderRadius: number, useSection: boolean) => { return ( - {isImageOnLeft && ( - - )} + {isImageOnLeft && } {useSection ? this.renderTextSection() : this.renderText()} - {!isImageOnLeft && ( - - )} + {!isImageOnLeft && } ); }; @@ -147,22 +119,14 @@ export default class CardsScreen extends Component< ]} style={{padding: 20}} /> - + ); }; renderCoupon = (cardProps: CardProps) => { return ( - {}} - useNative - activeOpacity={1} - activeScale={0.96} - > + {}} useNative activeOpacity={1} activeScale={0.96}> { return ( - {}} - useNative - activeOpacity={1} - activeScale={0.96} - > + {}} useNative activeOpacity={1} activeScale={0.96}> {image} { // Icon - this.renderComplexImage( - {'marginR-5': true}, + this.renderComplexImage({'marginR-5': true}, - ) + />) } { // Image with overlay content - this.renderComplexImage( - {'marginL-5': true}, + this.renderComplexImage({'marginL-5': true}, - ) + />) } ); @@ -262,12 +214,8 @@ export default class CardsScreen extends Component< renderNumbers = () => { return ( - - {_.times(4, (i) => { + + {_.times(4, i => { return ( @@ -293,24 +241,19 @@ export default class CardsScreen extends Component< renderBackgroundTypes = () => { return ( - {this.renderBackgroundCard( - {'marginR-20': true, style: {backgroundColor: Colors.dark60}}, + {this.renderBackgroundCard({'marginR-20': true, style: {backgroundColor: Colors.dark60}}, With custom background color - - )} - {this.renderBackgroundCard( - { - 'marginR-20': true, - style: {backgroundColor: Colors.rgba(Colors.dark60, 0.75)} - }, - + )} + {this.renderBackgroundCard({ + 'marginR-20': true, + style: {backgroundColor: Colors.rgba(Colors.dark60, 0.75)} + }, + With opacity - - )} + )} {Constants.isIOS && - this.renderBackgroundCard( - {enableBlur: true, 'marginL-20': true}, + this.renderBackgroundCard({enableBlur: true, 'marginL-20': true}, <> With Blur effect @@ -318,27 +261,18 @@ export default class CardsScreen extends Component< (iOS only) - - )} + )} ); }; renderComplexExample = () => { return _.map(posts, (post, i) => { - const statusColor = - post.status === 'Published' ? Colors.green30 : Colors.orange30; + const statusColor = post.status === 'Published' ? Colors.green30 : Colors.orange30; return ( - console.log('press on a card')} - > - + console.log('press on a card')}> + @@ -360,14 +294,8 @@ export default class CardsScreen extends Component< {post.likes} Likes -