0.3.1 • Published 5 years ago

react-native-lopigrid v0.3.1

Weekly downloads
14
License
MIT
Repository
gitlab
Last release
5 years ago

react-native-lopigrid

A (not yet responsive) grid system for react-native.

IMPORTANT: Under development so it might not work properly and change between versions. Should not yet be used in production.

Installation

yarn add react-native-lopigrid

Usage

import Lopigrid from "react-native-lopigrid";

<Container>
  <Column>
    <Row size={40} style={{ backgroundColor: 'green' }} />
    <Row size={20} style={[styles.text, null, { backgroundColor: 'red' }]}/>
    <Row size={25} />
    <Row size={15} />
  </Column>
</Container>

StyleProps

Propdefaulttypestyle
pundefinednumber or number[]padding
mundefinednumber or number[]margin
hundefinednumberheight
wundefinednumberwidth
bgundefinedstringbackground-color
borderundefinedstringborder-color
borderWidthundefinednumberborder-width
debugfalsebooleanrandom background-color

FlexProps

The following flex props are available:

  • alignContent
  • alignItems
  • flexWrap
  • justifyContent
  • overflow
  • flex
  • flexBasis
  • flexDirection
  • flexGrow
  • flexShrink

Example

There is an example food order application for restaurants using Ghulam Rasool's designs.

Free stock images used:

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

Idea

  • add background image as bg, from url or local file
  • add tests
  • set up ci/cd to run tests?
  • Generate each component with debug prop an id, so we can generate a custom color for them and propagate the debug prop down the tree. this would give nice visualization on our grid just by applying one props on the top element. Should be a unique color by props or something, to always get the same color generated for a given component.

Fix

  • borderB adds extra width and height on component

0.3.1 - 2020-12-23

Fixed

  • unable to add p and m as a number (only working with an array)
  • a bit updated documentation

0.2.3 - 2020-10-20

Fixed

  • Apparenlty react-native fails to refresh the component's flexBasis after orientation change so a simple store was added to trigger a rerender on an orientation change. Not the best solution but works for now.

0.1.3 - 2020-06-20

Added

  • Debug props on Components so they get a random background color to easier debug.

Changed

  • Grid Component renamed to Container

Fixed

  • Fix converting m and p props as array to style

0.1.3 - 2020-06-19

Added

  • Margin & Padding as array

Fiexed

  • Resonsive problems

0.1.2 - 2020-06-18

Fixed

  • fixed AbstractComponent::computeProps to fix style props not applying problems.

0.1.1 - 2020-06-14

Added

  • Grid Component to serve as a main View to contain Columns and Rows
  • Column Component
  • Row Component
  • Responsive sizes

Contributing

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

License

MIT

0.3.1

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago