Skip to content

Commit d67db51

Browse files
yjoseasdolo
authored andcommitted
refactor: update ui folder to components/ui
1 parent 53b05d6 commit d67db51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+93
-77
lines changed

.vscode/project.code-snippets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"body": [
2828
"import React from 'react';",
2929
"",
30-
"import { Text, View } from '@/ui';",
30+
"import { Text, View } from '@/components/ui';",
3131
"",
3232
"type Props = {",
3333
" $2",

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function (api) {
1212
root: ['./'],
1313
alias: {
1414
'@': './src',
15-
'@env': './src/core/env.js',
15+
'@env': './src/lib/env.js',
1616
},
1717
extensions: [
1818
'.ios.ts',

docs/src/content/docs/getting-started/environment-vars-config.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Code from '../../../components/code.astro';
1010

1111
Managing environment variables in your project is an essential task, but it can also be challenging. That's why we have included a complete setup for environment variables in this project. This setup comes with validation and type-checking using the `zod` library.
1212

13-
All the code related to environment variables is located in the `env.js` and `src/core/env.js` files. The `env.js` read the `APP_ENV` variable and loads the correct `.env` file, then defines the `zod` schema for the environment variables for client and build-time, parses the `_env` object, and returns the parsed object, or throws errors in case of invalid or missing variables.
13+
All the code related to environment variables is located in the `env.js` and `src/lib/env.js` files. The `env.js` read the `APP_ENV` variable and loads the correct `.env` file, then defines the `zod` schema for the environment variables for client and build-time, parses the `_env` object, and returns the parsed object, or throws errors in case of invalid or missing variables.
1414

1515
To increase security, we are splitting environment variables into two parts:
1616

@@ -90,7 +90,7 @@ export const client = axios.create({
9090
```
9191

9292
:::note[Important]
93-
Using `import { Env } from '@env';` will import the env from the `src/core/env.js` file, which export client only env vars.
93+
Using `import { Env } from '@env';` will import the env from the `src/lib/env.js` file, which export client only env vars.
9494
:::
9595

9696
6. Use `APP_ENV` to load the correct `.env` file :
@@ -147,7 +147,7 @@ Now it's as easy as importing `Env` , `ClientEnv` and `withEnvSuffix` from the `
147147
148148
Here, we added a separate file to export all variables that have already been passed in the `extra` property to the client side. We added a little bit of magic to make it type-safe and easy to use.
149149
150-
<Code file="src/core/env.js" />
150+
<Code file="src/lib/env.js" />
151151
152152
Now the environment variables are ready to use in your project. You can access them in your code by importing `Env` from `@env` and using it like this:
153153

docs/src/content/docs/getting-started/project-structure.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you open the new project in VSCode you will see the following structure:
3535
- settings/
3636
- title.tsx
3737
- typography.tsx
38-
- core ## core files such as auth, localization, storage and more
38+
- lib ## core files such as auth, localization, storage and more
3939
- auth
4040
- env.js
4141
- hooks

docs/src/content/docs/guides/authentication.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Zustand works very well with TypeScript and can be easily used outside the React
2020

2121
As mentioned earlier, we use Zustand to manage the authentication state of the application. The authentication store is located in `src/store/auth` and is utilized for managing the authentication state of the application.
2222

23-
<CodeBlock file="src/core/auth/index.tsx" />
23+
<CodeBlock file="src/lib/auth/index.tsx" />
2424

2525
The store is composed of 2 states and 3 actions:
2626

@@ -32,7 +32,7 @@ The store is composed of 2 states and 3 actions:
3232

3333
- `useToken`: The token of the user. It is used to authenticate the user to the API. It is stored in the storage of the device and we use it to hydrate the authentication status state when the application is started.
3434

35-
For the Demo app `useToken` is a simple object that contains the `accessToken` and the `refreshToken`. You can add more fields if you update the `TokenType` type in `src/core/auth/utils.ts`.
35+
For the Demo app `useToken` is a simple object that contains the `accessToken` and the `refreshToken`. You can add more fields if you update the `TokenType` type in `src/lib/auth/utils.ts`.
3636

3737
- `signIn`: TThe function performs user sign-in. It accepts a token as a parameter, sets the token state, stores it locally, and updates the status to `signIn`.
3838

docs/src/content/docs/guides/internationalization.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ The starter comes with a basic internationalization setup. It uses [expo-localiz
1212

1313
## Adding a new language
1414

15-
Mainly the demo app supports two languages: English and Arabic (RTL). You can add more languages by adding the translation files in the `src/translations` folder and adding the language code to the `src/core/i18n/resources.ts` file.
15+
Mainly the demo app supports two languages: English and Arabic (RTL). You can add more languages by adding the translation files in the `src/translations` folder and adding the language code to the `src/lib/i18n/resources.ts` file.
1616

17-
<CodeBlock file="src/core/i18n/resources.ts" />
17+
<CodeBlock file="src/lib/i18n/resources.ts" />
1818

1919
:::tip
20-
Anything related to internationalization should be found in the `src/core/i18n` folder.
20+
Anything related to internationalization should be found in the `src/lib/i18n` folder.
2121
:::
2222

2323
## Using translations in your app
@@ -30,7 +30,7 @@ The i18n core module provides a set of utility functions to help you use transla
3030
import React from 'react';
3131
import { useTranslation } from 'react-i18next';
3232

33-
import { Text } from '@/ui';
33+
import { Text } from '@/components/ui';
3434

3535
export const Foo = () => {
3636
const { t } = useTranslation();
@@ -47,7 +47,7 @@ or as `Text` component comes with translation support, you can easily use it as
4747
```tsx
4848
import React from 'react';
4949

50-
import { Text } from '@/ui';
50+
import { Text } from '@/components/ui';
5151

5252
export const Foo = () => {
5353
return <Text className="text-center" tx="settings.language" />;
@@ -58,7 +58,7 @@ export const Foo = () => {
5858

5959
Additionally, the `useSetLanguage` hook will save the selected language in device storage using `MMKV` and will be used as the default language when the app is opened again As well as adding some extra config for RTL languages while updating the selected language.
6060

61-
<CodeBlock file="src/core/i18n/utils.tsx" />
61+
<CodeBlock file="src/lib/i18n/utils.tsx" />
6262

6363
## Robust translation
6464

docs/src/content/docs/guides/storage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ import CodeBlock from '../../../components/code.astro';
1212

1313
The starter comes with a simple storage module that uses [react-native-mmkv](https://github.com/mrousavy/react-native-mmkv) to store data in a key-value format. We also added a simple storage utility to assist you in using the storage module.
1414

15-
<CodeBlock file="src/core/storage.tsx" />
15+
<CodeBlock file="src/lib/storage.tsx" />
1616

1717
The `react-native-mmkv` library provides various features such as using hooks and adding encryption to stored data. Feel free to check the [official docs](https://github.com/mrousavy/react-native-mmkv) for more information.

docs/src/content/docs/recipes/sentry-setup.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ The starter kit did not come with Sentry pre-configured, but it's very easy to s
132132
```
133133

134134
8. Now you are ready to initialize Sentry in your app.
135-
Create a new file `src/core/sentry.ts` and add the following code:
135+
Create a new file `src/lib/sentry.ts` and add the following code:
136136

137-
```tsx title='src/core/sentry.ts'
137+
```tsx title='src/lib/sentry.ts'
138138
import { useNavigationContainerRef } from 'expo-router';
139139
import { useEffect } from 'react';
140140
import * as Sentry from '@sentry/react-native';

docs/src/content/docs/testing/unit-testing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ As you may notice from the code, we are importing a bunch of things from the `@/
4646
:::tip
4747
You can update this file to add any other providers you need to wrap your components with as well as any other utility functions you need to use in your tests.
4848

49-
<CodeBlock file="src/core/test-utils.tsx" />
49+
<CodeBlock file="src/lib/test-utils.tsx" />
5050

5151
use `setup` function in case you need to test interactions with the component. It returns a user (userEvent) object that you can use to interact with the component.
5252
:::

docs/src/content/docs/ui-and-theme/Forms.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import { useForm } from 'react-hook-form';
5757
import z from 'zod';
5858

5959
import { useAuth } from '@/lib';
60-
import { Button, ControlledInput, View } from '@/ui';
60+
import { Button, ControlledInput, View } from '@/components/ui';
6161

6262
const schema = z.object({
6363
email: z.string().email(),

0 commit comments

Comments
 (0)