Skip to content
Snippets Groups Projects
Commit aca26cc1 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

style(table): stick header and scroll content

parent f856d1ee
No related branches found
No related tags found
1 merge request!13Sprint #14
...@@ -48,9 +48,9 @@ const TR = ({ ...@@ -48,9 +48,9 @@ const TR = ({
)} )}
</td> </td>
<DateParser timestamp={r.invitedOn}> <DateParser timestamp={r.invitedOn}>
{timestamp => <td>{timestamp}</td>} {timestamp => <td width="150">{timestamp}</td>}
</DateParser> </DateParser>
<td> <td width="200">
<StatusText> <StatusText>
{`${r.status === 'accepted' ? 'Agreed' : r.status}`} {`${r.status === 'accepted' ? 'Agreed' : r.status}`}
</StatusText> </StatusText>
...@@ -61,7 +61,7 @@ const TR = ({ ...@@ -61,7 +61,7 @@ const TR = ({
)} )}
</td> </td>
<DateParser timestamp={submittedOn}> <DateParser timestamp={submittedOn}>
{timestamp => <td>{timestamp}</td>} {timestamp => <td width="150">{timestamp}</td>}
</DateParser> </DateParser>
<td width={100}> <td width={100}>
{r.status === 'pending' && ( {r.status === 'pending' && (
...@@ -83,31 +83,29 @@ const ReviewersDetailsList = ({ ...@@ -83,31 +83,29 @@ const ReviewersDetailsList = ({
}) => }) =>
reviewers.length > 0 ? ( reviewers.length > 0 ? (
<Root> <Root>
<ScrollContainer> <Table>
<Table> <thead>
<thead> <tr>
<tr> <td>Full Name</td>
<td>Full Name</td> <td width="150">Invited On</td>
<td>Invited On</td> <td width="200">Responded On</td>
<td>Responded On</td> <td width="150">Submitted On</td>
<td>Submitted On</td> <td width="100" />
<td /> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> {reviewers.map((r, index) => (
{reviewers.map((r, index) => ( <TR
<TR index={index}
index={index} key={r.email}
key={r.email} renderAcceptedLabel={renderAcceptedLabel}
renderAcceptedLabel={renderAcceptedLabel} reviewer={r}
reviewer={r} showConfirmResend={showConfirmResend}
showConfirmResend={showConfirmResend} showConfirmRevoke={showConfirmRevoke}
showConfirmRevoke={showConfirmRevoke} />
/> ))}
))} </tbody>
</tbody> </Table>
</Table>
</ScrollContainer>
</Root> </Root>
) : ( ) : (
<div> No reviewers details </div> <div> No reviewers details </div>
...@@ -205,11 +203,6 @@ const StatusText = ReviewerEmail.extend` ...@@ -205,11 +203,6 @@ const StatusText = ReviewerEmail.extend`
const DateText = ReviewerEmail.extend`` const DateText = ReviewerEmail.extend``
const ScrollContainer = styled.div`
align-self: stretch;
flex: 1;
overflow: auto;
`
const Root = styled.div` const Root = styled.div`
align-items: stretch; align-items: stretch;
align-self: stretch; align-self: stretch;
...@@ -218,13 +211,28 @@ const Root = styled.div` ...@@ -218,13 +211,28 @@ const Root = styled.div`
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
height: 25vh; height: 25vh;
display: table;
` `
const Table = styled.table` const Table = styled.table`
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
thead {
display: table;
width: calc(100% - 1em);
}
tbody {
overflow: auto;
max-height: 180px;
margin-bottom: ${th('gridUnit')};
display: block;
tr {
display: table;
width: 100%;
table-layout: fixed;
}
}
& thead tr { & thead tr {
${defaultText}; ${defaultText};
border-bottom: ${th('borderDefault')}; border-bottom: ${th('borderDefault')};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment