Skip to content

Commit 2935d45

Browse files
committed
Return back old news data and fixed issue in year tab and see all/less button action
1 parent 736fbe1 commit 2935d45

2 files changed

Lines changed: 126 additions & 35 deletions

File tree

src/pages/press.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,110 @@ press_items_section:
8484
source: Cointelegraph
8585
excerpt: Crypto custodian Anchorage has launched support for KEEP in its latest bid to emerge as a leading custodian for DeFi tokens.
8686
url: https://cointelegraph.com/news/anchorage-launches-support-for-defi-token-keep
87+
- date: "2020-09-22T19:25:00.000Z"
88+
title: Bitcoin-on-Ethereum Token tBTC Relaunches Following Buggy Debut in May
89+
source: Coindesk
90+
excerpt:
91+
A decentralized way to copy bitcoin (BTC) over to Ethereum relaunches
92+
today. Called tBTC, the Thesis-built protocol was first announced in
93+
April, and is now ready for a fresh start.
94+
url: https://www.coindesk.com/thesis-bitcoin-token-tbtc-relaunches-following-buggy-debut
95+
- date: "2020-09-22T13:00:00.000Z"
96+
title: Bitcoin-Backed Ethereum Token tBTC Launches—for the Second Time
97+
source: Decrypt
98+
excerpt:
99+
Thesis CEO Matt Luongo says the launch of tBTC is an opportunity to
100+
unite two disparate tribes, and galvanize an emerging DeFi market.
101+
url: https://decrypt.co/42533/bitcoin-backed-ethereum-token-tbtc-launches-for-the-second-time
102+
- date: "2020-07-28T03:50:00.000Z"
103+
url: https://www.ibtimes.com/how-millennial-finance-will-make-legacy-banking-system-irrelevant-3017842
104+
excerpt:
105+
Millennials are often looked to as bellwethers of contemporary society.
106+
Not since the baby boomers has a generation been so widely analyzed –
107+
and criticized – as a harbinger of things to come. Among this
108+
generation’s targets for disruption, finance looms large.
109+
source: IBTimes
110+
title: How Millennial Finance Will Make The Legacy Banking System Irrelevant
111+
- date: "2020-04-28T16:36:44.400Z"
112+
url: https://unchainedpodcast.com/tbtc-what-happens-when-the-most-liquid-crypto-asset-hits-defi/
113+
source: Unchained Podcast
114+
title:
115+
"Keep CEO on Unchained Podcast – tBTC: What Happens When the Most Liquid
116+
Crypto Asset Hits DeFi?"
117+
excerpt: Matt Luongo, CEO of Thesis, the parent company of Fold and Keep,
118+
describes the just-launched tBTC, his plan for a censorship-resistant
119+
Bitcoin-Ethereum bridge.
120+
- date: "2020-04-02T16:38:19.751Z"
121+
url: https://decrypt.co/24336/bitcoin-to-ethereum-bridge-raises-7-7-million-in-token-sale
122+
source: Decrypt
123+
title: Bitcoin to Ethereum bridge raises $7.7 Million in Token Sale
124+
excerpt:
125+
The Keep Protocol has raised over $7 million for its Ethereum privacy
126+
layer solution. Keep is supporting tBTC, a project to build a Bitcoin
127+
token on the Ethereum network.
128+
- date: "2020-04-02T16:00:00.000Z"
129+
url: https://www.bloomberg.com/news/articles/2020-04-02/bitcoin-s-ethereum-rivalry-could-be-assuaged-with-tbtc-bridge
130+
source: Bloomberg
131+
title: Bitcoin’s Ethereum Rivalry Could Be Assuaged With tBTC Bridge
132+
excerpt:
133+
For almost as long as there have been digital currencies, a rivalry has
134+
existed between Bitcoin and Ethereum. Now, a project called tBTC is
135+
seeking to forge a truce between the two by allowing Bitcoin owners
136+
access to the financial applications that run on Ethereum.
137+
- date: "2020-03-04T17:35:23.187Z"
138+
title: "Reflections of a Monetary Maximalist: My Crypto Thesis"
139+
source: Thesis
140+
url: https://thesis.co/reflections-of-a-monetary-maximalist
141+
excerpt: Keep CEO Matt Luongo shares his crypto thesis and his “monetary
142+
maximalism”— the result of a decade spent evolving and growing alongside
143+
the cryptocurrency movement.
144+
- title: Announcing tBTC with James Prestwich and Matt Luongo of Cross-Chain Group
145+
date: "2019-08-21T00:00:00.000Z"
146+
source: Wyre Talks Podcast
147+
excerpt:
148+
Cross-Chain Group founders Matt Luongo and James Prestwich join Wyre
149+
hosts Louis Aboud Hogben and Tom Scaria to discuss Bitcoin for DeFi; how
150+
tBTC facilitates interoperability and brings Bitcoin to other chains.
151+
url: https://wyre-talks.simplecast.com/episodes/ep-47-announcing-tbtc-with-james-prestwich-and-matt-luongo-of-cross-chain-group-tHcZr3jW
152+
- title:
153+
Messari adds 11 new Disclosures Registry participants, surpassing 50
154+
members
155+
date: "2019-08-20T00:00:00.000Z"
156+
source: Messari
157+
excerpt: Keep has joined the Messari Disclosures Registry as 11 new crypto
158+
projects are added. Read Coindesk’s coverage.
159+
url: https://messari.io/article/announcement-messari-adds-11-new-disclosures-registry-participants-surpassing-50-members
160+
- title: These Bitcoin Users Want DAI and DeFi – Here’s How They Plan to Get It
161+
date: "2019-08-16T00:00:00.000Z"
162+
source: Coindesk
163+
excerpt:
164+
Leigh Cuen covers Cross-Chain Group’s first-ever Cross-Chain Summit for
165+
blockchain interoperability in San Francisco, highlighting the Group’s
166+
announcement of tBTC.
167+
url: https://www.coindesk.com/these-bitcoin-users-want-dai-and-defi-heres-how-they-plan-to-get-it
168+
- title: Episode 041 - Matt Luongo (Keep)
169+
date: "2019-06-17T00:00:00.000Z"
170+
source: Baselayer Podcast
171+
excerpt:
172+
David invited Keep Project Lead, Matt Luongo, to join the podcast and
173+
discuss privacy, interoperability, and the blockchain space as a whole.
174+
url: https://podcasts.apple.com/us/podcast/base-layer-episode-041-matt-luongo-keep/id1445373535?i=1000441792480
175+
- title: Keep developers present network component libp2p to IPFS
176+
date: "2019-05-06T00:00:00.000Z"
177+
source: IPFS Youtube Channel
178+
excerpt:
179+
Piotr Dyraga and Raghav Gulati gave a presentation at an IPFS Weekly
180+
Call + Contributor Office Hours on one of the important components of
181+
Keep — libp2p.
182+
url: https://www.youtube.com/watch?v=EamY2U2Ohyk
183+
- title: Corbin Pon interviewed by Underscore VC Co-Founder
184+
date: "2019-04-23T00:00:00.000Z"
185+
source: Underscore VC Youtube Channel
186+
excerpt:
187+
Discussing the future of blockchain, Corbin Pon and Richard Dulude
188+
covered the possibilities that Keep enables for public blockchains,
189+
different levels of privacy and security, hopes and plans for a safer
190+
financial world with ownership certainty, and the top things hindering
191+
blockchain.
192+
url: https://www.youtube.com/watch?v=PfwJODGY6yQ
87193
---

src/templates/press-page.js

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react"
1+
import React, { useEffect, useMemo, useState } from "react"
22
import ClampLines from "react-clamp-lines"
33
import { Col, Row } from "reactstrap"
44
import PropTypes from "prop-types"
@@ -62,28 +62,9 @@ export const PressPageTemplate = ({
6262
}) => {
6363
const { press_items: pressItems } = pressItemsSection
6464
const [allPressEntries, setAllPressEntries] = useState([])
65-
const [pressEntries, setPressEntries] = useState([])
6665
const [year, setYear] = useState(null)
67-
68-
const entries2019 = allPressEntries.filter((entry) =>
69-
entry.date.includes("2019")
70-
)
71-
const entries2020 = allPressEntries.filter((entry) =>
72-
entry.date.includes("2020")
73-
)
74-
const entries2021 = allPressEntries.filter((entry) =>
75-
entry.date.includes("2021")
76-
)
77-
78-
useEffect(() => {
79-
year === 2019
80-
? setPressEntries(entries2019)
81-
: year === 2020
82-
? setPressEntries(entries2020)
83-
: year === 2021 && entries2021
84-
? setPressEntries(entries2021)
85-
: setPressEntries(allPressEntries)
86-
}, [year])
66+
const [entrySize, setEntrySize] = useState(0)
67+
const [isShowAll, setShowAll] = useState(false)
8768

8869
useEffect(() => {
8970
const dateOptions = { year: "numeric", month: "long", day: "numeric" }
@@ -96,18 +77,19 @@ export const PressPageTemplate = ({
9677
date: new Date(item.date).toLocaleDateString("en-US", dateOptions),
9778
}))
9879
setAllPressEntries(sortedAndFormatted)
99-
setPressEntries(sortedAndFormatted.slice(0, 10))
10080
}, [pressItems])
10181

102-
const handleShowAll = () => {
103-
year === 2019
104-
? setPressEntries(entries2019)
105-
: year === 2020
106-
? setPressEntries(entries2020)
107-
: year === 2021 && entries2021
108-
? setPressEntries(entries2021)
109-
: setPressEntries(allPressEntries)
110-
}
82+
const pressEntries = useMemo(() => {
83+
const entires = year
84+
? allPressEntries.filter((entry) => entry.date.includes(year))
85+
: [...allPressEntries]
86+
setEntrySize(entires.length)
87+
if (isShowAll) {
88+
return entires
89+
} else {
90+
return entires.slice(0, 10)
91+
}
92+
}, [allPressEntries, year, isShowAll])
11193

11294
return (
11395
<div className="press-content">
@@ -197,11 +179,14 @@ export const PressPageTemplate = ({
197179
))}
198180
</Col>
199181
</Row>
200-
{pressEntries.length === 0 ? (
182+
{entrySize === 0 ? (
201183
"No posts available"
202-
) : pressEntries.length > 10 ? (
184+
) : entrySize > 10 ? (
203185
<div className="pagination">
204-
<SeeAllButton onClick={handleShowAll} />
186+
<SeeAllButton
187+
collapsed={!isShowAll}
188+
onClick={() => setShowAll(!isShowAll)}
189+
/>
205190
</div>
206191
) : (
207192
<></>

0 commit comments

Comments
 (0)