Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ jobs:
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
-Dsonar.sonar.sourceEncoding=UTF-8
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.coverage.exclusions=**/storage/**,**/**.config.js,**/*.test.tsx,**/icons/**,**/docs/**,**/cli/**,**/__mocks__/**,**/android/**,**/ios/**,env.js
-Dsonar.coverage.exclusions=**/node_modules/**,**/storage/**,**/**.config.js,**/*.test.ts,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx,**/icons/**,**/docs/**,**/cli/**,**/android/**,**/ios/**,env.js
-Dsonar.exclusions=,**/__mocks__/**
19 changes: 5 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,11 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "astro-build.astro-vscode"
},
"cSpell.words": [
"Flashlist",
"Lato",
"rootstrap"
],
"i18n-ally.localesPaths": [
"src/translations/"
],
"cSpell.words": ["Flashlist", "Lato", "rootstrap"],
"i18n-ally.localesPaths": ["src/translations/"],
"i18n-ally.keystyle": "nested",
"i18n-ally.disabled": false, // make sure to disable i18n-ally in your global setting and only enable it for such projects
"tailwindCSS.experimental.classRegex": [
[
"tv\\(([^)]*)\\)",
"[\"'`]([^\"'`]*).*?[\"'`]"
]
],
}
["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
]
}
10 changes: 9 additions & 1 deletion __mocks__/@gorhom/bottom-sheet.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
module.exports = require('@gorhom/bottom-sheet/mock');
import { View } from 'react-native';

module.exports = {
...require('@gorhom/bottom-sheet/mock'),
SCROLLABLE_TYPE: {
SCROLLVIEW: 'ScrollView',
},
createBottomSheetScrollableComponent: jest.fn(() => View),
};
1 change: 1 addition & 0 deletions __mocks__/react-native-keyboard-controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('react-native-keyboard-controller/jest');
8 changes: 0 additions & 8 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
],
'expo-localization',
'expo-router',
[
'expo-build-properties',
{
android: {
kotlinVersion: '1.7.22', // this is for softinput package
},
},
],
[
'app-icon-badge',
{
Expand Down
23 changes: 9 additions & 14 deletions docs/src/content/docs/ui-and-theme/Forms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,14 @@ Any Component with props that inherit from the `InputControllerType` can be used

## Handling Keyboard

The template comes with [`react-native-avoid-softinput`](https://mateusz1913.github.io/react-native-avoid-softinput/) pre-installed and configured to handle the keyboard. You only need to use the `useSoftKeyboardEffect` hook on your screen, and you're good to go.
The template comes with [`react-native-keyboard-controller`](https://kirillzyusko.github.io/react-native-keyboard-controller/) pre-installed and configured to handle the keyboard. You only need to check the [documentation](https://kirillzyusko.github.io/react-native-keyboard-controller/) and use the appropriate approach for your use case. ( note that we already added the `KeyboardProvider` to the layout in the root file)

```tsx
import React from 'react';
import { useSoftKeyboardEffect } from '@/core/keyboard';
import { LoginForm } from './login-form';

export const Login = () => {
useSoftKeyboardEffect();
return <LoginForm />;
};
```
Make sure to check the following video for more details on how to handle keyboard in react native:

:::tip
Note that the hook is not an all-in-one solution for all cases, and you might need more customization depending on your use case. So, please refer to the documentation [recipes pages](https://mateusz1913.github.io/react-native-avoid-softinput/docs/recipes/recipes-form) for more information.
:::
<div class="embed-container">
<iframe
src="https://www.youtube.com/embed/Y51mDfAhd4E?si=8uPml61z0R1hsZGy&amp;start=1139"
frameborder="0"
allowfullscreen
></iframe>
</div>
17 changes: 17 additions & 0 deletions docs/src/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,20 @@
font-weight: 600;
line-height: 1.2;
}

.embed-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
max-width: 100%;
}
.embed-container iframe,
.embed-container object,
.embed-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"prebuild": "cross-env EXPO_NO_DOTENV=1 pnpm expo prebuild",
"android": "cross-env EXPO_NO_DOTENV=1 expo run:android",
"ios": "cross-env EXPO_NO_DOTENV=1 expo run:ios",
"xcode": "xed -b ios",
"doctor": "npx expo-doctor@latest",
"preinstall": "npx only-allow pnpm",
"start:staging": "cross-env APP_ENV=staging pnpm run start",
Expand Down Expand Up @@ -49,19 +50,18 @@
"@tanstack/react-query": "^5.37.1",
"app-icon-badge": "^0.0.15",
"axios": "^1.7.1",
"expo": "~51.0.28",
"expo-build-properties": "~0.12.4",
"expo": "~51.0.31",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.23",
"expo-dev-client": "~4.0.25",
"expo-font": "~12.0.9",
"expo-image": "~1.12.13",
"expo-image": "~1.12.15",
"expo-linking": "~6.3.1",
"expo-localization": "~15.0.3",
"expo-router": "~3.5.23",
"expo-splash-screen": "0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-updates": "~0.25.21",
"expo-updates": "~0.25.24",
"i18next": "^22.5.1",
"lodash.memoize": "^4.1.2",
"moti": "^0.28.1",
Expand All @@ -72,9 +72,9 @@
"react-hook-form": "^7.51.4",
"react-i18next": "^12.3.1",
"react-native": "0.74.5",
"react-native-avoid-softinput": "^4.0.2",
"react-native-flash-message": "^0.4.2",
"react-native-gesture-handler": "~2.16.2",
"react-native-keyboard-controller": "^1.13.2",
"react-native-mmkv": "2.6.3",
"react-native-reanimated": "~3.10.1",
"react-native-restart": "0.0.27",
Expand Down Expand Up @@ -117,7 +117,7 @@
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-expo": "~51.0.3",
"jest-expo": "~51.0.4",
"jest-junit": "^16.0.0",
"lint-staged": "^13.3.0",
"metro-babel-register": "^0.73.10",
Expand All @@ -132,5 +132,5 @@
"type": "git",
"url": "git+https://github.com/obytes/react-native-template-obytes.git"
},
"packageManager": "pnpm@9.5.0"
"packageManager": "pnpm@9.8.0"
}
Loading