Skip to content

Commit

Permalink
tailwind addition
Browse files Browse the repository at this point in the history
  • Loading branch information
vanGalilea committed Feb 1, 2024
1 parent 579281f commit cccf3e1
Show file tree
Hide file tree
Showing 10 changed files with 426 additions and 35 deletions.
2 changes: 1 addition & 1 deletion apps/rn-expo-app/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Tabs} from 'expo-router';

import '../global.css';
export default function Layout() {
return (
<Tabs>
Expand Down
6 changes: 3 additions & 3 deletions apps/rn-expo-app/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {Text} from 'react-native';
import { Text, View } from "react-native";

export default function Page() {
return (
<>
<View className="flex 1 bg-amber-300">
<Text>RN Media Group</Text>
<Text>Trending</Text>
<Text>For you</Text>
<Text>Following</Text>
<Text>Listen</Text>
</>
</View>
);
}
5 changes: 4 additions & 1 deletion apps/rn-expo-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/rn-expo-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/rn-expo-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.1)
- React-logger (= 0.73.1)
- React-perflogger (= 0.73.1)
- RNReanimated (3.6.2):
- 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 @@ -1150,6 +1155,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`)
- RNVectorIcons (from `../../../node_modules/react-native-vector-icons`)
- Yoga (from `../../../node_modules/react-native/ReactCommon/yoga`)
Expand Down Expand Up @@ -1274,6 +1280,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"
RNVectorIcons:
Expand Down Expand Up @@ -1340,6 +1348,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: 93a4c84e46a85c3fc9678abd4f6923b785226ea7
React-utils: debda2c206770ee2785bdebb7f16d8db9f18838a
ReactCommon: ddb128564dcbfa0287d3d1a2d10f8c7457c971f6
RNReanimated: f3fba771d22558875411f702aaf520de2268d24b
RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2
RNVectorIcons: 210f910e834e3485af40693ad4615c1ec22fc02b
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand Down
3 changes: 2 additions & 1 deletion apps/rn-expo-app/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const {getDefaultConfig} = require('expo/metro-config');
const {withNativeWind} = require('nativewind/metro');
const path = require('path');

// Find the project and workspace directories
Expand All @@ -18,4 +19,4 @@ config.resolver.nodeModulesPaths = [
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true;

module.exports = config;
module.exports = withNativeWind(config, {input: './global.css'});
1 change: 1 addition & 0 deletions apps/rn-expo-app/nativewind-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="nativewind/types" />
6 changes: 5 additions & 1 deletion apps/rn-expo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
"expo-linking": "~6.2.2",
"expo-router": "~3.4.6",
"expo-status-bar": "~1.11.1",
"nativewind": "^4.0.23",
"react": "18.2.0",
"react-native": "0.73.1",
"react-native-reanimated": "^3.6.2",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-vector-icons": "^10.0.3"
"react-native-vector-icons": "^10.0.3",
"tailwindcss": "^3.4.1"
},
"devDependencies": {
"@babel/core": "^7.23.9",
Expand All @@ -37,6 +40,7 @@
"jest-expo": "~50.0.1",
"prettier": "^3.2.4",
"react-test-renderer": "^18.2.0",
"tailwindcss": "3.4.1",
"typescript": "^5.1.3"
},
"private": true,
Expand Down
9 changes: 9 additions & 0 deletions apps/rn-expo-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import("tailwindcss").Config} */
module.exports = {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
presets: [require("nativewind/preset")],
theme: {
extend: {},
},
plugins: [],
};
Loading

0 comments on commit cccf3e1

Please sign in to comment.