Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.4]

### Fixed

- Improve DashboardTemplate component.

## [1.6.3]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "1byte-react-design",
"version": "1.6.3-2",
"version": "1.6.4",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
10 changes: 8 additions & 2 deletions src/templates/DashboardTemplate/DashboardTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import {
import { RdDashboardTemplateComponent, RdDashboardTemplateCompoundedComponent } from './types';

const DashboardTemplateInternal: RdDashboardTemplateComponent = forwardRef((props, ref) => {
const { headerProps, siderProps, footerProps, fitScreen = false, ...restProps } = props;
const {
headerProps = null,
siderProps = null,
footerProps = null,
fitScreen = false,
...restProps
} = props;

return (
<DashboardTemplateStyles ref={ref} fitScreen={fitScreen} {...restProps}>
Expand All @@ -24,7 +30,7 @@ const DashboardTemplateInternal: RdDashboardTemplateComponent = forwardRef((prop
<DashboardTemplateContent fitScreen={fitScreen}>
{props.children}
</DashboardTemplateContent>
{footerProps !== false && (
{footerProps && (
<DashboardTemplateFooter {...footerProps}></DashboardTemplateFooter>
)}
</DashboardTemplateSkeletonLayout>
Expand Down
9 changes: 6 additions & 3 deletions src/templates/DashboardTemplate/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { Layout } from '../../molecules';
import { getAliasToken, getComponentToken } from '../../utils';

export const DashboardTemplateStyles = styled(Layout, {
label: 'rd-dashboard-template',
target: 'rd-dashboard-template',
})<{
fitScreen: boolean;
}>`
min-height: 100vh;

${() => css`
background: ${getAliasToken('DashboardTemplate', 'colorBgLayout')};
`}
Expand All @@ -20,14 +22,15 @@ export const DashboardTemplateStyles = styled(Layout, {
`;

export const DashboardTemplateSkeletonLayout = styled(Layout, {
label: 'rd-dashboard-template-skeleton',
target: 'rd-dashboard-template-skeleton',
})``;

export const DashboardTemplateContent = styled(Layout.Content, {
label: 'rd-dashboard-template-content',
target: 'rd-dashboard-template-content',
})<{
fitScreen: boolean;
}>`
height: 0;
${() => css`
padding: ${getComponentToken('DashboardTemplate', 'contentPadding') || '32px 32px'};
`}
Expand Down
6 changes: 3 additions & 3 deletions src/templates/DashboardTemplate/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type DashboardTemplateComponentTokenExtend = {

//#region Define extended types
type DashboardTemplatePropsExtend = {
headerProps?: RdDashboardTemplateHeaderProps | false;
siderProps?: RdDashboardTemplateSiderProps | false;
footerProps?: RdDashboardTemplateFooterProps | false;
headerProps?: RdDashboardTemplateHeaderProps | null;
siderProps?: RdDashboardTemplateSiderProps | null;
footerProps?: RdDashboardTemplateFooterProps | null;
fitScreen?: boolean;
};

Expand Down