How to use use-media-antd-query - 2 common examples

To help you get started, we’ve selected a few use-media-antd-query examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ant-design / pro-table / src / Form / index.tsx View on Github external
onSubmit,
  formRef,
  dateFormatter = 'string',
  search: propsSearch,
}: TableFormItem<T>) => {
  const intl = useIntl();
  const searchConfig = getDefaultSearch(propsSearch, intl);
  const { span, searchText, resetText, collapseRender } = searchConfig;

  const counter = Container.useContainer();
  const [collapse, setCollapse] = useState<boolean>(true);
  const [proColumnsMap, setProColumnsMap] = useState<{
    [key: string]: ProColumns<any>;
  }>({});

  const windowSize = useMediaQuery();
  const [colSize, setColSize] = useState(getSpanConfig(span, windowSize));
  const [formHeight, setFormHeight] = useState<number>(88);
  const rowNumber = 24 / colSize || 3;

  useEffect(() => {
    if (!formRef) {
      return;
    }
    if (typeof formRef === 'function') {
      formRef(form);
    }
    if (formRef && typeof formRef !== 'function') {
      // eslint-disable-next-line no-param-reassign
      formRef.current = form;
    }
  }, []);
github ant-design / ant-design-pro-layout / src / BasicLayout.tsx View on Github external
id,
        defaultMessage,
        ...rest,
      });
    }
    const locales = getLocales();
    if (locales[id]) {
      return locales[id];
    }
    if (defaultMessage) {
      return defaultMessage as string;
    }
    return id;
  };

  const colSize = useAntdMediaQuery();
  const { routes = [] } = route;
  const [menuInfoData, setMenuInfoData] = useMergeValue<{
    breadcrumb?: {
      [key: string]: MenuDataItem;
    };
    breadcrumbMap?: Map<string, MenuDataItem>;
    menuData?: MenuDataItem[];
  }>(() => getMenuData(routes, menu, formatMessage, menuDataRender));

  let renderMenuInfoData: {
    breadcrumb?: {
      [key: string]: MenuDataItem;
    };
    breadcrumbMap?: Map<string, MenuDataItem>;
    menuData?: MenuDataItem[];
  } = {};

use-media-antd-query

An antd compatible media query hooks

MIT
Latest version published 2 years ago

Package Health Score

47 / 100
Full package analysis

Popular use-media-antd-query functions

Similar packages

Popular JavaScript code snippets

Find secure code to use in your application or website