mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 21:21:19 +10:00
FilterPanel for SearchPage
This commit is contained in:
parent
bb3905a2b3
commit
2165c793ae
4 changed files with 94 additions and 0 deletions
37
src/components/FilterPanel/FilterPanel.css
Normal file
37
src/components/FilterPanel/FilterPanel.css
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
.filterTitle {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toListingsButton {
|
||||
position: fixed;
|
||||
bottom: 1rem;
|
||||
left: 50%;
|
||||
width: 200px;
|
||||
margin-left: -100px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font-size: 1.4rem;
|
||||
padding: 0.5rem;
|
||||
color: #fff;
|
||||
background-color: #9B9B9B;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: #888;
|
||||
}
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 3em;
|
||||
padding: 1em;
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
13
src/components/FilterPanel/FilterPanel.js
Normal file
13
src/components/FilterPanel/FilterPanel.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import React from 'react';
|
||||
import { NamedLink } from '../../components';
|
||||
import css from './FilterPanel.css';
|
||||
|
||||
const FilterPanel = () => (
|
||||
<div>
|
||||
<h1 className={css.filterTitle}>Filters</h1>
|
||||
<NamedLink className={css.toListingsButton} name="SearchListingsPage">See studios</NamedLink>
|
||||
<NamedLink className={css.close} name="SearchListingsPage">X</NamedLink>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default FilterPanel;
|
||||
22
src/components/FilterPanel/FilterPanel.test.js
Normal file
22
src/components/FilterPanel/FilterPanel.test.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { TestProvider } from '../../util/test-helpers';
|
||||
import { RoutesProvider } from '../../components';
|
||||
import routesConfiguration from '../../routesConfiguration';
|
||||
import FilterPanel from './FilterPanel';
|
||||
|
||||
describe('FilterPanel', () => {
|
||||
it('matches snapshot', () => {
|
||||
const component = renderer.create(
|
||||
(
|
||||
<TestProvider>
|
||||
<RoutesProvider routes={routesConfiguration}>
|
||||
<FilterPanel />
|
||||
</RoutesProvider>
|
||||
</TestProvider>
|
||||
),
|
||||
);
|
||||
const tree = component.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
exports[`FilterPanel matches snapshot 1`] = `
|
||||
<div>
|
||||
<h1
|
||||
className={undefined}>
|
||||
Filters
|
||||
</h1>
|
||||
<a
|
||||
className=""
|
||||
href="/s/listings"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
See studios
|
||||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/s/listings"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
X
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
Loading…
Add table
Reference in a new issue