Created
June 15, 2017 16:02
-
-
Save AlexFrazer/4196b451be45005c799af21e82f7d733 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Link } from 'react-router'; | |
type Props = {}; | |
export default function Facet({ | |
property, | |
value, | |
label, | |
...props, | |
}: Props) { | |
return ( | |
<Link | |
to={(location) => ({ | |
...location, | |
query: { | |
...location.query, | |
[property]: value, | |
} | |
})} | |
className={styles.facet} | |
activeClassName={styles.active} | |
> | |
{label} | |
</Link> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment