Skip to content

Commit

Permalink
[#1093] style debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-p-s committed Jan 30, 2024
1 parent bb2dc65 commit ffa89d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion frontend/src/pages/submissions/UploadDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const UploadDetail = ({ record, setReload }) => {
const { user } = store.useState((state) => state);
const { language } = store.useState((s) => s);
const { active: activeLang } = language;
const [expandedKeys, setexpandedKeys] = useState([]);
const text = useMemo(() => {
return uiText[activeLang];
}, [activeLang]);
Expand Down Expand Up @@ -342,6 +343,11 @@ const UploadDetail = ({ record, setReload }) => {
);
};

const onRow = ({ key }) =>
expandedRowKeys.includes(key) && { className: "sticky" };

console.log(expandedRowKeys, "expandedRowKeys");

const isEditable =
(record.approvers || []).filter((a) => a.status_text === "Rejected")
.length > 0 && user?.role?.id === 4;
Expand All @@ -357,11 +363,12 @@ const UploadDetail = ({ record, setReload }) => {
loading={loading}
dataSource={selectedTab === "raw-data" ? rawValues : values}
columns={columns}
onRow={onRow}
rowClassName={(record) =>
(record.newValue || record.newValue === 0) &&
!isEqual(record.value, record.newValue)
? "row-edited"
: "row-normal"
: "row-normal sticky"
}
style={{ borderBottom: "solid 1px #ddd" }}
rowKey="id"
Expand Down Expand Up @@ -486,6 +493,8 @@ const UploadDetail = ({ record, setReload }) => {
}
: false
}
sticky={true}
scroll={{ x: 950, y: "calc(100vh - 220px)" }}
/>
<h3>{text.notesFeedback}</h3>
{!!comments.length && (
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/pages/submissions/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
color: $color-default;
vertical-align: top;
}

.sticky {
position: sticky;
top: 0;
left: 0;
z-index: 1;
}
.ant-table-cell:nth-child(2) {
.ant-row {
justify-content: flex-start;
Expand Down

0 comments on commit ffa89d6

Please sign in to comment.