55 lines
1.5 KiB
React
55 lines
1.5 KiB
React
// Metro module 1830 (f1831).
|
|
import { useCallback, useMemo } from "react";
|
|
import { Text, StyleSheet } from "react-native";
|
|
import _default2 from "./_default_1825";
|
|
import { useKeyboardState } from "./useResizeMode";
|
|
import { useToolbarContext } from "./Module1831";
|
|
import { KeyboardController } from "./Module1798";
|
|
import { TEST_ID_KEYBOARD_TOOLBAR_DONE } from "./Module1824";
|
|
const styles = StyleSheet.create({
|
|
doneButton: {
|
|
fontWeight: "600",
|
|
fontSize: 15
|
|
},
|
|
doneButtonContainer: {
|
|
marginRight: 16,
|
|
marginLeft: 8
|
|
}
|
|
});
|
|
export default (a0) => {
|
|
let theme;
|
|
let children = a0.children;
|
|
const { onPress, rippleRadius = 28, text, button: Button = _default2 } = a0;
|
|
theme = void 0;
|
|
const keyboardState = useKeyboardState((a0) => a0.appearance);
|
|
theme = useToolbarContext().theme;
|
|
const memo = useMemo(() => [styles.doneButton, {
|
|
color: theme[keyboardState].primary
|
|
}], [keyboardState, theme]);
|
|
const r35 = {
|
|
accessibilityHint: "Closes the keyboard",
|
|
accessibilityLabel: "Done",
|
|
rippleRadius,
|
|
style: styles.doneButtonContainer,
|
|
testID: TEST_ID_KEYBOARD_TOOLBAR_DONE,
|
|
theme,
|
|
onPress: useCallback((a0) => {
|
|
if (onPress != null) {
|
|
onPress(a0);
|
|
}
|
|
if (!a0.isDefaultPrevented()) {
|
|
KeyboardController.dismiss();
|
|
}
|
|
}, [onPress]),
|
|
children: null
|
|
};
|
|
if (children == null) {
|
|
children = text;
|
|
}
|
|
if (children == null) {
|
|
children = "Done";
|
|
}
|
|
r35.children = <Text maxFontSizeMultiplier={1.3} style={memo}>{children}</Text>;
|
|
return <Button {...r35} />;
|
|
};
|