Skip to content

Commit ba2c526

Browse files
move shared colors to a separate file
1 parent 632c8a1 commit ba2c526

File tree

6 files changed

+189
-184
lines changed

6 files changed

+189
-184
lines changed

src/core/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { constants } from 'ethers'
66

77
import { ChainID } from 'lib/eoaWallet'
88

9-
import { chainTypesById } from 'shared/constants/chainConstants'
9+
import { chainTypesById } from 'shared/constants'
1010
import { SETTINGS } from 'core/types'
1111
import { TokenSymbol } from 'screens/home/TokenImage'
1212
import { rbtcMap } from 'shared/utils'

src/screens/createKeys/import/ImportMasterKeyScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const StatusIcon = ({ status }: { status: StatusActions }) => {
4848
backgroundColor:
4949
status === StatusActions.SUCCESS
5050
? sharedColors.successLight
51-
: sharedColors.errorBackground,
51+
: sharedColors.error,
5252
borderRadius: 50,
5353
}
5454
switch (status) {

src/screens/settings/SettingsScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { castStyle } from 'shared/utils'
1717
import { selectChainId } from 'store/slices/settingsSlice'
1818
import { selectPin } from 'store/slices/persistentDataSlice'
1919
import { useAppSelector } from 'store/storeUtils'
20-
import { ChainTypeEnum, chainTypesById } from 'shared/constants/chainConstants'
20+
import { ChainTypeEnum, chainTypesById } from 'shared/constants'
2121
import { GlobalErrorHandlerContext } from 'components/GlobalErrorHandler/GlobalErrorHandlerContext'
2222
import { getCurrentChainId, setCurrentChainId } from 'storage/ChainStorage'
2323
import { WalletContext } from 'shared/wallet'

src/shared/constants/colors.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
export const sharedColors = {
2+
primary: '#4B5CF0',
3+
primaryDark: '#4250CC', // used over the primary color
4+
secondary: '#121212',
5+
success: '#79C600',
6+
successLight: '#59FF9C',
7+
connected: '#01CB9F',
8+
warning: '#FF9100',
9+
danger: '#E94141',
10+
dangerLight: '#ED6060',
11+
error: '#FF3559',
12+
black: '#000000',
13+
white: '#FFFFFF',
14+
borderColor: '#575757',
15+
background: {
16+
primary: '#000',
17+
secondary: '#252525',
18+
accent: '#3A3A3A',
19+
highlight: '#575757',
20+
light: '#FBFBFB',
21+
},
22+
input: {
23+
active: '#3A3A3A',
24+
inactive: '#252525',
25+
},
26+
text: {
27+
primary: '#fff',
28+
secondary: '#000',
29+
label: '#B8B8B8',
30+
placeholder: '#FBFBFB',
31+
link: '#4152E6',
32+
},
33+
button: {
34+
primaryBackground: '#fff',
35+
primaryText: '#000',
36+
secondaryBackground: '#252525',
37+
secondaryText: '#fff',
38+
},
39+
stepper: {
40+
active: '#4B5CF0',
41+
inactive: '#3A3A3A',
42+
},
43+
}
44+
45+
export const tokenColors = {
46+
rbtc: '#71BD35',
47+
btc: '#EB7D00',
48+
rif: '#4152E6',
49+
rdoc: '#11B55C',
50+
generic: '#252525',
51+
}

src/shared/constants/index.ts

Lines changed: 4 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { Dimensions, StyleSheet } from 'react-native'
1+
import { Dimensions } from 'react-native'
22

3-
import { castStyle } from '../utils'
3+
export { ChainTypeEnum, chainTypesById } from './chainConstants'
4+
export { sharedColors, tokenColors } from './colors'
5+
export { sharedStyles } from './styles'
46

57
export const testIDs = {
68
wordInput: 'input.wordInput',
@@ -14,189 +16,10 @@ export const testIDs = {
1416
newContact: 'newContact',
1517
}
1618

17-
export const sharedColors = {
18-
primary: '#4B5CF0',
19-
primaryDark: '#4250CC', // used over the primary color
20-
secondary: '#121212',
21-
success: '#79C600',
22-
successLight: '#59FF9C',
23-
connected: '#01CB9F',
24-
warning: '#FF9100',
25-
danger: '#E94141',
26-
dangerLight: '#ED6060',
27-
white: '#FFFFFF',
28-
borderColor: '#575757',
29-
// subTitle: '#FBFBFB',
30-
// tokenBackground: '#1E1E1E',
31-
black: '#000000',
32-
// qrColor: '#DBE3FF',
33-
errorBackground: '#FF3559',
34-
// lightPurple: '#DAE2FF',
35-
// blue: '#6053F8',
36-
37-
background: {
38-
primary: '#000',
39-
secondary: '#252525',
40-
accent: '#3A3A3A',
41-
highlight: '#575757',
42-
light: '#FBFBFB',
43-
},
44-
45-
input: {
46-
active: '#3A3A3A',
47-
inactive: '#252525',
48-
},
49-
50-
text: {
51-
primary: '#fff',
52-
secondary: '#000',
53-
label: '#B8B8B8',
54-
placeholder: '#FBFBFB',
55-
link: '#4152E6',
56-
},
57-
58-
button: {
59-
primaryBackground: '#fff',
60-
primaryText: '#000',
61-
secondaryBackground: '#252525',
62-
secondaryText: '#fff',
63-
},
64-
65-
stepper: {
66-
active: '#4B5CF0',
67-
inactive: '#3A3A3A',
68-
},
69-
}
70-
71-
export const tokenColors = {
72-
rbtc: '#71BD35',
73-
btc: '#EB7D00',
74-
rif: '#4152E6',
75-
rdoc: '#11B55C',
76-
generic: '#252525',
77-
}
7819
export const defaultFontSize = 16
7920
export const defaultIconSize = 16
8021
export const noop = () => {}
8122

82-
export const sharedStyles = StyleSheet.create({
83-
displayNone: castStyle.view({
84-
display: 'none',
85-
}),
86-
flex: castStyle.view({
87-
flex: 1,
88-
}),
89-
flexGrow: castStyle.view({
90-
flexGrow: 1,
91-
}),
92-
flexAlignEnd: castStyle.view({
93-
alignSelf: 'flex-end',
94-
}),
95-
row: castStyle.view({
96-
flexDirection: 'row',
97-
}),
98-
textCenter: castStyle.text({
99-
textAlign: 'center',
100-
}),
101-
textLeft: castStyle.text({
102-
textAlign: 'left',
103-
}),
104-
textRight: castStyle.text({
105-
textAlign: 'right',
106-
}),
107-
contentCenter: castStyle.view({
108-
justifyContent: 'center',
109-
alignItems: 'center',
110-
}),
111-
alignCenter: castStyle.view({
112-
alignItems: 'center',
113-
}),
114-
marginLeft24: castStyle.view({ marginLeft: 24 }),
115-
marginTop40: castStyle.view({ marginTop: 40 }),
116-
marginRight24: castStyle.view({ marginRight: 24 }),
117-
paddingHorizontal24: castStyle.view({
118-
paddingHorizontal: 24,
119-
}),
120-
screen: castStyle.view({
121-
flex: 1,
122-
backgroundColor: sharedColors.background.primary,
123-
paddingHorizontal: 24,
124-
}),
125-
noPadding: castStyle.view({ padding: 0 }),
126-
selfCenter: castStyle.view({
127-
alignSelf: 'center',
128-
}),
129-
widthHalfWidth: castStyle.view({
130-
width: '50%',
131-
}),
132-
widthFullWidth: castStyle.view({
133-
width: '100%',
134-
}),
135-
fontBoldText: castStyle.text({
136-
fontWeight: 'bold',
137-
}),
138-
appButtonBottom: castStyle.view({
139-
position: 'absolute',
140-
bottom: 30,
141-
left: 24,
142-
right: 24,
143-
}),
144-
/* GRID */
145-
column12: {
146-
display: 'flex',
147-
width: '100%',
148-
},
149-
column10: {
150-
display: 'flex',
151-
width: '83.333%',
152-
},
153-
column9: {
154-
display: 'flex',
155-
width: '75%',
156-
},
157-
column8: {
158-
display: 'flex',
159-
width: '66.667%',
160-
},
161-
column7: {
162-
display: 'flex',
163-
width: '56.667%',
164-
},
165-
column6: {
166-
display: 'flex',
167-
width: '50%',
168-
},
169-
column5: {
170-
display: 'flex',
171-
width: '41.667%',
172-
},
173-
column4: {
174-
display: 'flex',
175-
width: '33%',
176-
},
177-
column3: {
178-
display: 'flex',
179-
width: '25%',
180-
},
181-
column2: {
182-
display: 'flex',
183-
width: '16.667%',
184-
},
185-
column1: {
186-
display: 'flex',
187-
width: '8.333%',
188-
},
189-
column: {
190-
display: 'flex',
191-
},
192-
193-
offset1: {
194-
marginLeft: '8.3%',
195-
},
196-
offset3: {
197-
marginLeft: '25%',
198-
},
199-
})
20023
export const WINDOW_WIDTH = Dimensions.get('window').width
20124
export const WINDOW_HEIGHT = Dimensions.get('window').height
20225
export const SLIDER_WIDTH = Math.round(WINDOW_WIDTH * 0.8)

0 commit comments

Comments
 (0)