withPadding prop was injected
This commit is contained in:
parent
9afc84e087
commit
f5c13b9751
@ -1,7 +1,10 @@
|
||||
import React, { useRef } from "react";
|
||||
import TableHeader from "@docspace/components/table-container/TableHeader";
|
||||
import { inject, observer } from "mobx-react";
|
||||
|
||||
const HistoryTableHeader = (props) => {
|
||||
const { sectionWidth, tableRef, withPaging } = props;
|
||||
|
||||
export const HistoryTableHeader = ({ sectionWidth, tableRef }) => {
|
||||
const columns = useRef([
|
||||
{
|
||||
key: "Event ID",
|
||||
@ -27,10 +30,20 @@ export const HistoryTableHeader = ({ sectionWidth, tableRef }) => {
|
||||
return (
|
||||
<TableHeader
|
||||
columns={columns.current}
|
||||
checkboxSize="32px"
|
||||
containerRef={tableRef}
|
||||
sectionWidth={sectionWidth}
|
||||
// useReactWindow={!withPaging}
|
||||
showSettings={false}
|
||||
style={{ position: "absolute" }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ settingsStore }) => {
|
||||
const { withPaging } = settingsStore;
|
||||
|
||||
return {
|
||||
withPaging,
|
||||
};
|
||||
})(observer(HistoryTableHeader));
|
||||
|
@ -4,7 +4,7 @@ import styled from "styled-components";
|
||||
|
||||
import TableContainer from "@docspace/components/table-container/TableContainer";
|
||||
import TableBody from "@docspace/components/table-container/TableBody";
|
||||
import { HistoryTableHeader } from "./HistoryTableHeader";
|
||||
import HistoryTableHeader from "./HistoryTableHeader";
|
||||
import { HistoryTableRow } from "./HistoryTableRow";
|
||||
|
||||
import { Consumer } from "@docspace/components/utils/context";
|
||||
@ -13,10 +13,15 @@ import { inject, observer } from "mobx-react";
|
||||
|
||||
const TableWrapper = styled(TableContainer)`
|
||||
margin-top: 16px;
|
||||
|
||||
.table-container_row-checkbox {
|
||||
padding-left: 20px;
|
||||
width: 16px;
|
||||
}
|
||||
`;
|
||||
|
||||
const WebhookHistoryTable = (props) => {
|
||||
const { viewAs } = props;
|
||||
const { viewAs, withPaging } = props;
|
||||
const tableRef = useRef(null);
|
||||
|
||||
return (
|
||||
@ -25,11 +30,12 @@ const WebhookHistoryTable = (props) => {
|
||||
viewAs === "table" ? (
|
||||
<TableWrapper
|
||||
forwardedRef={tableRef}
|
||||
// useReactWindow={!withPaging}
|
||||
style={{
|
||||
gridTemplateColumns: "300px 100px 400px 24px",
|
||||
}}>
|
||||
<HistoryTableHeader sectionWidth={context.sectionWidth} tableRef={tableRef} />
|
||||
<TableBody>
|
||||
<TableBody itemHeight={49}>
|
||||
<HistoryTableRow
|
||||
key="6F9619FF-8B86-D011-B42D-00CF4FC96r32"
|
||||
eventData={{
|
||||
@ -64,10 +70,13 @@ const WebhookHistoryTable = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ setup }) => {
|
||||
const { viewAs } = setup;
|
||||
export default inject(({ filesStore, settingsStore }) => {
|
||||
const { viewAs } = filesStore;
|
||||
|
||||
const { withPaging, theme } = settingsStore;
|
||||
return {
|
||||
viewAs,
|
||||
withPaging,
|
||||
theme,
|
||||
};
|
||||
})(observer(WebhookHistoryTable));
|
||||
|
Loading…
Reference in New Issue
Block a user