Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing TypeScript types for AppBar and other layout components #5410

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/ra-ui-materialui/src/layout/HideOnScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import PropTypes from 'prop-types';
import useScrollTrigger from '@material-ui/core/useScrollTrigger';
import Slide from '@material-ui/core/Slide';

interface Props {
children: React.ReactElement;
}

function HideOnScroll(props: Props) {
function HideOnScroll(props: HideOnScrollProps) {
const { children } = props;
const trigger = useScrollTrigger();
return (
Expand All @@ -21,4 +17,8 @@ HideOnScroll.propTypes = {
children: PropTypes.node.isRequired,
};

export interface HideOnScrollProps {
children: React.ReactElement;
}

export default HideOnScroll;
32 changes: 22 additions & 10 deletions packages/ra-ui-materialui/src/layout/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import AppBar from './AppBar';
import AppBar, { AppBarProps } from './AppBar';
import CardActions from './CardActions';
import CardContentInner from './CardContentInner';
import Confirm from './Confirm';
import DashboardMenuItem from './DashboardMenuItem';
import DeviceTestWrapper from './DeviceTestWrapper';
import Error from './Error';
import HideOnScroll from './HideOnScroll';
import Confirm, { ConfirmProps } from './Confirm';
import DashboardMenuItem, { DashboardMenuItemProps } from './DashboardMenuItem';
import DeviceTestWrapper, { DeviceTestWrapperProps } from './DeviceTestWrapper';
import Error, { ErrorProps } from './Error';
import HideOnScroll, { HideOnScrollProps } from './HideOnScroll';
import Layout from './Layout';
import Loading from './Loading';
import LinearProgress from './LinearProgress';
Expand All @@ -14,15 +14,13 @@ import Menu, { MenuProps } from './Menu';
import MenuItemLink, { MenuItemLinkProps } from './MenuItemLink';
import NotFound from './NotFound';
import Notification from './Notification';
import Responsive from './Responsive';
import Responsive, { ResponsiveProps } from './Responsive';
import Sidebar, { SidebarProps } from './Sidebar';
import Title, { TitlePropType } from './Title';
import Title, { TitleProps, TitlePropType } from './Title';
import TitleForRecord from './TitleForRecord';
import TopToolbar from './TopToolbar';
import UserMenu from './UserMenu';

export type { MenuProps, MenuItemLinkProps, SidebarProps };

export {
AppBar,
CardActions,
Expand All @@ -48,3 +46,17 @@ export {
TopToolbar,
UserMenu,
};

export type {
AppBarProps,
ConfirmProps,
DashboardMenuItemProps,
DeviceTestWrapperProps,
ErrorProps,
HideOnScrollProps,
MenuItemLinkProps,
MenuProps,
ResponsiveProps,
SidebarProps,
TitleProps,
};