-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbd8339
commit f3beefc
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { forwardRef, LegacyRef } from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
export interface Props { | ||
className?: string; | ||
children?: React.ReactNode; | ||
} | ||
|
||
const SidebarContent: React.ForwardRefRenderFunction<unknown, Props> = ( | ||
{ children, className, ...rest }, | ||
ref, | ||
) => { | ||
const sidebarContentRef: LegacyRef<HTMLDivElement> = | ||
(ref as any) || React.createRef<HTMLDivElement>(); | ||
return ( | ||
<div {...rest} ref={sidebarContentRef} className={classNames('pro-sidebar-content', className)}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default forwardRef<unknown, Props>(SidebarContent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { forwardRef, LegacyRef } from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
export interface Props { | ||
className?: string; | ||
children?: React.ReactNode; | ||
} | ||
|
||
const SidebarFooter: React.ForwardRefRenderFunction<unknown, Props> = ( | ||
{ children, className, ...rest }, | ||
ref, | ||
) => { | ||
const sidebarFooterRef: LegacyRef<HTMLDivElement> = | ||
(ref as any) || React.createRef<HTMLDivElement>(); | ||
return ( | ||
<div {...rest} ref={sidebarFooterRef} className={classNames('pro-sidebar-footer', className)}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default forwardRef<unknown, Props>(SidebarFooter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { forwardRef, LegacyRef } from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
export interface Props { | ||
className?: string; | ||
children?: React.ReactNode; | ||
} | ||
|
||
const SidebarHeader: React.ForwardRefRenderFunction<unknown, Props> = ( | ||
{ children, className, ...rest }, | ||
ref, | ||
) => { | ||
const sidebarHeaderRef: LegacyRef<HTMLDivElement> = | ||
(ref as any) || React.createRef<HTMLDivElement>(); | ||
return ( | ||
<div {...rest} ref={sidebarHeaderRef} className={classNames('pro-sidebar-header', className)}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default forwardRef<unknown, Props>(SidebarHeader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
export { default as ProSidebar } from './ProSidebar/ProSidebar'; | ||
export { default as SidebarHeader } from './ProSidebar/SidebarHeader'; | ||
export { default as SidebarContent } from './ProSidebar/SidebarContent'; | ||
export { default as SidebarFooter } from './ProSidebar/SidebarFooter'; | ||
export { default as Menu } from './ProSidebar/Menu'; | ||
export { default as MenuItem } from './ProSidebar/MenuItem'; | ||
export { default as SubMenu } from './ProSidebar/SubMenu'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters