Skip to content

Commit

Permalink
Exchanges page (bitcoincashorg#589)
Browse files Browse the repository at this point in the history
* exchanges page

* update link
  • Loading branch information
johnkuney authored and EyeOfPython committed Nov 17, 2020
1 parent 15f7bee commit 4e72b94
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion v2/src/layout/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Header = () => {
},
{
text: fbt("Exchanges", "Community menu 'exchanges' link"),
href: "/exchanges.html",
href: "/exchanges/",
},
{
text: fbt("Nodes", "Community menu 'nodes' link"),
Expand Down
41 changes: 41 additions & 0 deletions v2/src/pages/exchanges.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react"
import fbt from "fbt"
import SEO from "components/seo"
import { Container } from "react-bootstrap"
import FeaturedTiles from "components/featured-tiles/featured-tiles.js"
import Tiles from "components/tiles/tiles.js"
import * as AllExchanges from "../partners/exchanges/*.js"

const ExchangesPage = () => {
const filterExchanges = (array, property) => {
return array.reduce(function (newarray, obj) {
let key = obj[property]
if (key) {
newarray.push(obj)
}
return newarray
}, [])
}

const exchanges = Object.values(AllExchanges).map(getExchanges =>
getExchanges()
)
const featuredExchanges = filterExchanges(exchanges, "featured")

return (
<>
<SEO title="Bitcoin Cash Exchanges" />
<Container>
<h2 className="centerh2">
<fbt desc="'Exchanges' heading on Exchanges page">
Featured Exchanges
</fbt>
</h2>
<FeaturedTiles tiles={featuredExchanges} md={4} />
<Tiles tiles={exchanges} md={3} />
</Container>
</>
)
}

export default ExchangesPage

0 comments on commit 4e72b94

Please sign in to comment.