Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix: to be fixed position the list header.
Browse files Browse the repository at this point in the history
  • Loading branch information
AtuyL authored and martinheidegger committed Dec 3, 2018
1 parent 9b65320 commit 5f198cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/components/table-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import FinderButton from './finder-button'
import HexContent from './hex-content'
import TitleField from './title-field'

const Tr = styled.tr`
export const Tr = styled.tr`
transition: background-color 0.025s ease-out;
&:hover,
&:focus {
Expand Down
29 changes: 16 additions & 13 deletions app/components/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React from 'react'
import styled from 'styled-components'
import TableRowContainer from '../containers/table-row'
import { Tr } from './table-row'
import Empty from './empty'

const StyledTable = styled.table`
Expand All @@ -14,6 +15,9 @@ const StyledTable = styled.table`
td {
padding-right: 0.75rem;
padding-left: 0.75rem;
&:nth-child(2) {
padding-left: 0;
}
}
th {
height: 4rem;
Expand All @@ -22,13 +26,8 @@ const StyledTable = styled.table`
color: var(--color-neutral-60);
border-bottom: 1px solid var(--color-neutral-20);
&:first-child {
width: 3rem;
padding: 0;
border: none;
}
&:last-child {
width: 8.25rem;
}
}
td {
height: 4rem;
Expand All @@ -46,24 +45,28 @@ const Table = ({ dats, show }) => {
if (!Object.keys(dats).length) return <Empty />

return (
<main>
<main className='flex flex-column'>
<StyledTable>
<thead>
<tr>
<Tr>
<th className='cell-1' />
<th className='tl cell-2'>Link</th>
<th className='tl cell-3'>Status</th>
<th className='tl cell-4'>Size</th>
<th className='tl cell-5'>Peers</th>
<th className='cell-6' />
</tr>
</Tr>
</thead>
<tbody>
{Object.keys(dats).map(key => (
<TableRowContainer key={key} dat={dats[key]} />
))}
</tbody>
</StyledTable>
<div className='flex-auto overflow-y-auto'>
<StyledTable>
<tbody>
{Object.keys(dats).map(key => (
<TableRowContainer key={key} dat={dats[key]} />
))}
</tbody>
</StyledTable>
</div>
</main>
)
}
Expand Down

0 comments on commit 5f198cb

Please sign in to comment.