Skip to content

Commit

Permalink
Pass format settings from redux store (deephaven#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 3, 2024
1 parent 2f84c96 commit 5d64584
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/ui/src/js/src/elements/Picker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { ReactElement } from 'react';
import { useSelector } from 'react-redux';
import {
Picker as DHPicker,
PickerProps as DHPickerProps,
Expand All @@ -9,6 +10,7 @@ import {
useTableClose,
} from '@deephaven/jsapi-components';
import { isElementOfType, usePromiseFactory } from '@deephaven/react-hooks';
import { getSettings, RootState } from '@deephaven/redux';
import { SerializedPickerEventProps, usePickerProps } from './usePickerProps';
import ObjectView, { ObjectViewProps } from './ObjectView';
import { fetchReexportedTable } from './ElementUtils';
Expand All @@ -21,6 +23,7 @@ export type PickerProps = (DHPickerProps | WrappedDHPickerJSApiProps) &
SerializedPickerEventProps;

function Picker({ children, ...props }: PickerProps) {
const settings = useSelector(getSettings<RootState>);
const pickerProps = usePickerProps(props);

const isObjectView = isElementOfType(children, ObjectView);
Expand All @@ -38,7 +41,11 @@ function Picker({ children, ...props }: PickerProps) {

if (isObjectView) {
// eslint-disable-next-line react/jsx-props-no-spreading
return table && <DHPickerJSApi {...pickerProps} table={table} />;
return (
table && (
<DHPickerJSApi {...pickerProps} table={table} settings={settings} />
)
);
}

// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down

0 comments on commit 5d64584

Please sign in to comment.