44 lines
997 B
TypeScript
44 lines
997 B
TypeScript
|
import React from 'react';
|
||
|
import { View, Button, StyleSheet } from 'react-native';
|
||
|
|
||
|
interface BottomActionBarProps {
|
||
|
onRun: () => void;
|
||
|
onSave: () => void;
|
||
|
onUndo: () => void;
|
||
|
onRestore: () => void;
|
||
|
onBack: () => void;
|
||
|
isSaveDisabled?: boolean;
|
||
|
}
|
||
|
|
||
|
const BottomActionBar: React.FC<BottomActionBarProps> = ({
|
||
|
onRun,
|
||
|
onSave,
|
||
|
onUndo,
|
||
|
onRestore,
|
||
|
onBack,
|
||
|
isSaveDisabled = true,
|
||
|
}) => {
|
||
|
return (
|
||
|
<View style={styles.container}>
|
||
|
<Button title="运行" onPress={onRun} />
|
||
|
<Button title="保存" onPress={onSave} disabled={isSaveDisabled} />
|
||
|
<Button title="撤销" onPress={onUndo} />
|
||
|
<Button title="恢复" onPress={onRestore} />
|
||
|
<Button title="返回" onPress={onBack} />
|
||
|
</View>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
const styles = StyleSheet.create({
|
||
|
container: {
|
||
|
flexDirection: 'row',
|
||
|
justifyContent: 'space-around',
|
||
|
padding: 16,
|
||
|
borderTopWidth: 1,
|
||
|
borderColor: '#ccc',
|
||
|
backgroundColor: '#f5f5f5',
|
||
|
},
|
||
|
});
|
||
|
|
||
|
export default BottomActionBar;
|