Skip to content

Commit 5fd7942

Browse files
stibel5ZYSZ3K
authored andcommitted
refactor(general): clean up code
1 parent 7d973dc commit 5fd7942

File tree

5 files changed

+311
-212
lines changed

5 files changed

+311
-212
lines changed

apps/benchmarking/App.js

Lines changed: 193 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -15,167 +15,6 @@ const config = {
1515
ignoredTags: ['svg', 'button', 'input', 'form', 'img', 'ol', 'table']
1616
};
1717

18-
const props = {
19-
renderers: {},
20-
baseStyle: {
21-
fontSize: 16,
22-
color: '#000000'
23-
},
24-
tagsStyles: {
25-
body: {
26-
fontSize: 16,
27-
lineHeight: 24,
28-
color: '#000000',
29-
backgroundColor: '#ffffff'
30-
},
31-
h1: {
32-
fontSize: 32,
33-
fontWeight: 'bold',
34-
marginVertical: 16,
35-
color: '#20232a'
36-
},
37-
h2: {
38-
fontSize: 24,
39-
fontWeight: 'bold',
40-
marginVertical: 14,
41-
color: '#20232a'
42-
},
43-
h3: {
44-
fontSize: 20,
45-
fontWeight: 'bold',
46-
marginVertical: 12,
47-
color: '#20232a'
48-
},
49-
p: {
50-
marginVertical: 8,
51-
fontSize: 16,
52-
lineHeight: 24
53-
},
54-
a: {
55-
color: '#61dafb',
56-
textDecorationLine: 'underline'
57-
},
58-
code: {
59-
backgroundColor: '#f5f5f5',
60-
fontFamily: 'monospace',
61-
padding: 2,
62-
borderRadius: 3
63-
},
64-
pre: {
65-
backgroundColor: '#282c34',
66-
padding: 16,
67-
borderRadius: 8,
68-
marginVertical: 12
69-
},
70-
ul: {
71-
marginVertical: 8,
72-
paddingLeft: 20
73-
},
74-
ol: {
75-
marginVertical: 8,
76-
paddingLeft: 20
77-
},
78-
li: {
79-
marginVertical: 4
80-
},
81-
blockquote: {
82-
borderLeftWidth: 4,
83-
borderLeftColor: '#61dafb',
84-
paddingLeft: 16,
85-
marginVertical: 12,
86-
fontStyle: 'italic'
87-
},
88-
table: {
89-
marginVertical: 12
90-
},
91-
th: {
92-
fontWeight: 'bold',
93-
padding: 8,
94-
backgroundColor: '#f5f5f5'
95-
},
96-
td: {
97-
padding: 8
98-
}
99-
},
100-
classesStyles: {
101-
navbar: {
102-
backgroundColor: '#20232a',
103-
padding: 12
104-
},
105-
navbar__brand: {
106-
fontSize: 18,
107-
fontWeight: 'bold',
108-
color: '#61dafb'
109-
},
110-
navbar__title: {
111-
fontSize: 18,
112-
fontWeight: 'bold',
113-
color: '#ffffff'
114-
},
115-
navbar__link: {
116-
color: '#ffffff',
117-
marginHorizontal: 8
118-
},
119-
menu__link: {
120-
color: '#20232a',
121-
padding: 8
122-
},
123-
'menu__link--active': {
124-
color: '#61dafb',
125-
fontWeight: 'bold'
126-
},
127-
docTitle_1vX4: {
128-
fontSize: 28,
129-
fontWeight: 'bold',
130-
marginVertical: 16
131-
},
132-
markdown: {
133-
fontSize: 16,
134-
lineHeight: 24
135-
},
136-
badge: {
137-
fontSize: 12,
138-
paddingHorizontal: 8,
139-
paddingVertical: 4,
140-
borderRadius: 12,
141-
backgroundColor: '#e3f2fd',
142-
color: '#1976d2'
143-
},
144-
button: {
145-
backgroundColor: '#61dafb',
146-
padding: 12,
147-
borderRadius: 6,
148-
color: '#20232a'
149-
},
150-
footer: {
151-
backgroundColor: '#20232a',
152-
padding: 24,
153-
marginTop: 32
154-
},
155-
footer__title: {
156-
fontSize: 16,
157-
fontWeight: 'bold',
158-
color: '#ffffff',
159-
marginBottom: 8
160-
},
161-
'footer__link-item': {
162-
color: '#61dafb',
163-
marginVertical: 4
164-
},
165-
tabs: {
166-
marginVertical: 12
167-
},
168-
tabs__item: {
169-
padding: 12,
170-
backgroundColor: '#f5f5f5'
171-
},
172-
'tabs__item--active': {
173-
backgroundColor: '#61dafb',
174-
color: '#ffffff'
175-
}
176-
}
177-
};
178-
17918
export default function App() {
18019
useKeepAwake();
18120
return (
@@ -203,5 +42,198 @@ const styles = StyleSheet.create({
20342
padding: 16,
20443
flex: 1,
20544
backgroundColor: '#fff'
45+
},
46+
baseStyle: {
47+
fontSize: 16,
48+
color: '#000000'
49+
},
50+
body: {
51+
fontSize: 16,
52+
lineHeight: 24,
53+
color: '#000000',
54+
backgroundColor: '#ffffff'
55+
},
56+
h1: {
57+
fontSize: 32,
58+
fontWeight: 'bold',
59+
marginVertical: 16,
60+
color: '#20232a'
61+
},
62+
h2: {
63+
fontSize: 24,
64+
fontWeight: 'bold',
65+
marginVertical: 14,
66+
color: '#20232a'
67+
},
68+
h3: {
69+
fontSize: 20,
70+
fontWeight: 'bold',
71+
marginVertical: 12,
72+
color: '#20232a'
73+
},
74+
p: {
75+
marginVertical: 8,
76+
fontSize: 16,
77+
lineHeight: 24
78+
},
79+
a: {
80+
color: '#61dafb',
81+
textDecorationLine: 'underline'
82+
},
83+
code: {
84+
backgroundColor: '#f5f5f5',
85+
fontFamily: 'monospace',
86+
padding: 2,
87+
borderRadius: 3
88+
},
89+
pre: {
90+
backgroundColor: '#282c34',
91+
padding: 16,
92+
borderRadius: 8,
93+
marginVertical: 12
94+
},
95+
ul: {
96+
marginVertical: 8,
97+
paddingLeft: 20
98+
},
99+
ol: {
100+
marginVertical: 8,
101+
paddingLeft: 20
102+
},
103+
li: {
104+
marginVertical: 4
105+
},
106+
blockquote: {
107+
borderLeftWidth: 4,
108+
borderLeftColor: '#61dafb',
109+
paddingLeft: 16,
110+
marginVertical: 12,
111+
fontStyle: 'italic'
112+
},
113+
table: {
114+
marginVertical: 12
115+
},
116+
th: {
117+
fontWeight: 'bold',
118+
padding: 8,
119+
backgroundColor: '#f5f5f5'
120+
},
121+
td: {
122+
padding: 8
123+
},
124+
navbar: {
125+
backgroundColor: '#20232a',
126+
padding: 12
127+
},
128+
navbarBrand: {
129+
fontSize: 18,
130+
fontWeight: 'bold',
131+
color: '#61dafb'
132+
},
133+
navbarTitle: {
134+
fontSize: 18,
135+
fontWeight: 'bold',
136+
color: '#ffffff'
137+
},
138+
navbarLink: {
139+
color: '#ffffff',
140+
marginHorizontal: 8
141+
},
142+
menuLink: {
143+
color: '#20232a',
144+
padding: 8
145+
},
146+
menuLinkActive: {
147+
color: '#61dafb',
148+
fontWeight: 'bold'
149+
},
150+
docTitle1vX4: {
151+
fontSize: 28,
152+
fontWeight: 'bold',
153+
marginVertical: 16
154+
},
155+
markdown: {
156+
fontSize: 16,
157+
lineHeight: 24
158+
},
159+
badge: {
160+
fontSize: 12,
161+
paddingHorizontal: 8,
162+
paddingVertical: 4,
163+
borderRadius: 12,
164+
backgroundColor: '#e3f2fd',
165+
color: '#1976d2'
166+
},
167+
button: {
168+
backgroundColor: '#61dafb',
169+
padding: 12,
170+
borderRadius: 6,
171+
color: '#20232a'
172+
},
173+
footer: {
174+
backgroundColor: '#20232a',
175+
padding: 24,
176+
marginTop: 32
177+
},
178+
footerTitle: {
179+
fontSize: 16,
180+
fontWeight: 'bold',
181+
color: '#ffffff',
182+
marginBottom: 8
183+
},
184+
footerLinkItem: {
185+
color: '#61dafb',
186+
marginVertical: 4
187+
},
188+
tabs: {
189+
marginVertical: 12
190+
},
191+
tabsItem: {
192+
padding: 12,
193+
backgroundColor: '#f5f5f5'
194+
},
195+
tabsItemActive: {
196+
backgroundColor: '#61dafb',
197+
color: '#ffffff'
206198
}
207199
});
200+
201+
const props = {
202+
renderers: {},
203+
baseStyle: styles.baseStyle,
204+
tagsStyles: {
205+
body: styles.body,
206+
h1: styles.h1,
207+
h2: styles.h2,
208+
h3: styles.h3,
209+
p: styles.p,
210+
a: styles.a,
211+
code: styles.code,
212+
pre: styles.pre,
213+
ul: styles.ul,
214+
ol: styles.ol,
215+
li: styles.li,
216+
blockquote: styles.blockquote,
217+
table: styles.table,
218+
th: styles.th,
219+
td: styles.td
220+
},
221+
classesStyles: {
222+
navbar: styles.navbar,
223+
navbar__brand: styles.navbarBrand,
224+
navbar__title: styles.navbarTitle,
225+
navbar__link: styles.navbarLink,
226+
menu__link: styles.menuLink,
227+
'menu__link--active': styles.menuLinkActive,
228+
docTitle_1vX4: styles.docTitle1vX4,
229+
markdown: styles.markdown,
230+
badge: styles.badge,
231+
button: styles.button,
232+
footer: styles.footer,
233+
footer__title: styles.footerTitle,
234+
'footer__link-item': styles.footerLinkItem,
235+
tabs: styles.tabs,
236+
tabs__item: styles.tabsItem,
237+
'tabs__item--active': styles.tabsItemActive
238+
}
239+
};

apps/benchmarking/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@ import { registerRootComponent } from 'expo';
22

33
import App from './App';
44

5-
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6-
// It also ensures that whether you load the app in Expo Go or in a native build,
7-
// the environment is set up appropriately
85
registerRootComponent(App);

apps/benchmarking/profiles.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const profiles = [
1212
{
1313
name: 'V6',
1414
component: ProfileV6Source,
15-
props: {}
15+
props: {
16+
ignoredDomTags: ['svg', 'button', 'input', 'form', 'img', 'ol', 'table']
17+
}
1618
}
1719
];
1820

0 commit comments

Comments
 (0)