diff --git a/templates/app/react-native/.expo-shared/assets.json b/templates/app/react-native/.expo-shared/assets.json
new file mode 100644
index 0000000000..1e6decfbb5
--- /dev/null
+++ b/templates/app/react-native/.expo-shared/assets.json
@@ -0,0 +1,4 @@
+{
+ "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
+ "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
+}
diff --git a/templates/app/react-native/.gitignore b/templates/app/react-native/.gitignore
index c409cf6af4..ec8a36a257 100644
--- a/templates/app/react-native/.gitignore
+++ b/templates/app/react-native/.gitignore
@@ -1,5 +1,6 @@
-node_modules/**/*
-.expo/*
+node_modules/
+.expo/
+dist/
npm-debug.*
*.jks
*.p8
@@ -8,7 +9,6 @@ npm-debug.*
*.mobileprovision
*.orig.*
web-build/
-web-report/
# macOS
.DS_Store
diff --git a/templates/app/react-native/App.js b/templates/app/react-native/App.js
index 7f8330f775..6505569f2b 100644
--- a/templates/app/react-native/App.js
+++ b/templates/app/react-native/App.js
@@ -1,39 +1,101 @@
-import { Ionicons } from '@expo/vector-icons';
-import * as Font from 'expo-font';
-import { StyleProvider } from 'native-base';
-import React, { useEffect, useState } from 'react';
+import { NavigationContainer } from '@react-navigation/native';
+import { createNativeStackNavigator } from '@react-navigation/native-stack';
+import i18n from 'i18n-js';
+import { NativeBaseProvider } from 'native-base';
+import React, { useEffect, useMemo, useState } from 'react';
import { enableScreens } from 'react-native-screens';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
-import AppContainer from './src/components/AppContainer/AppContainer';
+import { getEnvVars } from './Environment';
+import Loading from './src/components/Loading/Loading';
+import { LocalizationContext } from './src/contexts/LocalizationContext';
import { initAPIInterceptor } from './src/interceptors/APIInterceptor';
+import AuthNavigator from './src/navigators/AuthNavigator';
+import DrawerNavigator from './src/navigators/DrawerNavigator';
import { persistor, store } from './src/store';
-import getTheme from './src/theme/components';
-import { activeTheme } from './src/theme/variables';
+import AppActions from './src/store/actions/AppActions';
+import PersistentStorageActions from './src/store/actions/PersistentStorageActions';
+import { createLanguageSelector } from './src/store/selectors/AppSelectors';
+import { createTokenSelector } from './src/store/selectors/PersistentStorageSelectors';
+import { connectToRedux } from './src/utils/ReduxConnect';
+import { isTokenValid } from './src/utils/TokenUtils';
+
+const Stack = createNativeStackNavigator();
+
+const { localization } = getEnvVars();
+
+i18n.defaultSeparator = '::';
+
+const cloneT = i18n.t;
+i18n.t = (key, ...args) => {
+ if (key.slice(0, 2) === '::') {
+ key = localization.defaultResourceName + key;
+ }
+ return cloneT(key, ...args);
+};
enableScreens();
initAPIInterceptor(store);
export default function App() {
+ const language = createLanguageSelector()(store.getState());
const [isReady, setIsReady] = useState(false);
+ const localizationContextValue = useMemo(
+ () => ({
+ t: i18n.t,
+ locale: (language || {}).cultureName,
+ }),
+ [language]
+ );
+
useEffect(() => {
- Font.loadAsync({
- Roboto: require('native-base/Fonts/Roboto.ttf'),
- Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
- ...Ionicons.font,
- }).then(() => setIsReady(true));
+ store.dispatch(
+ AppActions.fetchAppConfigAsync({
+ callback: () => setIsReady(true),
+ showLoading: true,
+ })
+ );
}, []);
return (
-
-
- {isReady ? (
-
-
-
- ) : null}
-
-
+
+
+
+
+ {isReady ? (
+
+
+
+ ) : null}
+
+
+
+
+
);
}
+
+function AppContainer({token, setToken}) {
+ const isValid = useMemo(() => isTokenValid(token), [token]);
+
+ useEffect(() => {
+ if (!isValid && token && token.access_token) {
+ setToken({})
+ }
+ }, [isValid]);
+
+
+ return isValid ? :
+}
+
+
+const ConnectedAppContainer = connectToRedux({
+ component: AppContainer,
+ stateProps: (state) => ({
+ token: createTokenSelector()(state),
+ }),
+ dispatchProps: {
+ setToken: PersistentStorageActions.setToken,
+ },
+});
diff --git a/templates/app/react-native/app.json b/templates/app/react-native/app.json
index 9bfd9cdad8..5b78afa519 100644
--- a/templates/app/react-native/app.json
+++ b/templates/app/react-native/app.json
@@ -21,7 +21,11 @@
},
"android": {
"package": "com.MyCompanyName.MyProjectName",
- "versionCode": 1
+ "versionCode": 1,
+ "adaptiveIcon": {
+ "foregroundImage": "./assets/adaptive-icon.png",
+ "backgroundColor": "#FFFFFF"
+ }
},
"web": {
"favicon": "./assets/icon.png"
diff --git a/templates/app/react-native/assets/adaptive-icon.png b/templates/app/react-native/assets/adaptive-icon.png
new file mode 100644
index 0000000000..03d6f6b6c6
Binary files /dev/null and b/templates/app/react-native/assets/adaptive-icon.png differ
diff --git a/templates/app/react-native/babel.config.js b/templates/app/react-native/babel.config.js
index 2900afe9d8..d715221e05 100644
--- a/templates/app/react-native/babel.config.js
+++ b/templates/app/react-native/babel.config.js
@@ -2,5 +2,6 @@ module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
+ plugins: ['react-native-reanimated/plugin'],
};
-};
+};
\ No newline at end of file
diff --git a/templates/app/react-native/package.json b/templates/app/react-native/package.json
index e13a0f1d56..e08783807c 100644
--- a/templates/app/react-native/package.json
+++ b/templates/app/react-native/package.json
@@ -1,64 +1,43 @@
{
+ "name": "myprojectname",
+ "version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
- "eject": "expo eject",
- "lint": "eslint *.js **/*.js",
- "lint:fix": "yarn lint --fix"
+ "eject": "expo eject"
},
"dependencies": {
- "@expo/vector-icons": "^10.2.1",
- "@react-native-async-storage/async-storage": "^1.13.2",
- "@react-native-community/masked-view": "0.1.10",
- "@react-navigation/drawer": "^5.11.3",
- "@react-navigation/native": "^5.8.9",
- "@react-navigation/stack": "^5.12.6",
- "@reduxjs/toolkit": "^1.4.0",
- "axios": "^0.21.0",
- "color": "^3.1.3",
- "expo": "~39.0.4",
- "expo-constants": "~9.2.0",
- "expo-font": "~8.3.0",
- "expo-status-bar": "~1.0.2",
- "formik": "^2.2.5",
+ "@react-native-async-storage/async-storage": "~1.15.0",
+ "@react-navigation/drawer": "^6.1.8",
+ "@react-navigation/native": "^6.0.6",
+ "@react-navigation/native-stack": "^6.2.5",
+ "@reduxjs/toolkit": "^1.7.1",
+ "axios": "^0.24.0",
+ "expo": "~44.0.0",
+ "expo-status-bar": "~1.2.0",
+ "formik": "^2.2.9",
"i18n-js": "^3.8.0",
- "lodash": "^4.17.20",
- "native-base": "2.13.14",
- "prop-types": "^15.7.2",
+ "native-base": "^3.3.1",
+ "prop-types": "^15.8.1",
"react": "17.0.1",
"react-dom": "17.0.1",
- "react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
- "react-native-gesture-handler": "~1.7.0 ",
- "react-native-reanimated": "~1.13.2",
- "react-native-safe-area-context": "3.1.4",
- "react-native-safe-area-view": "^1.1.1",
- "react-native-screens": "~2.10.1",
- "react-native-web": "~0.14.8",
- "react-redux": "^7.2.2",
+ "react-native": "0.64.3",
+ "react-native-gesture-handler": "~2.1.0",
+ "react-native-reanimated": "~2.3.1",
+ "react-native-safe-area-context": "3.3.2",
+ "react-native-screens": "~3.10.1",
+ "react-native-svg": "12.1.1",
+ "react-native-web": "0.17.1",
+ "react-redux": "^7.2.6",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",
- "reselect": "^4.0.0",
- "yup": "^0.29.3"
+ "yup": "^0.32.11"
},
"devDependencies": {
- "@babel/core": "~7.12.3",
- "@types/i18n-js": "^3.0.3",
- "@types/react": "~16.9.56",
- "@types/react-native": "~0.63.35",
- "@types/react-redux": "^7.1.11",
- "@types/yup": "^0.29.9",
- "babel-eslint": "~10.1.0",
- "babel-preset-expo": "~8.3.0",
- "eslint": "^7.13.0",
- "eslint-config-airbnb": "^18.2.1",
- "eslint-config-prettier": "^6.15.0",
- "eslint-plugin-import": "^2.22.1",
- "eslint-plugin-jsx-a11y": "^6.4.1",
- "eslint-plugin-react": "^7.21.5",
- "prettier": "^2.1.2"
+ "@babel/core": "^7.12.9"
},
"private": true
}
diff --git a/templates/app/react-native/src/api/AccountAPI.js b/templates/app/react-native/src/api/AccountAPI.js
index 913909281d..af303b626a 100644
--- a/templates/app/react-native/src/api/AccountAPI.js
+++ b/templates/app/react-native/src/api/AccountAPI.js
@@ -3,17 +3,16 @@ import { getEnvVars } from '../../Environment';
const { oAuthConfig } = getEnvVars();
-export const login = ({ username, password }) => {
- return api({
+export const login = ({ username, password }) =>
+ api({
method: 'POST',
url: '/connect/token',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
data: `grant_type=password&scope=${oAuthConfig.scope}&username=${username}&password=${password}&client_id=${oAuthConfig.clientId}&client_secret=${oAuthConfig.clientSecret}`,
baseURL: oAuthConfig.issuer,
- }).then(({ data }) => data)
-};
+ }).then(({ data }) => data);
-export const logout = () =>
+export const Logout = () =>
api({
method: 'GET',
url: '/api/account/logout',
diff --git a/templates/app/react-native/src/api/AuditLoggingAPI.js b/templates/app/react-native/src/api/AuditLoggingAPI.js
new file mode 100644
index 0000000000..0fd8d1d86f
--- /dev/null
+++ b/templates/app/react-native/src/api/AuditLoggingAPI.js
@@ -0,0 +1,7 @@
+import api from './API';
+
+export function getErrorRateStatistics(params = {}) {
+ return api
+ .get('/api/audit-logging/audit-logs/statistics/error-rate', { params })
+ .then(({ data }) => data);
+}
diff --git a/templates/app/react-native/src/api/IdentityAPI.js b/templates/app/react-native/src/api/IdentityAPI.js
index 45e191033c..9ae81ad2b5 100644
--- a/templates/app/react-native/src/api/IdentityAPI.js
+++ b/templates/app/react-native/src/api/IdentityAPI.js
@@ -1,6 +1,5 @@
import api from './API';
-export const getProfileDetail = () => api.get('/api/identity/my-profile').then(({ data }) => data);
export const getAllRoles = () => api.get('/api/identity/roles/all').then(({ data }) => data.items);
@@ -19,8 +18,10 @@ export const updateUser = (body, id) =>
export const removeUser = id => api.delete(`/api/identity/users/${id}`);
+export const getProfileDetail = () => api.get('/api/account/my-profile').then(({ data }) => data);
+
export const updateProfileDetail = body =>
- api.put('/api/identity/my-profile', body).then(({ data }) => data);
+ api.put('/api/account/my-profile', body).then(({ data }) => data);
export const changePassword = body =>
- api.post('/api/identity/my-profile/change-password', body).then(({ data }) => data);
+ api.post('/api/account/my-profile/change-password', body).then(({ data }) => data);
diff --git a/templates/app/react-native/src/components/AddIcon/AddIcon.js b/templates/app/react-native/src/components/AddIcon/AddIcon.js
new file mode 100644
index 0000000000..b4cc26f36f
--- /dev/null
+++ b/templates/app/react-native/src/components/AddIcon/AddIcon.js
@@ -0,0 +1,16 @@
+import { Ionicons } from '@expo/vector-icons';
+import { Icon } from 'native-base';
+import React from 'react';
+
+export default function AddIcon({ onPress, ...iconProps }) {
+ return (
+
+ );
+}
diff --git a/templates/app/react-native/src/components/AppContainer/AppContainer.js b/templates/app/react-native/src/components/AppContainer/AppContainer.js
deleted file mode 100644
index 3879c54844..0000000000
--- a/templates/app/react-native/src/components/AppContainer/AppContainer.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NavigationContainer } from '@react-navigation/native';
-import i18n from 'i18n-js';
-import { Root } from 'native-base';
-import PropTypes from 'prop-types';
-import React, { useEffect, useMemo } from 'react';
-import { Platform, StatusBar } from 'react-native';
-import { getEnvVars } from '../../../Environment';
-import { LocalizationContext } from '../../contexts/LocalizationContext';
-import AuthNavigator from '../../navigators/AuthNavigator';
-import DrawerNavigator from '../../navigators/DrawerNavigator';
-import AppActions from '../../store/actions/AppActions';
-import PersistentStorageActions from '../../store/actions/PersistentStorageActions';
-import { createLanguageSelector } from '../../store/selectors/AppSelectors';
-import { createTokenSelector } from '../../store/selectors/PersistentStorageSelectors';
-import { connectToRedux } from '../../utils/ReduxConnect';
-import { isTokenValid } from '../../utils/TokenUtils';
-import Loading from '../Loading/Loading';
-
-const { localization } = getEnvVars();
-
-i18n.defaultSeparator = '::';
-
-const cloneT = i18n.t;
-i18n.t = (key, ...args) => {
- if (key.slice(0, 2) === '::') {
- key = localization.defaultResourceName + key;
- }
- return cloneT(key, ...args);
-};
-
-function AppContainer({ language, fetchAppConfig, token, setToken }) {
- const platform = Platform.OS;
-
- const localizationContext = useMemo(
- () => ({
- t: i18n.t,
- locale: (language || {}).cultureName,
- }),
- [language],
- );
-
- const isValid = useMemo(() => isTokenValid(token), [token]);
-
- useEffect(() => {
- if (!isValid && token && token.access_token) {
- setToken({});
- }
- }, [isValid]);
-
- useEffect(() => {
- fetchAppConfig();
- }, []);
-
- return (
- <>
-
-
- {language ? (
-
-
- {isValid ? : }
-
-
- ) : null}
-
-
- >
- );
-}
-
-AppContainer.propTypes = {
- language: PropTypes.object,
- token: PropTypes.object.isRequired,
- fetchAppConfig: PropTypes.func.isRequired,
- setToken: PropTypes.func.isRequired,
-};
-
-export default connectToRedux({
- component: AppContainer,
- stateProps: state => ({
- language: createLanguageSelector()(state),
- token: createTokenSelector()(state),
- }),
- dispatchProps: {
- fetchAppConfig: AppActions.fetchAppConfigAsync,
- setToken: PersistentStorageActions.setToken,
- },
-});
diff --git a/templates/app/react-native/src/components/DataList/DataList.js b/templates/app/react-native/src/components/DataList/DataList.js
index 7c837ec83f..9dce6d9562 100644
--- a/templates/app/react-native/src/components/DataList/DataList.js
+++ b/templates/app/react-native/src/components/DataList/DataList.js
@@ -1,17 +1,16 @@
+import { Ionicons } from '@expo/vector-icons';
import { useFocusEffect } from '@react-navigation/native';
import i18n from 'i18n-js';
-import { connectStyle, Icon, Input, InputGroup, Item, List, Spinner, Text } from 'native-base';
+import { Box, Center, FlatList, Icon, Input, Spinner, Text } from 'native-base';
import PropTypes from 'prop-types';
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
-import { RefreshControl, StyleSheet, View } from 'react-native';
+import { StyleSheet, View } from 'react-native';
import LoadingActions from '../../store/actions/LoadingActions';
-import { activeTheme } from '../../theme/variables';
import { debounce } from '../../utils/Debounce';
import { connectToRedux } from '../../utils/ReduxConnect';
import LoadingButton from '../LoadingButton/LoadingButton';
function DataList({
- style,
navigation,
fetchFn,
render,
@@ -44,56 +43,67 @@ function DataList({
if (loading || records.length === totalCount) return;
setButtonLoading(true);
- fetch(skipCount + maxResultCount, false).finally(() => setButtonLoading(false));
+ fetch(skipCount + maxResultCount, false).finally(() =>
+ setButtonLoading(false)
+ );
};
useFocusEffect(
useCallback(() => {
setSkipCount(0);
fetch(0, false);
- }, []),
+ }, [])
);
useEffect(() => {
function searchFetch() {
setSearchLoading(true);
- return fetch(0, false).finally(() => setTimeout(() => setSearchLoading(false), 150));
+ return fetch(0, false).finally(() =>
+ setTimeout(() => setSearchLoading(false), 150)
+ );
}
debounce(searchFetch, debounceTime)();
}, [filter]);
return (
- <>
- -
-
-
- {searchLoading ? (
-
-
-
- ) : (
-
- )}
-
-
-
-
}
- dataArray={records}
- renderRow={(data, sectionID, rowId, ...args) => (
+
+
+
+ ) : (
+
+ )
+ }
+ />
+ (
<>
- {render(data, sectionID, rowId, ...args)}
- {rowId + 1 === skipCount + maxResultCount && totalCount > records.length ? (
-
- fetchPartial()}>
+ {render(...args)}
+ {args.index + 1 === skipCount + maxResultCount &&
+ totalCount > records.length ? (
+
+ fetchPartial()}
+ >
{i18n.t('AbpUi::LoadMore')}
@@ -102,14 +112,13 @@ function DataList({
)}
{...props}
/>
-
- >
+
+
);
}
DataList.propTypes = {
- ...List.propTypes,
- style: PropTypes.any.isRequired,
+ ...FlatList.propTypes,
fetchFn: PropTypes.func.isRequired,
render: PropTypes.func.isRequired,
maxResultCount: PropTypes.number,
@@ -119,19 +128,14 @@ DataList.propTypes = {
const styles = StyleSheet.create({
container: { flex: 1 },
list: {},
- spinner: {
- transform: [{ scale: 0.5 }],
- position: 'absolute',
- right: 8,
- top: -40,
- color: activeTheme.brandInfo,
- },
});
-const Forwarded = forwardRef((props, ref) => );
+const Forwarded = forwardRef((props, ref) => (
+
+));
export default connectToRedux({
- component: connectStyle('ABP.DataList', styles)(Forwarded),
+ component: Forwarded,
dispatchProps: {
startLoading: LoadingActions.start,
stopLoading: LoadingActions.stop,
diff --git a/templates/app/react-native/src/components/DrawerContent/DrawerContent.js b/templates/app/react-native/src/components/DrawerContent/DrawerContent.js
index 1725abaee3..598f05a8c7 100644
--- a/templates/app/react-native/src/components/DrawerContent/DrawerContent.js
+++ b/templates/app/react-native/src/components/DrawerContent/DrawerContent.js
@@ -1,73 +1,65 @@
-import { Text, View, List, ListItem, Left, Icon, Body } from 'native-base';
-import React from 'react';
-import { Image, StyleSheet } from 'react-native';
-import SafeAreaView from 'react-native-safe-area-view';
+import { Ionicons } from '@expo/vector-icons';
+import Constants from 'expo-constants';
import i18n from 'i18n-js';
+import { List, Text, View } from 'native-base';
import PropTypes from 'prop-types';
-import Constants from 'expo-constants';
+import React from 'react';
+import { Image, StyleSheet } from 'react-native';
+import { SafeAreaView } from 'react-native-safe-area-context';
import { withPermission } from '../../hocs/PermissionHOC';
const screens = {
- Home: { label: '::Menu:Home', iconName: 'home' },
- Users: {
+ HomeStack: { label: '::Menu:Home', iconName: 'home' },
+ UsersStack: {
label: 'AbpIdentity::Users',
- iconName: 'contacts',
+ iconName: 'people',
requiredPolicy: 'AbpIdentity.Users',
},
- Tenants: {
+ TenantsStack: {
label: 'AbpTenantManagement::Tenants',
- iconName: 'people',
+ iconName: 'book-outline',
requiredPolicy: 'AbpTenantManagement.Tenants',
},
- Settings: { label: 'AbpSettingManagement::Settings', iconName: 'cog' },
+ SettingsStack: { label: 'AbpSettingManagement::Settings', iconName: 'cog' },
};
-const ListItemWithPermission = withPermission(ListItem);
+const ListItemWithPermission = withPermission(List.Item);
-function DrawerContent({ navigation, state: { routeNames, index: currentScreenIndex } }) {
- const navigate = screen => {
+function DrawerContent({
+ navigation,
+ state: { routeNames, index: currentScreenIndex },
+}) {
+ const navigate = (screen) => {
navigation.navigate(screen);
navigation.closeDrawer();
};
return (
-
+
-
+
- item}
- renderRow={name => (
+
+ {routeNames.map((name) => (
navigate(name)}
- style={{
- ...styles.navItem,
- backgroundColor: name === routeNames[currentScreenIndex] ? '#38003c' : '#f2f2f2',
- }}>
-
-
-
-
-
- {i18n.t(screens[name].label)}
-
-
+ my="0"
+ >
+
+ {i18n.t(screens[name].label)}
- )}
- />
+ ))}
+
@@ -90,17 +82,8 @@ const styles = StyleSheet.create({
marginBottom: 15,
},
headerView: {
- borderBottomWidth: 1,
- borderColor: '#eee',
alignItems: 'center',
},
- navItem: {
- marginLeft: 0,
- marginBottom: 3,
- paddingLeft: 10,
- width: '100%',
- backgroundColor: '#f2f2f2',
- },
footer: {
backgroundColor: '#eee',
flexDirection: 'row',
diff --git a/templates/app/react-native/src/components/FormButtons/FormButtons.js b/templates/app/react-native/src/components/FormButtons/FormButtons.js
index 5bbdb388f8..d844f7747a 100644
--- a/templates/app/react-native/src/components/FormButtons/FormButtons.js
+++ b/templates/app/react-native/src/components/FormButtons/FormButtons.js
@@ -1,11 +1,10 @@
-import React, { forwardRef } from 'react';
-import PropTypes from 'prop-types';
-import { Button, Text, connectStyle } from 'native-base';
-import { View, StyleSheet, Alert } from 'react-native';
import i18n from 'i18n-js';
+import { Button, Text } from 'native-base';
+import PropTypes from 'prop-types';
+import React, { forwardRef } from 'react';
+import { Alert, StyleSheet, View } from 'react-native';
function FormButtons({
- style,
submit,
remove,
removeMessage,
@@ -30,11 +29,10 @@ function FormButtons({
};
return (
-
+
{isShowRemove ? (
diff --git a/templates/app/react-native/src/screens/Tenants/TenantsScreen.js b/templates/app/react-native/src/screens/Tenants/TenantsScreen.js
index e937175dfa..da3dac53af 100644
--- a/templates/app/react-native/src/screens/Tenants/TenantsScreen.js
+++ b/templates/app/react-native/src/screens/Tenants/TenantsScreen.js
@@ -1,38 +1,44 @@
+import { Box, HStack, Pressable, Text } from 'native-base';
import React from 'react';
-import i18n from 'i18n-js';
-import { ListItem, Text, Icon, Left, Body, Fab } from 'native-base';
-import { StyleSheet } from 'react-native';
import { getTenants } from '../../api/TenantManagementAPI';
-import { activeTheme } from '../../theme/variables';
import DataList from '../../components/DataList/DataList';
-import { withPermission } from '../../hocs/PermissionHOC';
-
-const CreateTenantButtonWithPermission = withPermission(Fab, 'AbpTenantManagement.Tenants.Create');
+import { LocalizationContext } from '../../contexts/LocalizationContext';
function TenantsScreen({ navigation }) {
+ const { t } = React.useContext(LocalizationContext);
+
return (
- <>
+
);
}
@@ -42,18 +48,4 @@ const navigateToCreateUpdateTenantScreen = (navigation, tenant = {}) => {
});
};
-const styles = StyleSheet.create({
- listItem: {
- alignItems: 'center',
- marginVertical: 3,
- marginLeft: -15,
- paddingTop: 5,
- paddingBottom: 5,
- paddingLeft: 15,
- backgroundColor: '#f9f9f9',
- width: '110%',
- minHeight: 50,
- },
-});
-
export default TenantsScreen;
diff --git a/templates/app/react-native/src/screens/Users/UsersScreen.js b/templates/app/react-native/src/screens/Users/UsersScreen.js
index 4dc25dc646..b49658cb24 100644
--- a/templates/app/react-native/src/screens/Users/UsersScreen.js
+++ b/templates/app/react-native/src/screens/Users/UsersScreen.js
@@ -1,40 +1,55 @@
+import { Box, HStack, Pressable, Text } from 'native-base';
import React from 'react';
-import { ListItem, Text, Icon, Left, Thumbnail, Body, Fab } from 'native-base';
-import { StyleSheet } from 'react-native';
import { getUsers } from '../../api/IdentityAPI';
-import { activeTheme } from '../../theme/variables';
import DataList from '../../components/DataList/DataList';
-import { withPermission } from '../../hocs/PermissionHOC';
-
-const CreateUserButtonWithPermission = withPermission(Fab, 'AbpIdentity.Users.Create');
+import { LocalizationContext } from '../../contexts/LocalizationContext';
function UsersScreen({ navigation }) {
+ const { t } = React.useContext(LocalizationContext);
+
return (
- <>