Skip to content

Commit 5d16cb9

Browse files
authored
Merge pull request #18 from 1Byte-Software/develop
Update version 1.6.2
2 parents 7043e2a + c088583 commit 5d16cb9

File tree

5 files changed

+49
-14
lines changed

5 files changed

+49
-14
lines changed

CHANGELOG.md

Lines changed: 9 additions & 3 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.2]
9+
10+
### Added
11+
12+
- Add `fitScreen` prop for `DashboardTemplate` component.
13+
814
## [1.6.1]
915

1016
### Added
@@ -14,12 +20,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1420

1521
### Changed
1622

17-
-
23+
-
1824

1925
### Fixed
2026

21-
- Fix unnecessary rerender for Table.
22-
- Fix UploadDragger to Upload.Dragger
27+
- Fix unnecessary rerender for Table.
28+
- Fix UploadDragger to Upload.Dragger
2329

2430
### Deprecated
2531

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "1byte-react-design",
3-
"version": "1.6.1",
3+
"version": "1.6.2-3",
44
"main": "dist/index.js",
55
"module": "dist/index.js",
66
"types": "dist/index.d.ts",
7+
"files": [
8+
"dist"
9+
],
710
"license": "MIT",
811
"scripts": {
912
"build": "webpack --config webpack.config.js",

src/templates/DashboardTemplate/DashboardTemplate.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,31 @@ import { Layout } from '../../molecules';
33
import DashboardTemplateFooter from './Footer';
44
import DashboardTemplateHeader from './Header';
55
import DashboardTemplateSider from './Sider';
6-
import { DashboardTemplateContent, DashboardTemplateStyles } from './styles';
6+
import {
7+
DashboardTemplateContent,
8+
DashboardTemplateSkeletonLayout,
9+
DashboardTemplateStyles,
10+
} from './styles';
711
import { RdDashboardTemplateComponent, RdDashboardTemplateCompoundedComponent } from './types';
812

913
const DashboardTemplateInternal: RdDashboardTemplateComponent = forwardRef((props, ref) => {
10-
const { headerProps, siderProps, footerProps, ...restProps } = props;
14+
const { headerProps, siderProps, footerProps, fitScreen = false, ...restProps } = props;
1115

1216
return (
13-
<DashboardTemplateStyles ref={ref} {...restProps}>
17+
<DashboardTemplateStyles ref={ref} fitScreen={fitScreen} {...restProps}>
1418
{headerProps && <DashboardTemplateHeader {...headerProps} />}
1519

1620
<Layout hasSider={Boolean(siderProps)}>
1721
{siderProps && <DashboardTemplateSider {...siderProps} />}
1822

19-
<Layout>
20-
<DashboardTemplateContent>{props.children}</DashboardTemplateContent>
23+
<DashboardTemplateSkeletonLayout>
24+
<DashboardTemplateContent fitScreen={fitScreen}>
25+
{props.children}
26+
</DashboardTemplateContent>
2127
{footerProps !== false && (
2228
<DashboardTemplateFooter {...footerProps}></DashboardTemplateFooter>
2329
)}
24-
</Layout>
30+
</DashboardTemplateSkeletonLayout>
2531
</Layout>
2632
</DashboardTemplateStyles>
2733
);

src/templates/DashboardTemplate/styles.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,36 @@ import { getAliasToken, getComponentToken } from '../../utils';
55

66
export const DashboardTemplateStyles = styled(Layout, {
77
label: 'rd-dashboard-template',
8-
})`
8+
})<{
9+
fitScreen: boolean;
10+
}>`
911
${() => css`
1012
background: ${getAliasToken('DashboardTemplate', 'colorBgLayout')};
1113
`}
14+
15+
${({ fitScreen }) =>
16+
fitScreen &&
17+
css`
18+
height: 100vh;
19+
`}
1220
`;
1321

22+
export const DashboardTemplateSkeletonLayout = styled(Layout, {
23+
label: 'rd-dashboard-template-skeleton',
24+
})``;
25+
1426
export const DashboardTemplateContent = styled(Layout.Content, {
1527
label: 'rd-dashboard-template-content',
16-
})`
28+
})<{
29+
fitScreen: boolean;
30+
}>`
1731
${() => css`
18-
padding: ${getComponentToken('CenteredTemplate', 'contentPadding') || '32px 32px'};
32+
padding: ${getComponentToken('DashboardTemplate', 'contentPadding') || '32px 32px'};
1933
`}
34+
35+
${({ fitScreen }) =>
36+
fitScreen &&
37+
css`
38+
overflow: auto;
39+
`}
2040
`;

src/templates/DashboardTemplate/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type DashboardTemplatePropsExtend = {
1616
headerProps?: RdDashboardTemplateHeaderProps | false;
1717
siderProps?: RdDashboardTemplateSiderProps | false;
1818
footerProps?: RdDashboardTemplateFooterProps | false;
19-
test?: boolean;
19+
fitScreen?: boolean;
2020
};
2121

2222
type DashboardTemplateRefExtend = {};

0 commit comments

Comments
 (0)