<commit_before>import * as React from 'react'
import {StyleSheet, Platform} from 'react-native'
import BasicButton from 'react-native-button'
import noop from 'lodash/noop'
import {material, iOSUIKit} from 'react-native-typography'
import * as c from '@frogpond/colors'
import type {AppTheme} from '@frogpond/app-theme'
import {useTheme} from '@frogpond/app-theme'

const styles = StyleSheet.create({
	button: {
		alignSelf: 'center',
		paddingVertical: 10,
		paddingHorizontal: 20,
		marginVertical: 10,
		borderRadius: 6,
		overflow: 'hidden',
	},
	disabled: {
		backgroundColor: c.sectionBgColor,
	},
	text: {
		...Platform.select({
			ios: iOSUIKit.calloutWhiteObject,
			android: material.buttonWhiteObject,
		}),
	},
	textDisabled: {
		color: c.iosDisabledText,
	},
})

const inverted = StyleSheet.create({
	text: {
		...Platform.select({
			ios: iOSUIKit.calloutObject,
			android: material.buttonObject,
		}),
	},
})

type Props = {
	title?: string
	onPress?: () => any
	disabled?: boolean
	buttonStyle?: any
	textStyle?: any
	mode?: 'default' | 'inverted'
}

export function Button({
	title = 'Push me!',
	onPress = noop,
	disabled = false,
	buttonStyle = null,
	textStyle = null,
	mode = 'default',
}: Props) {
	const theme: AppTheme = useTheme()

	const background =
		mode === 'default'
			? {backgroundColor: theme.buttonBackground}
			: {backgroundColor: theme.buttonForeground}
	const foreground =
		mode === 'default'
			? {color: theme.buttonForeground}
			: {color: theme.buttonBackground}

	const textStyleThing = mode === 'default' ? styles.text : inverted.text
	const containerStyle = [styles.button, background, buttonStyle]
	const style = [textStyleThing, foreground, textStyle]

	return (
		<BasicButton
			containerStyle={containerStyle}
			disabled={disabled}
			disabledContainerStyle={styles.disabled}
			onPress={onPress}
			style={style}
			styleDisabled={styles.textDisabled}
		>
			{Platform.OS === 'android' ? title.toUpperCase() : title}
		</BasicButton>
	)
}
<commit_msg>m/button: Remove (incorrect) explicit type declaration<commit_after>import * as React from 'react'
import {StyleSheet, Platform} from 'react-native'
import BasicButton from 'react-native-button'
import noop from 'lodash/noop'
import {material, iOSUIKit} from 'react-native-typography'
import * as c from '@frogpond/colors'
import type {AppTheme} from '@frogpond/app-theme'
import {useTheme} from '@frogpond/app-theme'

const styles = StyleSheet.create({
	button: {
		alignSelf: 'center',
		paddingVertical: 10,
		paddingHorizontal: 20,
		marginVertical: 10,
		borderRadius: 6,
		overflow: 'hidden',
	},
	disabled: {
		backgroundColor: c.sectionBgColor,
	},
	text: {
		...Platform.select({
			ios: iOSUIKit.calloutWhiteObject,
			android: material.buttonWhiteObject,
		}),
	},
	textDisabled: {
		color: c.iosDisabledText,
	},
})

const inverted = StyleSheet.create({
	text: {
		...Platform.select({
			ios: iOSUIKit.calloutObject,
			android: material.buttonObject,
		}),
	},
})

type Props = {
	title?: string
	onPress?: () => any
	disabled?: boolean
	buttonStyle?: any
	textStyle?: any
	mode?: 'default' | 'inverted'
}

export function Button({
	title = 'Push me!',
	onPress = noop,
	disabled = false,
	buttonStyle = null,
	textStyle = null,
	mode = 'default',
}: Props) {
	const theme = useTheme()

	const background =
		mode === 'default'
			? {backgroundColor: theme.buttonBackground}
			: {backgroundColor: theme.buttonForeground}
	const foreground =
		mode === 'default'
			? {color: theme.buttonForeground}
			: {color: theme.buttonBackground}

	const textStyleThing = mode === 'default' ? styles.text : inverted.text
	const containerStyle = [styles.button, background, buttonStyle]
	const style = [textStyleThing, foreground, textStyle]

	return (
		<BasicButton
			containerStyle={containerStyle}
			disabled={disabled}
			disabledContainerStyle={styles.disabled}
			onPress={onPress}
			style={style}
			styleDisabled={styles.textDisabled}
		>
			{Platform.OS === 'android' ? title.toUpperCase() : title}
		</BasicButton>
	)
}

{'fraction_non_alphanumeric': 0.13628493692802374, 'fraction_numerical': 0.0034627751669552313, 'mean_word_length': 4.509536784741145, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2193387', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1305, 'n_words': 314}