29 lines
890 B
JavaScript
29 lines
890 B
JavaScript
import { Input, Item, Label } from "native-base";
|
|
import React from "react";
|
|
import { StyleSheet } from "react-native";
|
|
import { connect } from "react-redux";
|
|
import { createStructuredSelector } from "reselect";
|
|
import { DateTime } from "luxon";
|
|
const mapStateToProps = createStructuredSelector({
|
|
//currentUser: selectCurrentUser
|
|
});
|
|
const mapDispatchToProps = (dispatch) => ({});
|
|
|
|
export function DataLabelComponent({ label, content, dateTime, ...restProps }) {
|
|
let theContent = content;
|
|
|
|
if (dateTime && content)
|
|
theContent = DateTime.fromISO(content).toLocaleString(
|
|
DateTime.DATETIME_SHORT
|
|
);
|
|
|
|
return (
|
|
<Item stackedLabel {...restProps}>
|
|
<Label>{label}</Label>
|
|
<Input disabled placeholder={theContent} />
|
|
</Item>
|
|
);
|
|
}
|
|
const localStyles = StyleSheet.create({});
|
|
export default connect(mapStateToProps, mapDispatchToProps)(DataLabelComponent);
|