This commit is contained in:
Jan Prochazka
2020-11-12 09:46:01 +01:00
parent 4ef7f275e6
commit c7b693cfb6
16 changed files with 386 additions and 74 deletions

View File

@@ -5,10 +5,11 @@ import ErrorInfo from '../widgets/ErrorInfo';
import styled from 'styled-components';
import { TextCellViewWrap, TextCellViewNoWrap } from './TextCellView';
import JsonCellView from './JsonCellDataView';
import useTheme from '../theme/useTheme';
const Toolbar = styled.div`
display: flex;
background: #ccc;
background: ${(props) => props.theme.toolbar_background};
align-items: center;
`;
@@ -53,6 +54,7 @@ function autodetect(selection, grider, value) {
export default function CellDataView({ selection, grider }) {
const [selectedFormatType, setSelectedFormatType] = React.useState('autodetect');
const theme = useTheme();
let value = null;
if (grider && selection.length == 1) {
const rowData = grider.getRowData(selection[0].row);
@@ -69,7 +71,7 @@ export default function CellDataView({ selection, grider }) {
return (
<MainWrapper>
<Toolbar>
<Toolbar theme={theme}>
Format:
<SelectField value={selectedFormatType} onChange={(e) => setSelectedFormatType(e.target.value)}>
<option value="autodetect">Autodetect - {autodetectFormat.title}</option>