|
1 | | -/* oxlint-disable eslint(max-lines) */ |
2 | 1 | import { debug } from '@sentry/core'; |
3 | 2 | import * as React from 'react'; |
4 | | -import { Animated, Image, Modal, Platform, Pressable, StyleSheet, Text, useColorScheme, View } from 'react-native'; |
| 3 | +import { Animated, Image, Modal, Platform, Pressable, Text, useColorScheme, View } from 'react-native'; |
5 | 4 |
|
6 | 5 | import { getDevServer } from '../integrations/debugsymbolicatorutils'; |
7 | 6 | import { isExpo, isExpoGo, isWeb } from '../utils/environment'; |
8 | 7 | import { bug as bugAnimation, hi as hiAnimation, thumbsup as thumbsupAnimation } from './animations'; |
9 | 8 | import { nativeCrashExample, tryCatchExample, uncaughtErrorExample } from './examples'; |
10 | 9 | import { bug as bugImage, hi as hiImage, thumbsup as thumbsupImage } from './images'; |
| 10 | +import { defaultDarkStyles, lightStyles } from './modal.styles'; |
11 | 11 |
|
12 | 12 | /** |
13 | 13 | * Wrapper to add Sentry Playground to your application |
@@ -270,146 +270,6 @@ const Button = ({ |
270 | 270 | ); |
271 | 271 | }; |
272 | 272 |
|
273 | | -const defaultDarkStyles = StyleSheet.create({ |
274 | | - welcomeText: { color: 'rgb(246, 245, 250)', fontSize: 24, fontWeight: 'bold' }, |
275 | | - background: { |
276 | | - flex: 1, |
277 | | - backgroundColor: 'rgb(26, 20, 31)', |
278 | | - width: '100%', |
279 | | - minHeight: '100%', |
280 | | - alignItems: 'center', // Center content horizontally |
281 | | - justifyContent: 'center', // Center content vertically |
282 | | - }, |
283 | | - container: { |
284 | | - flex: 1, |
285 | | - flexDirection: 'column', |
286 | | - padding: 12, |
287 | | - marginTop: 20, |
288 | | - width: '100%', |
289 | | - alignItems: 'center', // Center image and button container |
290 | | - justifyContent: 'space-evenly', // Center image and button container |
291 | | - }, |
292 | | - buttonContainer: { |
293 | | - flexDirection: 'row', // Arrange buttons horizontally |
294 | | - marginTop: 20, // Add some space above the buttons |
295 | | - }, |
296 | | - listContainer: { |
297 | | - backgroundColor: 'rgb(39, 36, 51)', |
298 | | - width: '100%', |
299 | | - flexDirection: 'column', |
300 | | - marginTop: 20, // Add some space above the buttons |
301 | | - borderColor: 'rgb(7, 5, 15)', |
302 | | - borderWidth: 1, |
303 | | - borderRadius: 8, |
304 | | - }, |
305 | | - rowTitle: { |
306 | | - color: 'rgb(246, 245, 250)', |
307 | | - fontSize: 14, |
308 | | - fontWeight: 'bold', |
309 | | - textAlign: 'left', |
310 | | - fontFamily: 'Menlo', |
311 | | - }, |
312 | | - rowContainer: { |
313 | | - overflow: 'hidden', |
314 | | - flexDirection: 'row', |
315 | | - justifyContent: 'space-between', // Space between buttons |
316 | | - paddingTop: 16, |
317 | | - paddingBottom: 10, |
318 | | - paddingHorizontal: 10, |
319 | | - borderColor: 'rgb(7, 5, 15)', |
320 | | - borderBottomWidth: 1, |
321 | | - }, |
322 | | - lastRowContainer: { |
323 | | - borderBottomWidth: 0, // Remove border for the last row |
324 | | - }, |
325 | | - buttonCommon: { |
326 | | - borderRadius: 8, |
327 | | - }, |
328 | | - buttonBottomLayer: { |
329 | | - backgroundColor: 'rgb(7, 5, 15)', |
330 | | - }, |
331 | | - buttonMainContainer: { |
332 | | - paddingVertical: 8, |
333 | | - paddingHorizontal: 13, |
334 | | - backgroundColor: 'rgb(117, 83, 255)', |
335 | | - transform: [{ translateY: -4 }], |
336 | | - borderWidth: 1, |
337 | | - borderColor: 'rgb(7, 5, 15)', |
338 | | - }, |
339 | | - buttonSecondaryContainer: { |
340 | | - backgroundColor: 'rgb(39, 36, 51)', |
341 | | - }, |
342 | | - buttonSecondaryBottomLayer: {}, |
343 | | - buttonSecondaryText: {}, |
344 | | - buttonMainContainerPressed: { |
345 | | - transform: [{ translateY: 0 }], |
346 | | - }, |
347 | | - buttonText: { |
348 | | - color: 'rgb(246, 245, 250)', |
349 | | - fontSize: 16, |
350 | | - fontWeight: 'bold', |
351 | | - textAlign: 'center', |
352 | | - }, |
353 | | - buttonDisabledText: { |
354 | | - color: 'rgb(146, 130, 170)', |
355 | | - }, |
356 | | - buttonDisabledContainer: { |
357 | | - transform: [{ translateY: -2 }], |
358 | | - backgroundColor: 'rgb(39, 36, 51)', |
359 | | - }, |
360 | | -}); |
361 | | - |
362 | | -const lightStyles: typeof defaultDarkStyles = StyleSheet.create({ |
363 | | - ...defaultDarkStyles, |
364 | | - welcomeText: { |
365 | | - ...defaultDarkStyles.welcomeText, |
366 | | - color: 'rgb(24, 20, 35)', |
367 | | - }, |
368 | | - background: { |
369 | | - ...defaultDarkStyles.background, |
370 | | - backgroundColor: 'rgb(251, 250, 255)', |
371 | | - }, |
372 | | - buttonMainContainer: { |
373 | | - ...defaultDarkStyles.buttonMainContainer, |
374 | | - backgroundColor: 'rgb(117, 83, 255)', |
375 | | - borderColor: 'rgb(85, 61, 184)', |
376 | | - }, |
377 | | - buttonBottomLayer: { |
378 | | - backgroundColor: 'rgb(85, 61, 184)', |
379 | | - }, |
380 | | - buttonSecondaryContainer: { |
381 | | - backgroundColor: 'rgb(255, 255, 255)', |
382 | | - borderColor: 'rgb(218, 215, 229)', |
383 | | - }, |
384 | | - buttonSecondaryBottomLayer: { |
385 | | - backgroundColor: 'rgb(218, 215, 229)', |
386 | | - }, |
387 | | - buttonText: { |
388 | | - ...defaultDarkStyles.buttonText, |
389 | | - }, |
390 | | - buttonSecondaryText: { |
391 | | - ...defaultDarkStyles.buttonText, |
392 | | - color: 'rgb(24, 20, 35)', |
393 | | - }, |
394 | | - rowTitle: { |
395 | | - ...defaultDarkStyles.rowTitle, |
396 | | - color: 'rgb(24, 20, 35)', |
397 | | - }, |
398 | | - rowContainer: { |
399 | | - ...defaultDarkStyles.rowContainer, |
400 | | - borderColor: 'rgb(218, 215, 229)', |
401 | | - }, |
402 | | - listContainer: { |
403 | | - ...defaultDarkStyles.listContainer, |
404 | | - borderColor: 'rgb(218, 215, 229)', |
405 | | - backgroundColor: 'rgb(255, 255, 255)', |
406 | | - }, |
407 | | - buttonDisabledContainer: { |
408 | | - ...defaultDarkStyles.buttonDisabledContainer, |
409 | | - backgroundColor: 'rgb(238, 235, 249)', |
410 | | - }, |
411 | | -}); |
412 | | - |
413 | 273 | function openURLInBrowser(url: string): void { |
414 | 274 | const devServer = getDevServer(); |
415 | 275 | if (devServer?.url) { |
|
0 commit comments