Makes Recently Added section work

This commit is contained in:
Andy Tudhope 2019-04-12 17:21:01 +02:00
parent 96f4596d79
commit 5cc9a8359e
No known key found for this signature in database
GPG Key ID: 02A3DFA93BF26AD2
2 changed files with 59 additions and 48 deletions

View File

@ -7,7 +7,7 @@ const Dapps = [
image: '/discover-dapps/images/dapps/airswap.png', image: '/discover-dapps/images/dapps/airswap.png',
description: 'Meet the future of trading.', description: 'Meet the future of trading.',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Bancor', name: 'Bancor',
@ -15,7 +15,7 @@ const Dapps = [
image: '/discover-dapps/images/dapps/bancor.png', image: '/discover-dapps/images/dapps/bancor.png',
description: 'Bancor is a decentralized liquidity network', description: 'Bancor is a decentralized liquidity network',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Kyber', name: 'Kyber',
@ -24,7 +24,7 @@ const Dapps = [
'On-chain, instant and liquid platform for exchange and payment service', 'On-chain, instant and liquid platform for exchange and payment service',
image: '/discover-dapps/images/dapps/kyber.png', image: '/discover-dapps/images/dapps/kyber.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'DAI by MakerDao', name: 'DAI by MakerDao',
@ -32,7 +32,7 @@ const Dapps = [
description: 'Stability for the blockchain', description: 'Stability for the blockchain',
image: '/discover-dapps/images/dapps/dai.png', image: '/discover-dapps/images/dapps/dai.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Augur', name: 'Augur',
@ -41,7 +41,7 @@ const Dapps = [
'A prediction market protocol owned and operated by the people that use it.', 'A prediction market protocol owned and operated by the people that use it.',
image: '/discover-dapps/images/dapps/augur.svg', image: '/discover-dapps/images/dapps/augur.svg',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'LocalEthereum', name: 'LocalEthereum',
@ -49,7 +49,7 @@ const Dapps = [
description: 'The smartest way to buy and sell Ether', description: 'The smartest way to buy and sell Ether',
image: '/discover-dapps/images/dapps/local-ethereum.png', image: '/discover-dapps/images/dapps/local-ethereum.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Eth2phone', name: 'Eth2phone',
@ -57,7 +57,7 @@ const Dapps = [
description: 'Send Ether by phone number', description: 'Send Ether by phone number',
image: '/discover-dapps/images/dapps/eth2phone.png', image: '/discover-dapps/images/dapps/eth2phone.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'DDEX', name: 'DDEX',
@ -66,7 +66,7 @@ const Dapps = [
'Instant, real-time order matching with secure on-chain settlement', 'Instant, real-time order matching with secure on-chain settlement',
image: '/discover-dapps/images/dapps/ddex.png', image: '/discover-dapps/images/dapps/ddex.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Nuo', name: 'Nuo',
@ -75,7 +75,7 @@ const Dapps = [
'The non-custodial way to lend, borrow or margin trade cryptocurrency.', 'The non-custodial way to lend, borrow or margin trade cryptocurrency.',
image: '/discover-dapps/images/dapps/nuo.png', image: '/discover-dapps/images/dapps/nuo.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'EasyTrade', name: 'EasyTrade',
@ -83,7 +83,7 @@ const Dapps = [
description: 'One exchange for every token', description: 'One exchange for every token',
image: '/discover-dapps/images/dapps/easytrade.png', image: '/discover-dapps/images/dapps/easytrade.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'slow.trade', name: 'slow.trade',
@ -92,7 +92,7 @@ const Dapps = [
'Trade fairly priced crypto assets on the first platform built with the DutchX protocol.', 'Trade fairly priced crypto assets on the first platform built with the DutchX protocol.',
image: '/discover-dapps/images/dapps/slowtrade.png', image: '/discover-dapps/images/dapps/slowtrade.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Expo Trading', name: 'Expo Trading',
@ -100,7 +100,7 @@ const Dapps = [
description: 'The simplest way to margin trade cryptocurrency.', description: 'The simplest way to margin trade cryptocurrency.',
image: '/discover-dapps/images/dapps/expotrading.png', image: '/discover-dapps/images/dapps/expotrading.png',
category: Categories.EXCHANGES, category: Categories.EXCHANGES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'blockimmo', name: 'blockimmo',
@ -109,7 +109,7 @@ const Dapps = [
'blockimmo is a blockchain powered, regulated platform enabling shared property investments and ownership.', 'blockimmo is a blockchain powered, regulated platform enabling shared property investments and ownership.',
image: '/discover-dapps/images/dapps/blockimmo.png', image: '/discover-dapps/images/dapps/blockimmo.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'CryptoCribs', name: 'CryptoCribs',
@ -117,7 +117,7 @@ const Dapps = [
description: 'Travel the globe. Pay in crypto.', description: 'Travel the globe. Pay in crypto.',
image: '/discover-dapps/images/dapps/cryptocribs.png', image: '/discover-dapps/images/dapps/cryptocribs.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Ethlance', name: 'Ethlance',
@ -126,7 +126,7 @@ const Dapps = [
'The future of work is now. Hire people or work yourself in return for ETH.', 'The future of work is now. Hire people or work yourself in return for ETH.',
image: '/discover-dapps/images/dapps/ethlance.png', image: '/discover-dapps/images/dapps/ethlance.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'OpenSea', name: 'OpenSea',
@ -134,7 +134,7 @@ const Dapps = [
description: 'The largest decentralized marketplace for cryptogoods', description: 'The largest decentralized marketplace for cryptogoods',
image: '/discover-dapps/images/dapps/opensea.png', image: '/discover-dapps/images/dapps/opensea.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'KnownOrigin', name: 'KnownOrigin',
@ -142,7 +142,7 @@ const Dapps = [
description: 'Discover, buy and collect digital artwork.', description: 'Discover, buy and collect digital artwork.',
image: '/discover-dapps/images/dapps/knownorigin.png', image: '/discover-dapps/images/dapps/knownorigin.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'Name Bazaar', name: 'Name Bazaar',
@ -150,7 +150,7 @@ const Dapps = [
description: 'ENS name marketplace', description: 'ENS name marketplace',
image: '/discover-dapps/images/dapps/name-bazaar.png', image: '/discover-dapps/images/dapps/name-bazaar.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'The Bounties Network', name: 'The Bounties Network',
@ -158,7 +158,7 @@ const Dapps = [
description: 'Bounties on any task, paid in any token', description: 'Bounties on any task, paid in any token',
image: '/discover-dapps/images/dapps/bounties-network.png', image: '/discover-dapps/images/dapps/bounties-network.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Emoon', name: 'Emoon',
@ -167,7 +167,7 @@ const Dapps = [
'A decentralized marketplace for buying & selling crypto assets', 'A decentralized marketplace for buying & selling crypto assets',
image: '/discover-dapps/images/dapps/emoon.png', image: '/discover-dapps/images/dapps/emoon.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Astro Ledger', name: 'Astro Ledger',
@ -175,7 +175,7 @@ const Dapps = [
description: 'Funding space grants with blockchain star naming.', description: 'Funding space grants with blockchain star naming.',
image: '/discover-dapps/images/dapps/astroledger.svg', image: '/discover-dapps/images/dapps/astroledger.svg',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'SuperRare', name: 'SuperRare',
@ -184,7 +184,7 @@ const Dapps = [
'Buy, sell and collect unique digital creations by artists around the world', 'Buy, sell and collect unique digital creations by artists around the world',
image: '/discover-dapps/images/dapps/superrare.png', image: '/discover-dapps/images/dapps/superrare.png',
category: Categories.MARKETPLACES, category: Categories.MARKETPLACES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'CryptoCare', name: 'CryptoCare',
@ -193,7 +193,7 @@ const Dapps = [
'Give your Ether some heart! Collectibles that make the world a better place.', 'Give your Ether some heart! Collectibles that make the world a better place.',
image: '/discover-dapps/images/dapps/cryptocare.jpg', image: '/discover-dapps/images/dapps/cryptocare.jpg',
category: Categories.COLLECTIBLES, category: Categories.COLLECTIBLES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'CryptoKitties', name: 'CryptoKitties',
@ -201,7 +201,7 @@ const Dapps = [
description: 'Collect and breed adorable digital cats.', description: 'Collect and breed adorable digital cats.',
image: '/discover-dapps/images/dapps/cryptokitties.png', image: '/discover-dapps/images/dapps/cryptokitties.png',
category: Categories.COLLECTIBLES, category: Categories.COLLECTIBLES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Cryptographics', name: 'Cryptographics',
@ -210,7 +210,7 @@ const Dapps = [
'Cryptographics is a digital art hub where artists, creators and collectors can submit asset packs, create unique cryptographics and trade them.', 'Cryptographics is a digital art hub where artists, creators and collectors can submit asset packs, create unique cryptographics and trade them.',
image: '/discover-dapps/images/dapps/cryptographics.png', image: '/discover-dapps/images/dapps/cryptographics.png',
category: Categories.COLLECTIBLES, category: Categories.COLLECTIBLES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'CryptoPunks', name: 'CryptoPunks',
@ -218,7 +218,7 @@ const Dapps = [
description: '10,000 unique collectible punks', description: '10,000 unique collectible punks',
image: '/discover-dapps/images/dapps/cryptopunks.png', image: '/discover-dapps/images/dapps/cryptopunks.png',
category: Categories.COLLECTIBLES, category: Categories.COLLECTIBLES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Crypto Takeovers', name: 'Crypto Takeovers',
@ -226,7 +226,7 @@ const Dapps = [
description: 'Predict and conquer the world. Make a crypto fortune.', description: 'Predict and conquer the world. Make a crypto fortune.',
image: '/discover-dapps/images/dapps/cryptotakeovers.png', image: '/discover-dapps/images/dapps/cryptotakeovers.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'CryptoFighters', name: 'CryptoFighters',
@ -234,7 +234,7 @@ const Dapps = [
description: 'Collect train and fight digital fighters.', description: 'Collect train and fight digital fighters.',
image: '/discover-dapps/images/dapps/cryptofighters.png', image: '/discover-dapps/images/dapps/cryptofighters.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'Decentraland', name: 'Decentraland',
@ -243,7 +243,7 @@ const Dapps = [
'Decentraland is a virtual reality platform powered by the Ethereum blockchain.', 'Decentraland is a virtual reality platform powered by the Ethereum blockchain.',
image: '/discover-dapps/images/dapps/decentraland.png', image: '/discover-dapps/images/dapps/decentraland.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Dragonereum', name: 'Dragonereum',
@ -251,7 +251,7 @@ const Dapps = [
description: 'Own and trade dragons, fight with other players.', description: 'Own and trade dragons, fight with other players.',
image: '/discover-dapps/images/dapps/dragonereum.png', image: '/discover-dapps/images/dapps/dragonereum.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Etherbots', name: 'Etherbots',
@ -259,7 +259,7 @@ const Dapps = [
description: 'Robot wars on the Ethereum Platform', description: 'Robot wars on the Ethereum Platform',
image: '/discover-dapps/images/dapps/etherbots.png', image: '/discover-dapps/images/dapps/etherbots.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Etheremon', name: 'Etheremon',
@ -267,7 +267,7 @@ const Dapps = [
description: 'Decentralized World of Ether Monsters', description: 'Decentralized World of Ether Monsters',
image: '/discover-dapps/images/dapps/etheremon.png', image: '/discover-dapps/images/dapps/etheremon.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'CryptoStrikers', name: 'CryptoStrikers',
@ -275,7 +275,7 @@ const Dapps = [
description: 'The Beautiful (card) Game', description: 'The Beautiful (card) Game',
image: '/discover-dapps/images/dapps/cryptostrikers.png', image: '/discover-dapps/images/dapps/cryptostrikers.png',
category: Categories.GAMES, category: Categories.GAMES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
// { // {
// name: 'FairHouse', // name: 'FairHouse',
@ -283,7 +283,7 @@ const Dapps = [
// description: 'Fair and transparent entertainment games.', // description: 'Fair and transparent entertainment games.',
// image: '/discover-dapps/images/dapps/fairhouse.png', // image: '/discover-dapps/images/dapps/fairhouse.png',
// category: Categories.GAMES, // category: Categories.GAMES,
// dateAdded: null, // dateAdded: '2019-04-11',
// }, // },
{ {
name: 'Cent', name: 'Cent',
@ -291,7 +291,7 @@ const Dapps = [
description: 'Get wisdom, get money', description: 'Get wisdom, get money',
image: '/discover-dapps/images/dapps/cent.png', image: '/discover-dapps/images/dapps/cent.png',
category: Categories.SOCIAL_NETWORKS, category: Categories.SOCIAL_NETWORKS,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Kickback', name: 'Kickback',
@ -300,7 +300,7 @@ const Dapps = [
'Event no shows? No problem. Kickback asks event attendees to put skin in the game with Ethereum.', 'Event no shows? No problem. Kickback asks event attendees to put skin in the game with Ethereum.',
image: '/discover-dapps/images/dapps/kickback.png', image: '/discover-dapps/images/dapps/kickback.png',
category: Categories.SOCIAL_NETWORKS, category: Categories.SOCIAL_NETWORKS,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Peepeth', name: 'Peepeth',
@ -308,7 +308,7 @@ const Dapps = [
description: 'Blockchain-powered microblogging', description: 'Blockchain-powered microblogging',
image: '/discover-dapps/images/dapps/peepeth.png', image: '/discover-dapps/images/dapps/peepeth.png',
category: Categories.SOCIAL_NETWORKS, category: Categories.SOCIAL_NETWORKS,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'livepeer.tv', name: 'livepeer.tv',
@ -316,7 +316,7 @@ const Dapps = [
description: 'Decentralized video broadcasting', description: 'Decentralized video broadcasting',
image: '/discover-dapps/images/dapps/livepeer.png', image: '/discover-dapps/images/dapps/livepeer.png',
category: Categories.OTHER, category: Categories.OTHER,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Aragon', name: 'Aragon',
@ -324,7 +324,7 @@ const Dapps = [
description: 'Build unstoppable organizations on Ethereum.', description: 'Build unstoppable organizations on Ethereum.',
image: '/discover-dapps/images/dapps/aragon.png', image: '/discover-dapps/images/dapps/aragon.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Compound Finance', name: 'Compound Finance',
@ -332,7 +332,7 @@ const Dapps = [
description: 'Decentralized Bank.', description: 'Decentralized Bank.',
image: '/discover-dapps/images/dapps/compoundfinance.png', image: '/discover-dapps/images/dapps/compoundfinance.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'InstaDApp', name: 'InstaDApp',
@ -340,7 +340,7 @@ const Dapps = [
description: 'Decentralized Bank.', description: 'Decentralized Bank.',
image: '/discover-dapps/images/dapps/instadapp.jpg', image: '/discover-dapps/images/dapps/instadapp.jpg',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'Livepeer', name: 'Livepeer',
@ -348,7 +348,7 @@ const Dapps = [
description: 'Decentralized video broadcasting', description: 'Decentralized video broadcasting',
image: '/discover-dapps/images/dapps/livepeer.png', image: '/discover-dapps/images/dapps/livepeer.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'ETHLend', name: 'ETHLend',
@ -356,7 +356,7 @@ const Dapps = [
description: 'Decentralized lending on Ethereum', description: 'Decentralized lending on Ethereum',
image: '/discover-dapps/images/dapps/ethlend.png', image: '/discover-dapps/images/dapps/ethlend.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'Civitas', name: 'Civitas',
@ -364,7 +364,7 @@ const Dapps = [
description: 'Blockchain-powered local communities', description: 'Blockchain-powered local communities',
image: '/discover-dapps/images/dapps/civitas.png', image: '/discover-dapps/images/dapps/civitas.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: '3Box', name: '3Box',
@ -372,7 +372,7 @@ const Dapps = [
description: 'Create and manage your Ethereum Profile.', description: 'Create and manage your Ethereum Profile.',
image: '/discover-dapps/images/dapps/3Box.png', image: '/discover-dapps/images/dapps/3Box.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'Hexel', name: 'Hexel',
@ -380,7 +380,7 @@ const Dapps = [
description: 'Create your own cryptocurrency', description: 'Create your own cryptocurrency',
image: '/discover-dapps/images/dapps/hexel.png', image: '/discover-dapps/images/dapps/hexel.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-11',
}, },
{ {
name: 'Smartz', name: 'Smartz',
@ -388,7 +388,7 @@ const Dapps = [
description: 'Easy smart contract management', description: 'Easy smart contract management',
image: '/discover-dapps/images/dapps/smartz.png', image: '/discover-dapps/images/dapps/smartz.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
{ {
name: 'SNT Voting DApp', name: 'SNT Voting DApp',
@ -397,7 +397,7 @@ const Dapps = [
'Let your SNT be heard! Vote on decisions exclusive to SNT holders, or create a poll of your own.', 'Let your SNT be heard! Vote on decisions exclusive to SNT holders, or create a poll of your own.',
image: '/discover-dapps/images/dapps/snt-voting.png', image: '/discover-dapps/images/dapps/snt-voting.png',
category: Categories.UTILITIES, category: Categories.UTILITIES,
dateAdded: null, dateAdded: '2019-04-05',
}, },
] ]

View File

@ -4,8 +4,19 @@ import moment from 'moment'
const getDapps = state => state.dapps const getDapps = state => state.dapps
const recentDapps = createSelector( const recentDapps = createSelector(
[getDapps],
[getDapps], [getDapps],
dapps => [...dapps].sort((a, b) => moment(b.dateAdded).diff(a.dateAdded)), dapps => [...dapps].sort((a, b) => moment(b.dateAdded).diff(a.dateAdded)),
dapps =>
[...dapps].filter(dapp => {
return (
moment(dapp.dateAdded).toISOString() >
moment()
.subtract(21, 'days')
.utc()
.toISOString()
)
}),
) )
export default recentDapps export default recentDapps