diff --git a/.babelrc b/.babelrc deleted file mode 100644 index d4b74b5..0000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["module:metro-react-native-babel-preset"] -} diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 06fed81..0000000 --- a/.eslintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": ["airbnb", "prettier", "prettier/react"], - "rules": { - "react/jsx-filename-extension": [ - 1, - { - "extensions": [".js", ".jsx"] - } - ], - "prettier/prettier": [ - "error", - { - "trailingComma": "none", - "singleQuote": false, - "printWidth": 100 - } - ], - "import/no-extraneous-dependencies": ["error", { "devDependencies": true }] - }, - "plugins": ["prettier"], - "env": { - "jest": true - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..2909af7 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + root: true, + extends: '@react-native', + ignorePatterns: ['node_modules/*'], +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9b95343 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI workflow for Codecov +on: [push, pull_request] +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: yarn install + - name: Run tests and collect coverage + run: yarn test --coverage + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: nysamnang/react-native-raw-bottom-sheet + files: ./coverage/*.json diff --git a/.gitignore b/.gitignore index 9c71b88..e0bdd20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,12 @@ # OSX .DS_Store -# Node Module -node_modules/ - # Jest Test Coverage coverage/ -# Ignore editor config -.idea +# Example Code +example/node_modules/ +example/.expo/ + +# Node Module +node_modules/ diff --git a/.npmignore b/.npmignore index ea711dd..0e60669 100644 --- a/.npmignore +++ b/.npmignore @@ -1,11 +1,14 @@ # OSX .DS_Store -# Node Module -node_modules/ +# Github Actions +.github/ # Jest Test Coverage coverage/ -# Example -example/ \ No newline at end of file +# Example Code +example/ + +# Node Module +node_modules/ diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..2b54074 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7a56d2a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "stable" diff --git a/README.md b/README.md index fb9d0b8..b10017b 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,21 @@ # react-native-raw-bottom-sheet -> ## Motivation -> -> Thank you for using the `react-native-raw-bottom-sheet` library. -> -> This library has been published for over 5 years and I've noticed that new libraries are being published frequently, and I hope that those newer libraries will replace this small library with time, that's why I have stopped maintaining this project for the past few years. -> -> However, I was pleasantly surprised to see that the number of installations has remained high over the past year. Therefore, I have decided to continue to maintain this project. -> -> I will ensure that this project remains simple and lightweight, without requiring any configuration or external dependencies. -> -> I would also like to express my gratitude to all the contributors who have made pull requests. Thank you! +## Hooray! The new version 3 has been released. + +Please pay close attention if you are upgrading the RBSheet from version 2 to version 3. + +- Functional Components: Starting from v3.0.0, RBSheet has been completely rewritten using Functional Components. This improves performance and aligns with modern React practices. +- Prop Removal & Renaming: Several props have been removed and renamed for improved clarity and maintainability. Please refer to the updated documentation for a complete list of available props and their intended behavior. + +
[![npm version](https://badge.fury.io/js/react-native-raw-bottom-sheet.svg)](//npmjs.com/package/react-native-raw-bottom-sheet) [![npm downloads](https://img.shields.io/npm/dm/react-native-raw-bottom-sheet.svg) ](//npmjs.com/package/react-native-raw-bottom-sheet) -[![Build Status](https://travis-ci.org/nysamnang/react-native-raw-bottom-sheet.svg?branch=master)](https://travis-ci.org/nysamnang/react-native-raw-bottom-sheet) +[![codecov](https://codecov.io/gh/nysamnang/react-native-raw-bottom-sheet/graph/badge.svg?token=tJuJsd1V8e)](https://codecov.io/gh/nysamnang/react-native-raw-bottom-sheet) - Super Lightweight Component -- Add Your own Component To Bottom Sheet +- Add Your Own Component To Bottom Sheet - Customize Whatever You Like - Support Drag Down Gesture - Support All Orientations @@ -26,7 +23,7 @@ - Smooth Animation - Zero Configuration - Zero dependency -- Top Search Ranking (react native bottom sheet) at [npms.io](https://npms.io/search?q=react%20native%20bottom%20sheet) +- Millions of Downloads | Showcase iOS | Showcase Android | | :--------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------: | @@ -46,71 +43,42 @@ yarn add react-native-raw-bottom-sheet ## Example -#### Class component +Please check the [example](https://github.com/nysamnang/react-native-raw-bottom-sheet/tree/master/example) folder to explore more example codes. -```jsx -import React, { Component } from "react"; -import { View, Button } from "react-native"; -import RBSheet from "react-native-raw-bottom-sheet"; - -export default class Example extends Component { - render() { - return ( - -