Skip to content

Commit

Permalink
feat(pointcloud): PointCloud sidebar support custom dom
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Aug 30, 2022
1 parent 23e1d20 commit b7347ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/lb-components/src/types/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export type Sider = ({
tagToolSideBar: React.ReactNode;
textToolSideBar: React.ReactNode;
horizontal: React.ReactNode;

// PointCloud
pointCloudToolSidebar : React.ReactNode;
pointCloudOperation: React.ReactNode;
}) => React.ReactNode | React.ReactNode;

interface IFooter {
Expand Down
7 changes: 7 additions & 0 deletions packages/lb-components/src/views/MainView/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ const Sidebar: React.FC<IProps> = ({ sider }) => {

const horizontal = <div className={`${sidebarCls}__horizontal`} />;

const pointCloudToolSidebar = <PointCloudToolSidebar />;

const pointCloudOperation = <PointCloudOperation />;

if (sider) {
if (typeof sider === 'function') {
return (
Expand All @@ -117,6 +121,9 @@ const Sidebar: React.FC<IProps> = ({ sider }) => {
tagToolSideBar,
textToolSideBar,
horizontal,

pointCloudToolSidebar,
pointCloudOperation,
})}
</div>
);
Expand Down
20 changes: 10 additions & 10 deletions packages/lb-components/src/views/MainView/toolFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ const ToolFooter: React.FC<IProps> = (props: IProps) => {
<span>{t('curItems', { current: basicIndex + 1, total: basicResultList.length })}</span>
) : null;

if (stepInfo.tool === EPointCloudName.PointCloud) {
return (
<div className={`${footerCls}`} style={props.style}>
<FooterTips />
<div style={{ flex: 1 }} />
{pagination}
</div>
);
}

if (typeof footer === 'function') {
if (footer === renderFooter && stepInfo.tool === EPointCloudName.PointCloud) {
return (
<div className={`${footerCls}`} style={props.style}>
<FooterTips />
<div style={{ flex: 1 }} />
{pagination}
</div>
);
}

return (
<div className={`${footerCls}`} style={props.style}>
{footer({
Expand Down

0 comments on commit b7347ee

Please sign in to comment.