-
-
Notifications
You must be signed in to change notification settings - Fork 359
Expand file tree
/
Copy pathFeedbackWidget.theme.ts
More file actions
71 lines (60 loc) · 1.65 KB
/
FeedbackWidget.theme.ts
File metadata and controls
71 lines (60 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { Appearance } from 'react-native';
import { getColorScheme, getFeedbackDarkTheme, getFeedbackLightTheme } from './integration';
/**
* Get the theme for the feedback widget based on the current color scheme
*/
export function getTheme(): FeedbackWidgetTheme {
const userTheme = getColorScheme();
const colorScheme = userTheme === 'system' ? Appearance.getColorScheme() : userTheme;
const lightTheme = { ...LightTheme, ...getFeedbackLightTheme() };
const darkTheme = { ...DarkTheme, ...getFeedbackDarkTheme() };
return colorScheme === 'dark' ? darkTheme : lightTheme;
}
export interface FeedbackWidgetTheme {
/**
* Background color for surfaces
*/
background: string;
/**
* Foreground color (i.e. text color)
*/
foreground: string;
/**
* Foreground color for accented elements
*/
accentForeground?: string;
/**
* Background color for accented elements
*/
accentBackground?: string;
/**
* Border color
*/
border?: string;
/**
* Color for feedback icon
*/
feedbackIcon?: string;
/**
* Color for Sentry logo
*/
sentryLogo?: string;
}
export const LightTheme: FeedbackWidgetTheme = {
accentBackground: 'rgba(88, 74, 192, 1)',
accentForeground: '#ffffff',
foreground: '#2b2233',
background: '#ffffff',
border: 'rgba(41, 35, 47, 0.13)',
feedbackIcon: 'rgba(54, 45, 89, 1)',
sentryLogo: 'rgba(54, 45, 89, 1)',
};
export const DarkTheme: FeedbackWidgetTheme = {
accentBackground: 'rgba(88, 74, 192, 1)',
accentForeground: '#ffffff',
foreground: '#ebe6ef',
background: '#29232f',
border: 'rgba(235, 230, 239, 0.15)',
feedbackIcon: '#ffffff',
sentryLogo: '#ffffff',
};