From 1a31c9b0a8c040ad4263747f77b2860d82f3717f Mon Sep 17 00:00:00 2001 From: kdn0325 Date: Sat, 16 Mar 2024 01:14:35 +0900 Subject: [PATCH] docs: rename react-native-responsive-design --- README.md | 18 +++++++++--------- example/package.json | 2 +- example/src/App.tsx | 2 +- example/src/util/responsiveSize.tsx | 2 +- tsconfig.json | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a6d7fa7..7d66bf0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# react-native-dimensions-util +# react-native-responsive-design -react-native-dimensions-util +react-native-responsive-design - 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 @@ -9,9 +9,9 @@ react-native-dimensions-util ## Installation ```sh -npm install react-native-dimensions-util +npm install react-native-responsive-design # or -yarn add react-native-dimensions-util +yarn add react-native-responsive-design ``` ## Usage @@ -21,7 +21,7 @@ yarn add react-native-dimensions-util Calculates the percentage value of the width relative to the screen width. ```javascript -import { widthPercentage } from 'react-native-dimensions-util'; +import { widthPercentage } from 'react-native-responsive-design'; const screenWidth = 200; // Current screen width const widthInPercentage = widthPercentage(screenWidth); @@ -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-dimensions-util'; +import { heightPercentage } from 'react-native-responsive-design'; const screenHeight = 400; // Current screen height const heightInPercentage = heightPercentage(screenHeight); @@ -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-dimensions-util'; +import { fontPercentage } from 'react-native-responsive-design'; const fontSize = 20; // Font size const fontSizeInPercentage = fontPercentage(fontSize); @@ -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-dimensions-util'; +import { fontPercentage } from 'react-native-responsive-design'; const fontSize = 20; // Font size const fontSizeInPercentage = fontPercentage(fontSize); @@ -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-dimensions-util'; +import { horizontalScale, verticalScale } from 'react-native-responsive-design'; const widthValue = 100; // Value to scale horizontally const heightValue = 100; // Value to scale vertically diff --git a/example/package.json b/example/package.json index c232731..0af7d22 100644 --- a/example/package.json +++ b/example/package.json @@ -1,5 +1,5 @@ { - "name": "react-native-dimensions-util-example", + "name": "react-native-responsive-design-example", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { diff --git a/example/src/App.tsx b/example/src/App.tsx index bb5170f..1c90216 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -5,7 +5,7 @@ import { fontSizeScale, horizontalScale, verticalScale, -} from 'react-native-dimensions-util'; +} from 'react-native-responsive-design'; import { heightPercentage, widthPercentage } from './util/responsiveSize'; export default function App() { diff --git a/example/src/util/responsiveSize.tsx b/example/src/util/responsiveSize.tsx index 8dde3c0..e543509 100644 --- a/example/src/util/responsiveSize.tsx +++ b/example/src/util/responsiveSize.tsx @@ -2,7 +2,7 @@ import { fontSizeScale, percentBaseHeight, percentBaseWidth, -} from 'react-native-dimensions-util'; +} from 'react-native-responsive-design'; // Screen size defined in your Figma design const FIGMA_WINDOW_WIDTH = 375; diff --git a/tsconfig.json b/tsconfig.json index a0a41e2..807de51 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "rootDir": ".", "paths": { - "react-native-dimensions-util": ["./src/index"] + "react-native-responsive-design": ["./src/index"] }, "allowUnreachableCode": false, "allowUnusedLabels": false,