-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
349 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export const nanodb_actions = { | ||
GET_BLOCK_CONFIRMED_SUMMARY: 'GET_BLOCK_CONFIRMED_SUMMARY', | ||
|
||
GET_BLOCK_CONFIRMED_SUMMARY_FAILED: 'GET_BLOCK_CONFIRMED_SUMMARY_FAILED', | ||
GET_BLOCK_CONFIRMED_SUMMARY_PENDING: 'GET_BLOCK_CONFIRMED_SUMMARY_PENDING', | ||
GET_BLOCK_CONFIRMED_SUMMARY_FULFILLED: | ||
'GET_BLOCK_CONFIRMED_SUMMARY_FULFILLED', | ||
|
||
get_block_confirmed_summary: (period = '10m') => ({ | ||
type: nanodb_actions.GET_BLOCK_CONFIRMED_SUMMARY, | ||
payload: { | ||
period | ||
} | ||
}), | ||
|
||
get_block_confirmed_summary_failed: (params, error) => ({ | ||
type: nanodb_actions.GET_BLOCK_CONFIRMED_SUMMARY_FAILED, | ||
payload: { | ||
params, | ||
error | ||
} | ||
}), | ||
|
||
get_block_confirmed_summary_pending: (params) => ({ | ||
type: nanodb_actions.GET_BLOCK_CONFIRMED_SUMMARY_PENDING, | ||
payload: { | ||
params | ||
} | ||
}), | ||
|
||
get_block_confirmed_summary_fulfilled: (params, data) => ({ | ||
type: nanodb_actions.GET_BLOCK_CONFIRMED_SUMMARY_FULFILLED, | ||
payload: { | ||
params, | ||
data | ||
} | ||
}) | ||
} | ||
|
||
export const block_confirmed_summary_request_actions = { | ||
failed: nanodb_actions.get_block_confirmed_summary_failed, | ||
fulfilled: nanodb_actions.get_block_confirmed_summary_fulfilled, | ||
pending: nanodb_actions.get_block_confirmed_summary_pending | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export { | ||
nanodb_actions, | ||
block_confirmed_summary_request_actions | ||
} from './actions' | ||
|
||
export { nanodb_reducer } from './reducer' | ||
export { nanodb_sagas } from './sagas' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Map } from 'immutable' | ||
|
||
import { nanodb_actions } from './actions' | ||
|
||
export function nanodb_reducer(state = Map(), action) { | ||
switch (action.type) { | ||
case nanodb_actions.GET_BLOCK_CONFIRMED_SUMMARY_FULFILLED: | ||
return state.set( | ||
`block_confirmed_summary_${action.payload.params.period}`, | ||
action.payload.data | ||
) | ||
|
||
default: | ||
return state | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { takeEvery, fork, call } from 'redux-saga/effects' | ||
|
||
import { get_block_confirmed_summary } from '@core/api' | ||
import { nanodb_actions } from './actions' | ||
|
||
export function* load_block_confirmed_summary({ payload }) { | ||
yield call(get_block_confirmed_summary, payload) | ||
} | ||
|
||
//= ==================================== | ||
// WATCHERS | ||
// ------------------------------------- | ||
|
||
export function* watch_get_block_confirmed_summary() { | ||
yield takeEvery( | ||
nanodb_actions.GET_BLOCK_CONFIRMED_SUMMARY, | ||
load_block_confirmed_summary | ||
) | ||
} | ||
|
||
//= ==================================== | ||
// ROOT | ||
// ------------------------------------- | ||
|
||
export const nanodb_sagas = [fork(watch_get_block_confirmed_summary)] |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.toggle-button-group | ||
flex 0 0 auto | ||
border-radius 4px | ||
border 1px solid $borderColor | ||
background #ffffff | ||
|
||
.MuiToggleButton-root | ||
border none | ||
margin 4px | ||
font-size 10px | ||
padding 3px 8px | ||
&:not(:first-child) | ||
&:first-child | ||
border-radius 4px |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
$backgroundColor = #F0F0F0 | ||
$textColor = #444444 | ||
|
||
$borderColor = #D0D0D0 | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.metric__card | ||
flex 1 0 200px | ||
max-width 300px | ||
border-radius 8px | ||
padding 16px | ||
margin 8px | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.