Skip to content

Commit

Permalink
Add react-native-is-edge-to-edge
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Sep 5, 2024
1 parent ee08547 commit 4c5edee
Show file tree
Hide file tree
Showing 5 changed files with 4,690 additions and 0 deletions.
41 changes: 41 additions & 0 deletions react-native-is-edge-to-edge/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "react-native-is-edge-to-edge",
"version": "0.1.0",
"license": "MIT",
"description": "TODO",
"author": "Mathieu Acthernoene <zoontek@gmail.com>",
"homepage": "https://github.com/zoontek/react-native-edge-to-edge",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/zoontek/react-native-edge-to-edge.git"
},
"keywords": [
"react",
"react-native",
"edge-to-edge",
"status-bar",
"navigation-bar",
"system-bar",
"system-bars"
],
"scripts": {
"build": "tsup"
},
"peerDependencies": {
"react": ">=18.1.0",
"react-native": ">=0.70.0"
},
"devDependencies": {
"react": "18.3.1",
"react-native": "0.75.2",
"tsup": "^8.2.4",
"typescript": "^5.5.4"
}
}
7 changes: 7 additions & 0 deletions react-native-is-edge-to-edge/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Platform, TurboModuleRegistry } from "react-native";

// Edge-to-edge is enabled by default on all platforms, expected android
const enabled =
Platform.OS !== "android" || TurboModuleRegistry.get("RNEdgeToEdge") != null;

export const isEdgeToEdge = () => enabled;
5 changes: 5 additions & 0 deletions react-native-is-edge-to-edge/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "../tsconfig.json",
"include": ["src"],
"exclude": ["node_modules"]
}
11 changes: 11 additions & 0 deletions react-native-is-edge-to-edge/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: { index: "src/index.ts" },
format: ["cjs", "esm"],
target: "es2017",
clean: true,
dts: true,
sourcemap: true,
treeshake: true,
});
Loading

0 comments on commit 4c5edee

Please sign in to comment.