Skip to content

Commit

Permalink
feat: added absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
burhanyilmaz committed Jan 7, 2024
1 parent 71f2c6c commit 5f4ad2e
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 6 deletions.
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ yarn-error.*

# typescript
*.tsbuildinfo

# cache
.eslintcache
2 changes: 2 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import TestScreen from '@screens/Test';
import { StatusBar } from 'expo-status-bar';
import { Text, View } from 'react-native';

Expand All @@ -6,6 +7,7 @@ export default function App() {
<View className="flex-1 items-center justify-center bg-white">
<Text>Open up App.tsx to start working on your app!</Text>
<StatusBar style="auto" />
<TestScreen />
</View>
);
}
14 changes: 13 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ module.exports = function (api) {

return {
presets: ['babel-preset-expo'],
plugins: ['nativewind/babel'],
plugins: [
'nativewind/babel',
[
'module-resolver',
{
root: ['./src'],
alias: {
'@screens': './src/screens',
'@components': './src/components',
},
},
],
],
};
};
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@babel/core": "^7.20.0",
"@types/react": "~18.2.14",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"babel-plugin-module-resolver": "^5.0.0",
"eslint": "^8.56.0",
"eslint-config-standard-with-typescript": "^43.0.0",
"eslint-config-universe": "^12.0.0",
Expand Down
14 changes: 14 additions & 0 deletions src/components/core/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Text, TouchableOpacity } from 'react-native';

type Props = {
title: string;
onPress?: () => object;
};

const Button = ({ title, onPress }: Props) => (
<TouchableOpacity onPress={onPress} className="px-6 py-2.5 bg-slate-500 rounded-md">
<Text className="text-white text-base">{title}</Text>
</TouchableOpacity>
);

export default Button;
2 changes: 2 additions & 0 deletions src/screens/Test/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import Button from '@components/core/Button';
import { Text, View } from 'react-native';

const TestScreen = () => (
<View>
<Text>TestScreen</Text>
<Button title="Press me!" />
</View>
);

Expand Down
5 changes: 2 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./App.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}"],
content: ['./App.{js,jsx,ts,tsx}', './src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
}

};
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
"strict": true,
"baseUrl": "./src",
"paths": {
"@screens/*":["./screens/*"],
"@components/*": ["./components/*"]
}
}
}

0 comments on commit 5f4ad2e

Please sign in to comment.