1
1
import Layout from "@components/Layout" ;
2
2
import Page from "@components/Page" ;
3
3
import { useTheme } from "@hooks/useTheme" ;
4
- import { Typography , Box , Button , Divider , List , ListItem , ListItemIcon , ListItemText } from "@mui/material" ;
5
- import { Code as CodeIcon , Android as AndroidIcon , Brush as BrushIcon } from '@mui/icons-material' ;
4
+ import {
5
+ Typography ,
6
+ Box ,
7
+ Button ,
8
+ Divider ,
9
+ List ,
10
+ ListItem ,
11
+ ListItemIcon ,
12
+ ListItemText ,
13
+ } from "@mui/material" ;
14
+ import {
15
+ Code as CodeIcon ,
16
+ Android as AndroidIcon ,
17
+ Brush as BrushIcon ,
18
+ } from "@mui/icons-material" ;
6
19
7
- const Section = ( { title, children } : { title : string ; children : React . ReactNode } ) => (
20
+ const Section = ( {
21
+ title,
22
+ children,
23
+ } : {
24
+ title : string ;
25
+ children : React . ReactNode ;
26
+ } ) => (
8
27
< Box sx = { { mb : 4 } } >
9
- < Typography variant = "h6" gutterBottom sx = { { fontWeight : '600' , mt : 3 , mb : 2 } } >
28
+ < Typography
29
+ variant = "h6"
30
+ gutterBottom
31
+ sx = { { fontWeight : "600" , mt : 3 , mb : 2 } }
32
+ >
10
33
{ title }
11
34
</ Typography >
12
35
{ children }
@@ -22,9 +45,9 @@ const CodeBlock = ({ children }: { children: React.ReactNode }) => {
22
45
color : theme . onSurfaceVariant ,
23
46
p : 2 ,
24
47
borderRadius : 1 ,
25
- fontFamily : ' monospace' ,
26
- fontSize : ' 0.875rem' ,
27
- overflowX : ' auto' ,
48
+ fontFamily : " monospace" ,
49
+ fontSize : " 0.875rem" ,
50
+ overflowX : " auto" ,
28
51
mb : 2 ,
29
52
} }
30
53
>
@@ -39,35 +62,54 @@ export default function Contribute() {
39
62
const content = (
40
63
< Box >
41
64
< Typography sx = { { mt : 2 } } >
42
- Contributions to < b > LNReader</ b > are welcome and greatly appreciated! Follow the guide below to get started.
65
+ Contributions to < b > LNReader</ b > are welcome and greatly appreciated!
66
+ Follow the guide below to get started.
43
67
</ Typography >
44
68
45
69
< Section title = "Setting up your environment" >
46
70
< Typography sx = { { mb : 2 } } >
47
- After forking to your own GitHub org or account, follow these steps to get started:
71
+ After forking to your own GitHub org or account, follow these steps to
72
+ get started:
48
73
</ Typography >
49
74
< List >
50
75
< ListItem >
51
- < ListItemIcon > < CodeIcon /> </ ListItemIcon >
52
- < ListItemText
53
- primary = "Node.js version <= 16.13.1"
76
+ < ListItemIcon >
77
+ < CodeIcon />
78
+ </ ListItemIcon >
79
+ < ListItemText
80
+ primary = "Node.js version >= 18"
54
81
secondary = "For version management, we recommend using nvm"
55
82
secondaryTypographyProps = { { color : theme . onSurface } }
56
83
/>
57
84
</ ListItem >
58
85
< ListItem >
59
- < ListItemIcon > < CodeIcon /> </ ListItemIcon >
60
- < ListItemText
61
- primary = "Java SDK version <= 11"
86
+ < ListItemIcon >
87
+ < CodeIcon />
88
+ </ ListItemIcon >
89
+ < ListItemText
90
+ primary = "Java SDK version >= 15"
62
91
secondary = "For version management, you can optionally use jenv"
63
92
secondaryTypographyProps = { { color : theme . onSurface } }
64
93
/>
65
94
</ ListItem >
66
95
< ListItem >
67
- < ListItemIcon > < AndroidIcon /> </ ListItemIcon >
68
- < ListItemText
69
- primary = "Android SDK"
70
- secondary = { < > Download from < a href = "https://developer.android.com/studio" target = "_blank" rel = "noopener noreferrer" > Android Studio</ a > </ > }
96
+ < ListItemIcon >
97
+ < AndroidIcon />
98
+ </ ListItemIcon >
99
+ < ListItemText
100
+ primary = "Android SDK"
101
+ secondary = {
102
+ < >
103
+ Download from{ " " }
104
+ < a
105
+ href = "https://developer.android.com/studio"
106
+ target = "_blank"
107
+ rel = "noopener noreferrer"
108
+ >
109
+ Android Studio
110
+ </ a >
111
+ </ >
112
+ }
71
113
secondaryTypographyProps = { { color : theme . onSurface } }
72
114
/>
73
115
</ ListItem >
@@ -77,102 +119,108 @@ export default function Contribute() {
77
119
< Section title = "Quick Start Steps" >
78
120
< List >
79
121
< ListItem >
80
- < ListItemText
122
+ < ListItemText
81
123
primary = "Clone your fork to your local machine:"
82
124
secondary = {
83
125
< CodeBlock >
84
- git clone https://github.com/<your-username>/lnreader.git
126
+ git clone
127
+ https://github.com/<your-username>/lnreader.git
85
128
</ CodeBlock >
86
129
}
87
130
/>
88
131
</ ListItem >
89
132
< ListItem >
90
- < ListItemText
133
+ < ListItemText
91
134
primary = "Step into the local repository:"
92
- secondary = {
93
- < CodeBlock >
94
- cd lnreader
95
- </ CodeBlock >
96
- }
135
+ secondary = { < CodeBlock > cd lnreader</ CodeBlock > }
97
136
/>
98
137
</ ListItem >
99
138
< ListItem >
100
- < ListItemText
139
+ < ListItemText
101
140
primary = "Install dependencies:"
102
- secondary = {
103
- < CodeBlock >
104
- npm install
105
- </ CodeBlock >
106
- }
141
+ secondary = { < CodeBlock > npm install</ CodeBlock > }
107
142
/>
108
143
</ ListItem >
109
144
< ListItem >
110
- < ListItemText
145
+ < ListItemText
111
146
primary = "Build the APK:"
112
- secondary = {
113
- < CodeBlock >
114
- npm run buildRelease
115
- </ CodeBlock >
116
- }
147
+ secondary = { < CodeBlock > npm run buildRelease</ CodeBlock > }
117
148
/>
118
149
</ ListItem >
119
150
</ List >
120
151
</ Section >
121
152
122
153
< Section title = "Developing on Android" >
123
154
< Typography sx = { { mb : 2 } } >
124
- You will need an Android device or emulator connected to your computer as well as an IDE of your choice (e.g., VSCode).
155
+ You will need an Android device or emulator connected to your computer
156
+ as well as an IDE of your choice (e.g., VSCode).
125
157
</ Typography >
126
158
< List >
127
159
< ListItem >
128
- < ListItemIcon > < AndroidIcon /> </ ListItemIcon >
129
- < ListItemText
130
- primary = "ADB (Android Debug Bridge)"
131
- secondary = { < > < a href = "https://developer.android.com/studio/command-line/adb" target = "_blank" rel = "noopener noreferrer" > Android Developer site</ a > </ > }
160
+ < ListItemIcon >
161
+ < AndroidIcon />
162
+ </ ListItemIcon >
163
+ < ListItemText
164
+ primary = "ADB (Android Debug Bridge)"
165
+ secondary = {
166
+ < >
167
+ < a
168
+ href = "https://developer.android.com/studio/command-line/adb"
169
+ target = "_blank"
170
+ rel = "noopener noreferrer"
171
+ >
172
+ Android Developer site
173
+ </ a >
174
+ </ >
175
+ }
132
176
secondaryTypographyProps = { { color : theme . onSurface } }
133
177
/>
134
178
</ ListItem >
135
179
< ListItem >
136
- < ListItemIcon > < CodeIcon /> </ ListItemIcon >
180
+ < ListItemIcon >
181
+ < CodeIcon />
182
+ </ ListItemIcon >
137
183
< ListItemText primary = "IDE of your choice" />
138
184
</ ListItem >
139
185
</ List >
140
- < Typography sx = { { mt : 2 , mb : 1 } } >
141
- Development Steps:
142
- </ Typography >
186
+ < Typography sx = { { mt : 2 , mb : 1 } } > Development Steps:</ Typography >
143
187
< Typography sx = { { mt : 2 , mb : 1 } } >
144
188
Check if Android device/emulator is connected:
145
189
</ Typography >
146
- < CodeBlock >
147
- adb devices
148
- </ CodeBlock >
190
+ < CodeBlock > adb devices</ CodeBlock >
149
191
< Typography sx = { { mt : 2 , mb : 1 } } >
150
192
Run Metro for development:
151
193
</ Typography >
152
- < CodeBlock >
153
- npm start
154
- </ CodeBlock >
194
+ < CodeBlock > npm start</ CodeBlock >
155
195
< Typography sx = { { mt : 2 , mb : 1 } } >
156
196
View on your Android device (run in a new terminal):
157
197
</ Typography >
158
- < CodeBlock >
159
- npm run android
160
- </ CodeBlock >
198
+ < CodeBlock > npm run android</ CodeBlock >
161
199
< Typography sx = { { mt : 2 , mb : 1 } } >
162
- To view changes to the app with new code, save your code and press "r" on the Metro terminal to reload it. The app on the Android device/emulator will reload shortly.
200
+ To view changes to the app with new code, save your code and press "r"
201
+ on the Metro terminal to reload it. The app on the Android
202
+ device/emulator will reload shortly.
163
203
</ Typography >
164
204
</ Section >
165
205
166
206
< Section title = "Style & Linting" >
167
207
< Typography sx = { { mb : 2 } } >
168
- This codebase's linting rules are enforced using < a href = "http://eslint.org/" target = "_blank" rel = "noopener noreferrer" > ESLint</ a > .
208
+ This codebase's linting rules are enforced using{ " " }
209
+ < a
210
+ href = "http://eslint.org/"
211
+ target = "_blank"
212
+ rel = "noopener noreferrer"
213
+ >
214
+ ESLint
215
+ </ a >
216
+ .
169
217
</ Typography >
170
218
< Typography sx = { { mb : 2 } } >
171
- It is recommended that you install an ESLint plugin for your editor of choice when working on this codebase. However, you can always check if the source code is compliant by running:
219
+ It is recommended that you install an ESLint plugin for your editor of
220
+ choice when working on this codebase. However, you can always check if
221
+ the source code is compliant by running:
172
222
</ Typography >
173
- < CodeBlock >
174
- npm run lint
175
- </ CodeBlock >
223
+ < CodeBlock > npm run lint</ CodeBlock >
176
224
</ Section >
177
225
178
226
< Box sx = { { my : 4 , textAlign : "center" } } >
@@ -198,10 +246,7 @@ export default function Contribute() {
198
246
199
247
return (
200
248
< Layout >
201
- < Page
202
- title = "Contribute"
203
- content = { content }
204
- />
249
+ < Page title = "Contribute" content = { content } />
205
250
</ Layout >
206
251
) ;
207
- }
252
+ }
0 commit comments