Skip to content

Commit

Permalink
feat: mark-last-master-mix-column-as-total-volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Bigelmayr committed Jan 7, 2025
1 parent 306f21b commit a0df3c6
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/MasterMix/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { toggleElement } from '@mll-lab/js-utils';
import React, { useState } from 'react';
import styled from 'styled-components';

import { Card } from '../Card';
import { Table } from '../Table';
Expand All @@ -16,6 +17,12 @@ export {
PipettingLossByFactor,
} from './types';

const MasterMixTable = styled(Table)`
.total-volume-row {
background-color: lightgrey;
}
`;

/**
* The reactants can be clicked and marked as pipetted.
*/
Expand Down Expand Up @@ -43,13 +50,17 @@ export function MasterMix(props: MasterMixProps) {
<Typography.Title level={5}>{props.name} MasterMix</Typography.Title>
}
>
<Table
<MasterMixTable
style={{ maxWidth: 400 }}
rowClassName={(record) =>
highlightedEntries.includes(record.key.toString())
rowClassName={(record, index) => {
if (index === props.ingredients.length) {
return 'total-volume-row';
}

return highlightedEntries.includes(record.key.toString())
? 'mll-ant-table-row-selected'
: ''
}
: '';
}}
dataSource={ingredientsWithSumRow}
rowKey={(record) => record.key}
pagination={{ defaultPageSize: 10, hideOnSinglePage: true }}
Expand Down

0 comments on commit a0df3c6

Please sign in to comment.