Skip to content

Commit 7f1210f

Browse files
authored
Merge pull request #28 from 1Byte-Software/develop
Update DashboardTemplate
2 parents 3bb4533 + c9e2d4c commit 7f1210f

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.4]
9+
10+
### Fixed
11+
12+
- Improve DashboardTemplate component.
13+
814
## [1.6.3]
915

1016
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "1byte-react-design",
3-
"version": "1.6.3-2",
3+
"version": "1.6.4",
44
"main": "dist/index.js",
55
"module": "dist/index.js",
66
"types": "dist/index.d.ts",

src/templates/DashboardTemplate/DashboardTemplate.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ import {
1111
import { RdDashboardTemplateComponent, RdDashboardTemplateCompoundedComponent } from './types';
1212

1313
const DashboardTemplateInternal: RdDashboardTemplateComponent = forwardRef((props, ref) => {
14-
const { headerProps, siderProps, footerProps, fitScreen = false, ...restProps } = props;
14+
const {
15+
headerProps = null,
16+
siderProps = null,
17+
footerProps = null,
18+
fitScreen = false,
19+
...restProps
20+
} = props;
1521

1622
return (
1723
<DashboardTemplateStyles ref={ref} fitScreen={fitScreen} {...restProps}>
@@ -24,7 +30,7 @@ const DashboardTemplateInternal: RdDashboardTemplateComponent = forwardRef((prop
2430
<DashboardTemplateContent fitScreen={fitScreen}>
2531
{props.children}
2632
</DashboardTemplateContent>
27-
{footerProps !== false && (
33+
{footerProps && (
2834
<DashboardTemplateFooter {...footerProps}></DashboardTemplateFooter>
2935
)}
3036
</DashboardTemplateSkeletonLayout>

src/templates/DashboardTemplate/styles.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import { Layout } from '../../molecules';
44
import { getAliasToken, getComponentToken } from '../../utils';
55

66
export const DashboardTemplateStyles = styled(Layout, {
7-
label: 'rd-dashboard-template',
7+
target: 'rd-dashboard-template',
88
})<{
99
fitScreen: boolean;
1010
}>`
11+
min-height: 100vh;
12+
1113
${() => css`
1214
background: ${getAliasToken('DashboardTemplate', 'colorBgLayout')};
1315
`}
@@ -20,14 +22,15 @@ export const DashboardTemplateStyles = styled(Layout, {
2022
`;
2123

2224
export const DashboardTemplateSkeletonLayout = styled(Layout, {
23-
label: 'rd-dashboard-template-skeleton',
25+
target: 'rd-dashboard-template-skeleton',
2426
})``;
2527

2628
export const DashboardTemplateContent = styled(Layout.Content, {
27-
label: 'rd-dashboard-template-content',
29+
target: 'rd-dashboard-template-content',
2830
})<{
2931
fitScreen: boolean;
3032
}>`
33+
height: 0;
3134
${() => css`
3235
padding: ${getComponentToken('DashboardTemplate', 'contentPadding') || '32px 32px'};
3336
`}

src/templates/DashboardTemplate/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type DashboardTemplateComponentTokenExtend = {
1313

1414
//#region Define extended types
1515
type DashboardTemplatePropsExtend = {
16-
headerProps?: RdDashboardTemplateHeaderProps | false;
17-
siderProps?: RdDashboardTemplateSiderProps | false;
18-
footerProps?: RdDashboardTemplateFooterProps | false;
16+
headerProps?: RdDashboardTemplateHeaderProps | null;
17+
siderProps?: RdDashboardTemplateSiderProps | null;
18+
footerProps?: RdDashboardTemplateFooterProps | null;
1919
fitScreen?: boolean;
2020
};
2121

0 commit comments

Comments
 (0)