From 6089f512670395c9a45b878a01f48d97271cbb5f Mon Sep 17 00:00:00 2001 From: William Candillon Date: Thu, 20 Jun 2019 21:07:46 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9A=99=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 88 --------------------- package.json | 2 +- src/DimensionsContext.tsx | 21 +++++ src/MediaQuery.tsx | 10 +-- src/ResponsiveComponent.tsx | 28 ------- src/index.ts | 9 ++- src/selectStyle.ts | 11 +++ src/{useDimensions.ts => useDimensions.tsx} | 7 +- src/useStylesheet.ts | 32 -------- 9 files changed, 46 insertions(+), 162 deletions(-) create mode 100644 src/DimensionsContext.tsx delete mode 100644 src/ResponsiveComponent.tsx create mode 100644 src/selectStyle.ts rename src/{useDimensions.ts => useDimensions.tsx} (71%) delete mode 100644 src/useStylesheet.ts diff --git a/README.md b/README.md index 1ac9967..c158cdd 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![CircleCI](https://circleci.com/gh/wcandillon/react-native-responsive-ui.svg?style=svg)](https://circleci.com/gh/wcandillon/react-native-responsive-ui) [![npm version](https://badge.fury.io/js/react-native-responsive-ui.svg)](https://badge.fury.io/js/react-native-responsive-ui) - Building responsive UIs in React Native. ![example](https://raw.githubusercontent.com/wcandillon/react-native-responsive-ui/4637085802323386110a6352929147d11e1ca83c/example/components/images/example.gif) @@ -58,7 +57,6 @@ export default class Login extends Component { | platform | string | Platform of the device. See [Platform](https://facebook.github.io/react-native/docs/platform-specific-code.html#platform-module). | | condition | boolean | Abritrary boolean value that must be true for the media query to pass. | - ### useDimensions ```jsx @@ -70,90 +68,4 @@ export default ({ children }) => { console.log(`New window dimensions: ${width}x${height}`); return children; }; -``` - -### useStylesheet - -```jsx -import React from "react"; -import {useStylesheet} from "react-native-responsive-ui"; - -export default class Buttons extends ResponsiveComponent { - render() { - const style = useStylesheet(staticStyle) - return -