Skip to content

Commit 7c8db98

Browse files
committed
refactor: add colors and icons object
1 parent f5a45f9 commit 7c8db98

20 files changed

+61
-35
lines changed

src/colors.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const colors = Object.freeze({
2+
black: '#000000',
3+
red: '#ef4444',
4+
gray: '#888888',
5+
lightGray: '#AAAAAA',
6+
});
7+
8+
export default colors;

src/icons.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const icons = Object.freeze({
2+
code: require('./assets/icons/code.png'),
3+
delete: require('./assets/icons/delete.png'),
4+
hide: require('./assets/icons/hide.png'),
5+
move: require('./assets/icons/move.png'),
6+
record: require('./assets/icons/record.png'),
7+
});
8+
9+
export default icons;

src/ui/Xenon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import MainContext, { type MainContextValue } from '../contexts/MainContext';
55
import { useConsoleInterceptor, useNetworkInterceptor } from '../hooks';
66
import { DebuggerPanel, type DebuggerPosition, type DebuggerVisibility } from '../types';
77
import { Bubble, ConsolePanel, DebuggerHeader, DetailsViewer, NetworkPanel } from './components';
8+
import colors from '../colors';
89

910
interface XenonComponentMethods {
1011
show(): void;
@@ -127,7 +128,7 @@ const styles = StyleSheet.create({
127128
top: undefined,
128129
bottom: undefined,
129130
zIndex: 9999,
130-
backgroundColor: '#AAAAAA',
131+
backgroundColor: colors.lightGray,
131132
},
132133
bubbleBackdrop: {
133134
flex: 1,

src/ui/components/bubble/Bubble.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
type PanResponderGestureState,
88
} from 'react-native';
99
import { MainContext } from '../../../contexts';
10+
import icons from '../../../icons';
11+
import colors from '../../../colors';
1012

1113
interface BubbleProps {
1214
bubbleSize: number;
@@ -73,7 +75,7 @@ export default function Bubble({ bubbleSize, pan }: BubbleProps) {
7375
]}
7476
>
7577
<Image
76-
source={require('../../../assets/code.png')}
78+
source={icons.code}
7779
style={{
7880
width: bubbleSize * 0.75,
7981
height: bubbleSize * 0.75,
@@ -85,7 +87,7 @@ export default function Bubble({ bubbleSize, pan }: BubbleProps) {
8587

8688
const styles = StyleSheet.create({
8789
bubble: {
88-
backgroundColor: '#AAAAAA',
90+
backgroundColor: colors.lightGray,
8991
position: 'absolute',
9092
justifyContent: 'center',
9193
alignItems: 'center',

src/ui/components/details/LogMessageDetails.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ScrollView, StyleSheet, Text } from 'react-native';
22
import type { LogMessage } from '../../../types';
33
import { formatLogMessage } from '../../../utils';
4+
import colors from '../../../colors';
45

56
interface LogMessageDetailsProps {
67
item: LogMessage;
@@ -21,6 +22,6 @@ const styles = StyleSheet.create({
2122
},
2223
divider: {
2324
height: 1,
24-
backgroundColor: '#888888',
25+
backgroundColor: colors.gray,
2526
},
2627
});

0 commit comments

Comments
 (0)