Skip to content

Commit

Permalink
docs: rename react-native-dimensions-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kdn0325 committed Mar 15, 2024
1 parent 72377f5 commit 4d46b33
Show file tree
Hide file tree
Showing 7 changed files with 810 additions and 23 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-native-responsive-design
# react-native-dimensions-layout

react-native-responsive-design
react-native-dimensions-layout

- As a React Native developer, we need to determine the size of components with different display sizes for each device using the app
- Usually, when collaborating using Figma, calculating is annoying and there is a possibility of making mistakes. Even if it is modularized, it can be inaccurate sometimes. It is also difficult to cope with foldable phones or horizontal modes. And some components don't work with percentage
Expand All @@ -9,9 +9,9 @@ react-native-responsive-design
## Installation

```sh
npm install react-native-responsive-design
npm install react-native-dimensions-layout
# or
yarn add react-native-responsive-design
yarn add react-native-dimensions-layout
```

## Usage
Expand All @@ -21,7 +21,7 @@ yarn add react-native-responsive-design
Calculates the percentage value of the width relative to the screen width.

```javascript
import { widthPercentage } from 'react-native-responsive-design';
import { widthPercentage } from 'react-native-dimensions-layout';

const screenWidth = 200; // Current screen width
const widthInPercentage = widthPercentage(screenWidth);
Expand All @@ -37,7 +37,7 @@ Calculates the percentage value of the height relative to the screen height.
Calculates the percentage value of the height relative to the screen height.

```javascript
import { heightPercentage } from 'react-native-responsive-design';
import { heightPercentage } from 'react-native-dimensions-layout';

const screenHeight = 400; // Current screen height
const heightInPercentage = heightPercentage(screenHeight);
Expand All @@ -49,7 +49,7 @@ console.log(heightInPercentage); // Percentage value of the screen height
Calculates the percentage value of the font size

```javascript
import { fontPercentage } from 'react-native-responsive-design';
import { fontPercentage } from 'react-native-dimensions-layout';

const fontSize = 20; // Font size
const fontSizeInPercentage = fontPercentage(fontSize);
Expand All @@ -61,7 +61,7 @@ console.log(fontSizeInPercentage); // Percentage value of the font size
Scales the value provided based on the horizontal size of the screen.

```javascript
import { fontPercentage } from 'react-native-responsive-design';
import { fontPercentage } from 'react-native-dimensions-layout';

const fontSize = 20; // Font size
const fontSizeInPercentage = fontPercentage(fontSize);
Expand All @@ -72,7 +72,7 @@ console.log(fontSizeInPercentage); // Percentage value of the font size
Scales the value provided based on the horizontal size of the screen.

```javascript
import { horizontalScale, verticalScale } from 'react-native-responsive-design';
import { horizontalScale, verticalScale } from 'react-native-dimensions-layout';

const widthValue = 100; // Value to scale horizontally
const heightValue = 100; // Value to scale vertically
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-native-responsive-design-example",
"name": "react-native-dimensions-layout-example",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
fontSizeScale,
horizontalScale,
verticalScale,
} from 'react-native-responsive-design';
} from 'react-native-dimensions-layout';
import { heightPercentage, widthPercentage } from './util/responsiveSize';

export default function App() {
Expand Down
2 changes: 1 addition & 1 deletion example/src/util/responsiveSize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
fontSizeScale,
percentBaseHeight,
percentBaseWidth,
} from 'react-native-responsive-design';
} from 'react-native-dimensions-layout';

// Screen size defined in your Figma design
const FIGMA_WINDOW_WIDTH = 375;
Expand Down
Loading

0 comments on commit 4d46b33

Please sign in to comment.