{tt('header_jsx.nft_market')}
+ {nft_market_collections &&
+ }
{tt('all_nft_page_jsx.title')}
@@ -94,18 +105,23 @@ module.exports = {
const currentUser = state.user.getIn(['current'])
const currentAccount = currentUser && state.global.getIn(['accounts', currentUser.get('username')])
+ const nft_market_collections = state.global.get('nft_market_collections')
const nft_orders = state.global.get('nft_orders')
const own_nft_orders = state.global.get('own_nft_orders')
return {
currentUser,
currentAccount,
+ nft_market_collections,
nft_orders,
own_nft_orders,
nft_assets: state.global.get('nft_assets')
}
},
dispatch => ({
+ fetchNftMarketCollections: (start_name) => {
+ dispatch(g.actions.fetchNftMarketCollections({ start_name }))
+ },
fetchNftMarket: (account, collectionName, start_order_id, sort, reverse_sort) => {
dispatch(g.actions.fetchNftMarket({ account, collectionName, start_order_id, sort, reverse_sort }))
},
diff --git a/app/locales/en.json b/app/locales/en.json
index 869692e..924efce 100644
--- a/app/locales/en.json
+++ b/app/locales/en.json
@@ -817,6 +817,14 @@
"no_own_orders": "You are not selling any NFT token yet.",
"own_orders": "My orders"
},
+ "nft_market_collections_jsx": {
+ "all_collections": "All collections",
+ "order_count": {
+ "zero": "No orders",
+ "one": "1 order",
+ "other": "%(count)s orders"
+ }
+ },
"invites_jsx": {
"create_invite": "Create new invite check",
"create_invite_info": "Cheques (invite codes) are a universal tool for transferring of GOLOS tokens to other people outside the blockchain. There are two ways to redeem the code: transfer its balance to your account or register a new account using it.",
diff --git a/app/locales/ru-RU.json b/app/locales/ru-RU.json
index 3de3310..9d9dcd7 100644
--- a/app/locales/ru-RU.json
+++ b/app/locales/ru-RU.json
@@ -1171,6 +1171,14 @@
"no_own_orders": "Вы пока не продаете NFT-токенов.",
"own_orders": "Мои ордеры"
},
+ "nft_market_collections_jsx": {
+ "all_collections": "Все коллекции",
+ "order_count": {
+ "zero": "Нет ордеров",
+ "one": "1 ордер",
+ "other": "%(count)s ордеров"
+ }
+ },
"invites_jsx": {
"create_invite": "Создание чека",
"create_invite_info": "Чеки (инвайт-коды) — инструмент для передачи токенов другим людям вне блокчейна. Использовать чек можно двумя способами: перевести его баланс на аккаунт (форма для этого ниже) или зарегистрировать с его помощью новый аккаунт.",
diff --git a/app/redux/FetchDataSaga.js b/app/redux/FetchDataSaga.js
index f106594..59403b7 100644
--- a/app/redux/FetchDataSaga.js
+++ b/app/redux/FetchDataSaga.js
@@ -64,6 +64,7 @@ export function* fetchDataWatches () {
yield fork(watchFetchNftTokens)
yield fork(watchFetchNftCollectionTokens)
yield fork(watchFetchNftMarket)
+ yield fork(watchFetchNftMarketCollections)
}
export function* watchGetContent() {
@@ -701,4 +702,37 @@ export function* fetchNftMarket({ payload: { account, collectionName, start_orde
} catch (err) {
console.error('fetchNftMarket', err)
}
-}
\ No newline at end of file
+}
+
+export function* watchFetchNftMarketCollections() {
+ yield takeLatest('global/FETCH_NFT_MARKET_COLLECTIONS', fetchNftMarketCollections)
+}
+
+export function* fetchNftMarketCollections({ payload: { start_name } }) {
+ try {
+ const limit = 99
+
+ const nft_colls = yield call([api, api.getNftCollectionsAsync], {
+ start_name,
+ limit: limit + 1,
+ sort: 'by_token_count'
+ })
+
+ let next_from
+ if (nft_colls.length > limit) {
+ next_from = nft_colls.pop().name
+ }
+
+ try {
+ yield fillNftCollectionImages(nft_colls)
+ } catch (err) {
+ console.error(err)
+ }
+
+ yield put(GlobalReducer.actions.receiveNftMarketCollections({
+ nft_colls, start_name, next_from
+ }))
+ } catch (err) {
+ console.error('fetchNftMarketCollections', err)
+ }
+}
diff --git a/app/redux/GlobalReducer.js b/app/redux/GlobalReducer.js
index ae8a45c..e37e2fa 100644
--- a/app/redux/GlobalReducer.js
+++ b/app/redux/GlobalReducer.js
@@ -51,6 +51,11 @@ const upsertOwnNftOrders = (state, own_nft_orders, start_order_id, next_from) =>
return upsertPagedItems(state, 'own_nft_orders', own_nft_orders, start_order_id, next_from)
}
+const upsertNftMarketColls = (state, nft_colls, start_name, next_from) => {
+ return upsertPagedItems(state, 'nft_market_collections', nft_colls, start_name, next_from)
+}
+
+
export default createModule({
name: 'global',
initialState: Map({
@@ -266,6 +271,18 @@ export default createModule({
return new_state
},
},
+ {
+ action: 'FETCH_NFT_MARKET_COLLECTIONS',
+ reducer: state => state,
+ },
+ {
+ action: 'RECEIVE_NFT_MARKET_COLLECTIONS',
+ reducer: (state, { payload: { nft_colls, start_name, next_from, } }) => {
+ let new_state = state
+ new_state = upsertNftMarketColls(new_state, nft_colls, start_name, next_from)
+ return new_state
+ },
+ },
{
action: 'LINK_REPLY',
reducer: (state, { payload: op }) => {