Skip to content

Commit 63a86cc

Browse files
yjoseasdolo
authored andcommitted
refactor: update to use the new ui folder
1 parent d67db51 commit 63a86cc

File tree

3 files changed

+35
-39
lines changed

3 files changed

+35
-39
lines changed

.vscode/project.code-snippets

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
"body": [
55
"<View className=\"flex-1 items-center justify-center\">",
66
" $1",
7-
"</View>"
7+
"</View>",
88
],
9-
"description": "A Simple View "
9+
"description": "A Simple View ",
1010
},
1111
"Text": {
1212
"prefix": "t",
1313
"body": [
1414
"<Text variant=\"body\" className=\"text-center\">",
1515
" $1",
16-
"</Text>"
16+
"</Text>",
1717
],
18-
"description": "A Simple Text"
18+
"description": "A Simple Text",
1919
},
2020
"export *": {
2121
"prefix": "ex *",
2222
"body": ["export * from '.$1';"],
23-
"description": "export *"
23+
"description": "export *",
2424
},
2525
"Component": {
2626
"prefix": "comp",
@@ -39,9 +39,9 @@
3939
" </View>",
4040
" );",
4141
"};",
42-
""
42+
"",
4343
],
44-
"description": "Component"
44+
"description": "Component",
4545
},
4646
// https://snippet-generator.app/?description=useQuery+with+variables&tabtrigger=useqv&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createQuery+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%27%3B%0A%0Atype+Variables+%3D+%7B%243%7D%3B%0Atype+Response+%3D+%7B%244%7D%3B%0A%0Aexport+const+use%241+%3D+createQuery%3CResponse%2C+Variables%2C+AxiosError%3E%28%7B%0A++queryKey%3A+%5B%27%242%27%5D%2C+%0A++fetcher%3A+%28variables%29+%3D%3E+%7B%0A++++return+client%0A++++++.get%28%60%242%2F%5C%5C%24%7Bvariables.%24%7B5%7D%7D%60%29%22%2C%0A++++++.then%28%28response%29+%3D%3E+response.data%29%3B%0A++%7D%2C%0A%7D%29%3B%0A&mode=vscode
4747
"useQuery with variables": {
@@ -63,9 +63,9 @@
6363
" .then((response) => response.data);",
6464
" },",
6565
"});",
66-
""
66+
"",
6767
],
68-
"description": "useQuery with variables"
68+
"description": "useQuery with variables",
6969
},
7070
//https://snippet-generator.app/?description=useQuery&tabtrigger=useq&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createQuery+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%27%3B%0A%0Atype+Response+%3D+%7B%243%7D%3B%0Atype+Variables+%3D+void%3B%0A%0Aexport+const+use%241+%3D+createQuery%3CResponse%2C+Variables%2C+AxiosError%3E%28%7B%0A++queryKey%3A+%5B%27%242%27%5D%2C%0A++fetcher%3A+%28%29+%3D%3E+%7B%0A++++return+client.get%28%60%242%60%29.then%28%28response%29+%3D%3E+response.data.posts%29%3B%0A++%7D%2C%0A%7D%29%3B%0A&mode=vscode
7171
"useQuery": {
@@ -85,9 +85,9 @@
8585
" return client.get(`$2`).then((response) => response.data.posts);",
8686
" },",
8787
"});",
88-
""
88+
"",
8989
],
90-
"description": "useQuery"
90+
"description": "useQuery",
9191
},
9292
//https://snippet-generator.app/?description=useInfiniteQuery&tabtrigger=useiq&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createInfiniteQuery+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%2Fclient%27%3B%0Aimport+%7B+DEFAULT_LIMIT%2C+getNextPageParam+%7D+from+%27..%2Fcommon%2Futils%27%3B%0Aimport+type+%7B+PaginateQuery+%7D+from+%27..%2Ftypes%27%3B%0A%0Atype+Response+%3D+void%3B%0Atype+Variables+%3D+PaginateQuery%3C%243%3E%3B%0A%0Aexport+const+use%241+%3D+createInfiniteQuery%3CResponse%2C+Variables%2C+AxiosError%3E%28%7B%0A++queryKey%3A+%5B%27%242%27%5D%2C%0A++fetcher%3A+%28_variables%3A+any%2C+%7B+pageParam+%7D%29%3A+Promise%3CResponse%3E+%3D%3E+%7B%0A++++return+client%28%7B%0A++++++url%3A+%60%2F%242%2F%60%2C%0A++++++method%3A+%27GET%27%2C%0A++++++params%3A+%7B%0A++++++++limit%3A+DEFAULT_LIMIT%2C%0A++++++++offset%3A+pageParam%2C%0A++++++%7D%2C%0A++++%7D%29.then%28%28response%29+%3D%3E+response.data%29%3B%0A++%7D%2C%0A++getNextPageParam%2C%0A++initialPageParam%3A+0%2C%0A%7D%29%3B&mode=vscode
9393
"useInfiniteQuery": {
@@ -117,9 +117,9 @@
117117
" },",
118118
" getNextPageParam,",
119119
" initialPageParam: 0,",
120-
"});"
120+
"});",
121121
],
122-
"description": "useInfiniteQuery"
122+
"description": "useInfiniteQuery",
123123
},
124124

125125
//https://snippet-generator.app/?description=useMutation+&tabtrigger=usem&snippet=import+type+%7B+AxiosError+%7D+from+%27axios%27%3B%0Aimport+%7B+createMutation+%7D+from+%27react-query-kit%27%3B%0A%0Aimport+%7B+client+%7D+from+%27..%2Fcommon%27%3B%0A%0Atype+Variables+%3D+%7B%243%7D%3B%0Atype+Response+%3D+%7B%244%7D%3B%0A%0Aexport+const+use%241+%3D+createMutation%3CResponse%2C+Variables%2C+AxiosError%3E%28%0A++async+%28variables%29+%3D%3E%0A++++client%28%7B%0A++++++url%3A+%27%242%27%2C%0A++++++method%3A+%27POST%27%2C%0A++++++data%3A+variables%2C%0A++++%7D%29.then%28%28response%29+%3D%3E+response.data%29%0A%29%3B&mode=vscode
@@ -141,13 +141,13 @@
141141
" method: 'POST',",
142142
" data: variables,",
143143
" }).then((response) => response.data)",
144-
"});"
144+
"});",
145145
],
146-
"description": "useMutation "
146+
"description": "useMutation ",
147147
},
148148
"navigate": {
149149
"prefix": "navigate",
150150
"body": ["const { navigate } = useNavigation();", ""],
151-
"description": "navigate"
152-
}
151+
"description": "navigate",
152+
},
153153
}

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ If you open the new project in VSCode you will see the following structure:
2525
- login.tsx
2626
- onboarding.tsx
2727
- components ## any reusable components
28+
- ui ## core ui and theme configuration
29+
- button.tsx
30+
- checkbox.tsx
31+
- colors.js
32+
- focus-aware-status-bar.tsx
33+
- icons
34+
- image.tsx
35+
- index.tsx
36+
- input.tsx
37+
- list.tsx
38+
- modal.tsx
39+
- progress-bar.tsx
40+
- select.tsx
41+
- text.tsx
42+
- utils.tsx
2843
- buttons.tsx
2944
- card.tsx
3045
- colors.tsx
@@ -51,29 +66,14 @@ If you open the new project in VSCode you will see the following structure:
5166
- en.json
5267
- types ## global types
5368
- index.ts
54-
- ui ## core ui and theme configuration
55-
- button.tsx
56-
- checkbox.tsx
57-
- colors.js
58-
- focus-aware-status-bar.tsx
59-
- icons
60-
- image.tsx
61-
- index.tsx
62-
- input.tsx
63-
- list.tsx
64-
- modal.tsx
65-
- progress-bar.tsx
66-
- select.tsx
67-
- text.tsx
68-
- utils.tsx
6969

7070
</FileTree>
7171

72-
- `ui`: This folder contains all the UI components and the theme configuration. We provide minimal components with a basic `obytes` theme. You can add your own components and theme configuration here.
72+
- `components/ui`: This folder contains all the UI components and the theme configuration. We provide minimal components with a basic `obytes` theme. You can add your own components and theme configuration here.
7373

74-
- `components`: This folder contains the components of the app. mainly components used inside the app folder. The only difference between `ui` and `components` is that `ui` is more generic and can be used in any project, while `components` are more specific to the project.
74+
- `components`: This folder contains the components of the app. mainly components used inside the app folder.
7575

76-
- `core`: This folder contains the core files, such as authentication, localization, storage, and more. It can be shared with other projects. That's why we are only including modules that have nothing to do with project logic. This approach helps us share code between projects and also update the starter with new features.
76+
- `lib`: This folder contains the core files, such as authentication, localization, storage, and more. It can be shared with other projects. That's why we are only including modules that have nothing to do with project logic. This approach helps us share code between projects and also update the starter with new features.
7777

7878
- `app`: This folder contains the routes of the app, along with its layout routes such as stack and tab navigation structures. We provide a basic navigation structure for the demo app that you can modify to fit your needs.
7979

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ We also provide an `EmptyList` component that you can use to display a message w
5656
**Use Case**
5757

5858
```tsx
59-
import React from 'react';
6059
import { List, EmptyList, Text } from '@/components/ui';
6160

6261
const MyComponent = () => {
@@ -85,7 +84,6 @@ The `cssInterop` function from `nativewind` is used to apply styling and, in thi
8584
**Use Case**
8685

8786
```tsx
88-
import React from 'react';
8987
import { Image } from '@/components/ui';
9088

9189
const MyComponent = () => {
@@ -183,7 +181,6 @@ Read more about Handling Forms [here](../forms/).
183181
**Use Case**
184182

185183
```tsx
186-
import React from 'react';
187184
import { Input, View } from '@/components/ui';
188185

189186
const MyComponent = () => {
@@ -214,7 +211,6 @@ Based on your needs, you can use the `Modal` if you don't have a fixed height fo
214211
**Use Case**
215212

216213
```tsx
217-
import React from 'react';
218214
import { Modal, useModal, View, Button, Text } from '@/components/ui';
219215

220216
const MyComponent = () => {

0 commit comments

Comments
 (0)