-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS-9 Mess around with layout (proof of concept) #74
base: 3.x
Are you sure you want to change the base?
Changes from 10 commits
98191a8
484dd7a
5e54afd
f9e6b79
8a1d512
5b45520
b68284f
a4fb9c8
e7bbbd3
19c2a6a
3382e1f
cbf2347
23a4e26
8b4d040
4d6dd5a
85c2b2e
a8e9762
127bf45
c2fd448
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,18 @@ | |
*/ | ||
|
||
.fs-aside { | ||
width: 22.85714%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how these specific widths were calculated before but we should have grid-template-columns in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 22.85714% 74.28571% |
||
float: left; | ||
margin-right: -100%; | ||
margin-left: 0; | ||
clear: both; | ||
margin-bottom: rhythm(1); | ||
background-color: $c-bg-gray; | ||
@include breakpoint($bp2) { | ||
} | ||
} | ||
|
||
.fs-aside__mobile-reverse { | ||
order: 2; | ||
} | ||
|
||
// Layout option to move aside to right on desktop | ||
.fs-aside__desktop-reverse { | ||
@include breakpoint($bp2) { | ||
padding-top: rhythm(1); | ||
order: 6; // Should be higher than all mobile orders. | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* container.scss | ||
* Define container styles. | ||
* | ||
* @copyright Copyright (c) 2017-2020 Palantir.net | ||
*/ | ||
|
||
.fs-container { | ||
display: flex; | ||
flex-direction: column; | ||
@include breakpoint($bp2) { | ||
display: grid; | ||
grid-column-gap: 1em; | ||
grid-template-columns: 33% 66%; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,14 +98,25 @@ class FederatedSolrFacetedSearch extends React.Component { | |
pageTitle = <h1>{this.props.options.pageTitle}</h1>; | ||
} | ||
|
||
// Grab env vars. | ||
const { | ||
containerClass = '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we lose some default values here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The optional custom classes would be additional to existing classes if needed so the default is to have none, so I think this is ok as is. |
||
asideClass = '', | ||
mainClass = '', | ||
gridTemplateColumns = '', | ||
reverseDesktopColumns = false, | ||
reverseMobileOrder = false, | ||
} = this.props.options.layoutAndClasses || {}; | ||
|
||
return ( | ||
<LiveAnnouncer> | ||
<div className="fs-container"> | ||
<aside className="fs-aside"> | ||
<div className={`fs-container ${containerClass}`} style={{ gridTemplateColumns: gridTemplateColumns }}> | ||
<aside className={`fs-aside ${asideClass} ${reverseDesktopColumns ? 'fs-aside__desktop-reverse' : ''} ${reverseMobileOrder ? 'fs-aside__mobile-reverse' : ''}`}> | ||
<SearchFieldContainerComponent | ||
bootstrapCss={bootstrapCss} | ||
onNewSearch={this.resetFilters} | ||
resultsCount={this.props.results.numFound} | ||
options={this.props.options} | ||
> | ||
{/* Only render the visible facets / filters. | ||
Note: their values may still be used in the query, if they were pre-set. */} | ||
|
@@ -137,7 +148,7 @@ class FederatedSolrFacetedSearch extends React.Component { | |
} | ||
</SearchFieldContainerComponent> | ||
</aside> | ||
<div className="fs-main"> | ||
<div className={`fs-main ${mainClass}`}> | ||
{pageTitle} | ||
<div className="fs-search-form" autoComplete="on"> | ||
<FederatedTextSearch | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't exactly work with clean percentages because the gap width needs to be subtracted, so we might want to make some preset styles with the widths calculated for the most common percentages. Or use padding instead of the grid gap...