Skip to content

Commit

Permalink
refactor: dataset header css cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Aug 29, 2019
1 parent 6adb9a9 commit d1cfbbc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
23 changes: 13 additions & 10 deletions app/components/Dataset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ export default class Dataset extends React.Component<DatasetProps> {
<HeaderColumnButton
label='link to filesystem'
tooltip='Link this dataset to a folder on your computer'
icon={(<>
<FontAwesomeIcon icon={faFile} size='lg'/>
<FontAwesomeIcon icon={faLink} transform="shrink-8" />
</>)}
icon={(
<span className='fa-layers fa-fw'>
<FontAwesomeIcon icon={faFile} size='lg'/>
<FontAwesomeIcon icon={faLink} transform="shrink-8" />
</span>
)}
onClick={() => { console.log('not finished: linking to filesystem') }}
/>
)
Expand Down Expand Up @@ -274,12 +276,13 @@ export default class Dataset extends React.Component<DatasetProps> {
<div className="label">{name ? 'Current Dataset' : 'Choose a Dataset'}</div>
<div className="name">{name}</div>
</div>
{
showDatasetList
? <div className="arrow collapse">&nbsp;</div>
: <div className="arrow expand">&nbsp;</div>
}

<div className='header-column-arrow'>
{
showDatasetList
? <div className="arrow collapse">&nbsp;</div>
: <div className="arrow expand">&nbsp;</div>
}
</div>
</div>
{linkButton}
{publishButton}
Expand Down
2 changes: 1 addition & 1 deletion app/components/chrome/HeaderColumnButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const HeaderColumnButton: React.FunctionComponent<HeaderColumnButtonProps> = (pr
>
{(icon !== '') && (typeof icon === 'string')
? <div className='header-column-icon'><FontAwesomeIcon icon={icons[icon]} size='lg'/></div>
: icon
: (<div className='header-column-icon'>{icon}</div>)
}
{(label !== '') &&
<div className='header-column-text'>
Expand Down
3 changes: 1 addition & 2 deletions app/components/chrome/HeaderColumnButtonDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const HeaderColumnButtonDropdown: React.FunctionComponent<HeaderColumnButtonDrop
return (
<div
className='header-column'
style={{ position: 'relative', paddingRight: 0 }}
data-tip={tooltip}
onClick={onClick}
>
Expand All @@ -36,7 +35,7 @@ const HeaderColumnButtonDropdown: React.FunctionComponent<HeaderColumnButtonDrop
<div className='label'>{label}</div>
</div>
}
<div onClick={toggleMenu} style={(onClick === toggleMenu) ? undefined : twoActionStyle }>
<div className='header-column-arrow' onClick={toggleMenu} style={(onClick === toggleMenu) ? undefined : twoActionStyle }>
{showMenu
? <div className="arrow collapse">&nbsp;</div>
: <div className="arrow expand">&nbsp;</div>
Expand Down
23 changes: 17 additions & 6 deletions app/scss/_dataset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ $header-font-size: .9rem;
background-color: #315379;
color: #F8F2F2;
cursor: default;
display: flex;
flex-direction: row;
flex-grow: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -60,29 +61,29 @@ $header-font-size: .9rem;
display: inline-flex;
flex-direction: row;
align-items: center;
min-width: 164px;

&:last-child {
float: right;
margin-left: auto;
border-left: $header-column-border;
}

.header-column-icon {
flex: 0 0 32px;

.icon-inline {
font-size: 1.2rem;
position: relative;
top: 5px;
left: 7px;
}


img {
border-radius: 2px;
}
}

.header-column-text {
flex-grow: 1;
overflow-x: hidden;
white-space: nowrap;
padding-left: 9px;

.label {
font-size: 0.75rem;
Expand All @@ -99,6 +100,12 @@ $header-font-size: .9rem;
}
}

.header-column-arrow {
height: 100%;
width: 26px;
padding-left: 9px;
}

&:hover {
background-color: #416588;
}
Expand Down Expand Up @@ -239,6 +246,10 @@ $header-font-size: .9rem;
z-index:10;
display: inline-flex;

.header-column-text {
overflow-x: hidden;
}

&.expanded {
color: #383838;
}
Expand Down

0 comments on commit d1cfbbc

Please sign in to comment.