mistercrunch commented on code in PR #31019:
URL: https://github.com/apache/superset/pull/31019#discussion_r1915716221


##########
superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx:
##########
@@ -112,192 +107,173 @@ export function CustomFrame(props: FrameComponentProps) 
{
     }
   }
 
-  // check if there is a locale defined for explore
-  const localFromFlaskBabel = useSelector(
-    (state: ExplorePageState) => state?.common?.locale,
-  );
-
-  // An undefined datePickerLocale is acceptable if no match is found in the 
LOCALE_MAPPING[localFromFlaskBabel] lookup
-  // and will fall back to antd's default locale when the antd DataPicker's 
prop locale === undefined
-  // This also protects us from the case where state is populated with a 
locale that antd locales does not recognize
-  useEffect(() => {
-    if (datePickerLocale === null) {
-      if (localFromFlaskBabel && LOCALE_MAPPING[localFromFlaskBabel]) {
-        LOCALE_MAPPING[localFromFlaskBabel]()
-          .then((locale: { default: PickerLocale }) =>
-            setDatePickerLocale(locale.default),
-          )
-          .catch(() => setDatePickerLocale(undefined));
-      } else {
-        setDatePickerLocale(undefined);
-      }
-    }
-  }, [datePickerLocale, localFromFlaskBabel]);
-
   if (datePickerLocale === null) {
     return <Loading position="inline-centered" />;
   }
 
   return (
-    <div data-test="custom-frame">
-      <div className="section-title">{t('Configure custom time range')}</div>
-      <Row gutter={24}>
-        <Col span={12}>
-          <div className="control-label">
-            {t('START (INCLUSIVE)')}{' '}
-            <InfoTooltipWithTrigger
-              tooltip={t('Start date included in time range')}
-              placement="right"
-            />
-          </div>
-          <Select
-            ariaLabel={t('START (INCLUSIVE)')}
-            options={SINCE_MODE_OPTIONS}
-            value={sinceMode}
-            onChange={(value: string) => onChange('sinceMode', value)}
-          />
-          {sinceMode === 'specific' && (
-            <Row>
-              <DatePicker
-                showTime
-                defaultValue={dttmToMoment(sinceDatetime)}
-                onChange={(datetime: Moment) =>
-                  onChange('sinceDatetime', datetime.format(MOMENT_FORMAT))
-                }
-                allowClear={false}
-                locale={datePickerLocale}
-                getPopupContainer={triggerNode =>
-                  props.isOverflowingFilterBar
-                    ? (triggerNode.parentNode as HTMLElement)
-                    : document.body
-                }
+    <AntdThemeProvider locale={datePickerLocale}>

Review Comment:
   same here, we don't want to sprinkly theme providers in the react tree...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to