Git Product home page Git Product logo

mindinventory / react-native-bus-seat-layout Goto Github PK

View Code? Open in Web Editor NEW
21.0 5.0 6.0 882 KB

A @mindinventory/react-native-bus-seat-layout library provides seats layout for bus booking, you can give custom styles of seat numbers. also can give images for seat. you have to provide number of rows that you need to draw layout, you will get selected seats from props.

Home Page: https://www.mindinventory.com/react-native-app-development.php

License: MIT License

JavaScript 4.96% Java 20.97% TypeScript 60.68% C 0.35% Objective-C 10.87% Swift 0.22% Ruby 1.95%
custom-component custom-layout custom-view custom-views react react-native bus-seat-booking bus-seat-layout

react-native-bus-seat-layout's Introduction

@mindinventory/react-native-bus-seat-layout

A @mindinventory/react-native-bus-seat-layout library provides seats layout for bus booking, you can give custom styles of seat numbers. also can give images for seat. you have to provide number of rows that you need to draw layout, you will get selected seats from props.

Installation

using npm:

npm install @mindinventory/react-native-bus-seat-layout

using yarn:

yarn add @mindinventory/react-native-bus-seat-layout

Preview

Simulator Screen Recording - iPhone 11 - 2022-11-08 at 18 39 33 Simulator Screen Recording - iPhone 11 - 2022-11-08 at 18 40 42

Supported platform

  • Android
  • Ios

Usage

import SeatsLayout from '@mindinventory/react-native-bus-seat-layout';
<SeatsLayout
  row={14}
  layout={{ columnOne: 3, columnTwo: 2 }}
  selectedSeats={[
    { seatNumber: 1, seatType: 'booked' },
    { seatNumber: 11, seatType: 'women' },
    { seatNumber: 17, seatType: 'women' },
    { seatNumber: 43, seatType: 'blocked' },
  ]}
  numberTextStyle={{ fontSize: 12 }}
  seatImage={{ image: SleeperSeatIcon, tintColor: '#B2B2B2' }}
  getBookedSeats={(seats) => {
    console.log('getBookedSeats :: ', seats);
  }}
/>

Props to use

Parameter Type Description
row number Set number of rows to draw seat layout.
layout Layout (Optional) Default value columnOne: 2 & columnTwo: 2.
driverPosition string (Optional) Accepts string args among left or right. Default is right.
isSleeperLayout boolean (Optional) Accepts boolean value either true or false. Default is false.
maxSeatToSelect number (Optional) Allow uset to select maximum number of seats to book in one go. Default value 7.
selectedSeats Array (Optional) Accepts value seatNumber number and seatType number which accepts value from (booked or women or blocked). Default its set to blank array.

Contributing!

See the contributing guide to learn how to contribute to the repository and the development workflow.

License!

@mindinventory/react-native-bus-seat-layout MIT-licensed.

Let us know!

If you use our open-source libraries in your project, please make sure to credit us and Give a star to www.mindinventory.com

Please feel free to use this component and Let us know if you are interested to building Apps or Designing Products.

app development

react-native-bus-seat-layout's People

Contributors

akashmi avatar chiragramimi avatar tusharsanchaniya-mi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-bus-seat-layout's Issues

Getting duplicate seat in the last row

I am getting a duplicate seat in the last row. For eg:

 <SeatsLayout
        row={3}
        numberTextStyle={{ fontSize: 12 }}
        getBookedSeats={(seats) => {
          console.log("getBookedSeats :: ", seats);
        }}
      />

Gives the following image. There should be either 9 seats or the middle seat should not be there. There should be an option to allow for middle seat in the last row (but with the correct number).

image

@TusharSanchaniya-mi

Configure bus doors and remove associated seats inside the bus for user entry/exit

Hello,

Thanks fo this package.

I would like to know how to configure the bus doors (because more buses have one or two doors on the right side) and how to remove the associated seats inside the bus for user entry/exit.

Because with the current configuration, the bus has only one door next to the driver.

Example with two doors:

image

Example with one door (this door could be in the middle of the right side or near the driver :
image

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.