-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/stake-829-create-key-value-row-component
- Loading branch information
Showing
22 changed files
with
1,232 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/components/Views/Settings/DeveloperOptions/DeveloperOptions.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { StyleSheet } from 'react-native'; | ||
import { Theme } from '../../../../util/theme/models'; | ||
|
||
const styleSheet = (params: { theme: Theme }) => { | ||
const { theme } = params; | ||
const { colors } = theme; | ||
return StyleSheet.create({ | ||
wrapper: { | ||
backgroundColor: colors.background.default, | ||
flex: 1, | ||
padding: 24, | ||
paddingBottom: 48, | ||
}, | ||
heading: { | ||
marginTop: 16, | ||
}, | ||
desc: { | ||
marginTop: 8, | ||
}, | ||
accessory: { | ||
marginTop: 16, | ||
}, | ||
}); | ||
}; | ||
|
||
export default styleSheet; |
90 changes: 90 additions & 0 deletions
90
app/components/Views/Settings/DeveloperOptions/SentryTest.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { useCallback } from 'react'; | ||
import { strings } from '../../../../../locales/i18n'; | ||
import { useTheme } from '../../../../util/theme'; | ||
import Text, { | ||
TextVariant, | ||
TextColor, | ||
} from '../../../../component-library/components/Texts/Text'; | ||
import Button, { | ||
ButtonVariants, | ||
ButtonSize, | ||
ButtonWidthTypes, | ||
} from '../../../../component-library/components/Buttons/Button'; | ||
import { trace, TraceName } from '../../../../util/trace'; | ||
import { sleep } from '../../../../util/testUtils'; | ||
import { useStyles } from '../../../../component-library/hooks'; | ||
import styleSheet from './DeveloperOptions.styles'; | ||
|
||
function GenerateTrace() { | ||
const theme = useTheme(); | ||
const { styles } = useStyles(styleSheet, { theme }); | ||
|
||
const handleGenerateTraceTest = useCallback(async () => { | ||
await trace( | ||
{ | ||
name: TraceName.DeveloperTest, | ||
data: { 'test.data.number': 123 }, | ||
tags: { 'test.tag.number': 123 }, | ||
}, | ||
async (context) => { | ||
await trace( | ||
{ | ||
name: TraceName.NestedTest1, | ||
data: { 'test.data.boolean': true }, | ||
tags: { 'test.tag.boolean': true }, | ||
parentContext: context, | ||
}, | ||
() => sleep(1000), | ||
); | ||
|
||
await trace( | ||
{ | ||
name: TraceName.NestedTest2, | ||
data: { 'test.data.string': 'test' }, | ||
tags: { 'test.tag.string': 'test' }, | ||
parentContext: context, | ||
}, | ||
() => sleep(500), | ||
); | ||
}, | ||
); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<Text | ||
color={TextColor.Alternative} | ||
variant={TextVariant.BodyMD} | ||
style={styles.desc} | ||
> | ||
{strings('app_settings.developer_options.generate_trace_test_desc')} | ||
</Text> | ||
<Button | ||
variant={ButtonVariants.Secondary} | ||
size={ButtonSize.Lg} | ||
label={strings('app_settings.developer_options.generate_trace_test')} | ||
onPress={handleGenerateTraceTest} | ||
width={ButtonWidthTypes.Full} | ||
style={styles.accessory} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export default function SentryTest() { | ||
const theme = useTheme(); | ||
const { styles } = useStyles(styleSheet, { theme }); | ||
|
||
return ( | ||
<> | ||
<Text | ||
color={TextColor.Default} | ||
variant={TextVariant.HeadingLG} | ||
style={styles.heading} | ||
> | ||
{'Sentry'} | ||
</Text> | ||
<GenerateTrace /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.