Skip to content

docs: Add JSDoc comments to Page component #736

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

Merged
merged 6 commits into from
Oct 19, 2020
Merged
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
31 changes: 31 additions & 0 deletions packages/main/src/components/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,52 @@ import { CommonProps } from '../../interfaces/CommonProps';
import styles from './Page.jss';

export interface PagePropTypes extends CommonProps {
/**
* The title text appearing in the page header bar.
*/
title?: string;
/**
* It is used to set the background color of a page.
*/
backgroundDesign?: PageBackgroundDesign;
/**
* The (optional) custom header of this page. Use this prop only when a custom header
* is constructed where the default header consisting of title text + nav button is not sufficient.
*/
customHeader?: ReactNode;
/**
* The (optional) custom footer of this page.
*/
customFooter?: ReactNode;
/**
* A back button will be rendered on the left area of header bar if this property is set to true.
*/
showBackButton?: boolean;
/**
* Whether this page shall have a footer.
*/
showFooter?: boolean;
/**
* Whether this page shall have a header.
*/
showHeader?: boolean;
/**
* This event is fired when Nav Button is pressed.
*/
onNavButtonPress?: (e: CustomEvent<{}>) => void;
/**
* The content area of the page.
*/
children: ReactElement<any> | ReactElement<any>[] | ReactNode;
}

const useStyles = createComponentStyles(styles, {
name: 'Page'
});

/**
* A layout component that holds one whole screen of an application.
*/
const Page: FC<PagePropTypes> = forwardRef((props: PagePropTypes, ref: Ref<HTMLDivElement>) => {
const {
children,
Expand Down