Skip to content
This repository was archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
added nativewind
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonLoir committed Feb 21, 2024
1 parent f559510 commit 71131fe
Show file tree
Hide file tree
Showing 9 changed files with 711 additions and 27 deletions.
2 changes: 2 additions & 0 deletions apps/app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,7 @@ dependencies {
}
}

project.ext["REACT_NATIVE_NODE_MODULES_DIR"] = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()

apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesAppBuildGradle(project)
13 changes: 13 additions & 0 deletions apps/app/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Slot } from 'expo-router';
import { SafeAreaView } from 'react-native';

// Import your global CSS file
import '../global.css';

export default function Layout() {
return (
<SafeAreaView>
<Slot />
</SafeAreaView>
);
}
10 changes: 8 additions & 2 deletions apps/app/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import React from 'react';
import { Text } from 'react-native';
import { Text, View } from 'react-native';
export default function App() {
return <Text>Hello world</Text>;
return (
<View>
<Text className='text-red-700'>
Hello world this is a test dd kk
</Text>
</View>
);
}
5 changes: 4 additions & 1 deletion apps/app/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: [
['babel-preset-expo', { jsxImportSource: 'nativewind' }],
'nativewind/babel',
],
};
};
3 changes: 3 additions & 0 deletions apps/app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
9 changes: 9 additions & 0 deletions apps/app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,11 @@ PODS:
- React-jsi (= 0.73.4)
- React-logger (= 0.73.4)
- React-perflogger (= 0.73.4)
- RNReanimated (3.6.3):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNScreens (3.29.0):
- glog
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -1146,6 +1151,7 @@ DEPENDENCIES:
- React-runtimescheduler (from `../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
- React-utils (from `../../../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../../../node_modules/react-native/ReactCommon`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../../../node_modules/react-native-screens`)
- Yoga (from `../../../node_modules/react-native/ReactCommon/yoga`)

Expand Down Expand Up @@ -1269,6 +1275,8 @@ EXTERNAL SOURCES:
:path: "../../../node_modules/react-native/ReactCommon/react/utils"
ReactCommon:
:path: "../../../node_modules/react-native/ReactCommon"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
RNScreens:
:path: "../../../node_modules/react-native-screens"
Yoga:
Expand Down Expand Up @@ -1333,6 +1341,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: ed48e5faac6751e66ee1261c4bd01643b436f112
React-utils: 6e5ad394416482ae21831050928ae27348f83487
ReactCommon: 840a955d37b7f3358554d819446bffcf624b2522
RNReanimated: 93b32f0705e86e267a258fd545fb754daf597dcd
RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312
Expand Down
1 change: 1 addition & 0 deletions apps/app/nativewind-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="nativewind/types" />
15 changes: 9 additions & 6 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,25 @@
},
"dependencies": {
"expo": "~50.0.7",
"expo-constants": "~15.4.5",
"expo-linking": "~6.2.2",
"expo-router": "~3.4.7",
"expo-status-bar": "~1.11.1",
"nativewind": "^4.0.1",
"react": "18.2.0",
"react-native": "0.73.4",
"expo-router": "~3.4.7",
"react-native-reanimated": "~3.6.2",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"expo-linking": "~6.2.2",
"expo-constants": "~15.4.5"
"tailwindcss": "^3.4.1"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@repo/eslint-config": "^0.0.0",
"@repo/typescript-config": "^0.0.0",
"@types/react": "~18.2.45",
"eslint": "^8.56.0",
"typescript": "^5.3.3",
"@repo/eslint-config": "^0.0.0",
"@repo/typescript-config": "^0.0.0"
"typescript": "^5.3.3"
},
"private": true
}
Loading

0 comments on commit 71131fe

Please sign in to comment.