Update config.

This commit is contained in:
Jim Myers 2019-01-29 10:36:34 -05:00
parent 56987cf57f
commit c7aaf54f3e
3 changed files with 44 additions and 8 deletions

View File

@ -64,7 +64,34 @@
});
flipside.multiTable("multiTable", {
title: { text: "Top Coins" }
assets: null,
columns: [
"trend",
"userActivity",
"developerBehavior",
"marketMaturity",
"rank"
],
exclusions: ["gas", "TRX"],
fontFamily: "inherit",
headers: {},
limit: 10,
page: 1,
mode: "light",
rows: {
alternating: true,
alternatingColors: "#eeeeee",
dividers: false,
dividersColor: "#979797",
style: {}
},
title: {
text: "Top Coins",
style: { fontSize: "24px", fontWeight: 400 }
},
trend: {
changeOver: 7
}
});
</script>
</body>

View File

@ -21,7 +21,11 @@ export default class API {
): Promise<any> {
let res;
try {
res = await this.client.request({ url, method, params: params });
res = await this.client.request({
url,
method,
params: params
});
if (res.status >= 200 && res.status < 300) {
return { data: res.data, success: true };
}
@ -62,6 +66,7 @@ export default class API {
page: number;
size?: number;
metrics: string[];
change_over: number;
}) {
return await this.client.post(`/assets/metrics`, payload);
}

View File

@ -73,8 +73,8 @@ export type Props = {
assets?: string[];
exclusions?: string[];
autoWidth?: boolean;
size?: number;
limit?: number;
page?: number;
columns?: ColumnName[];
fontFamily?: string;
title?: {
@ -82,7 +82,6 @@ export type Props = {
style?: object;
};
trend?: {
enabled?: boolean;
changeOver?: number;
};
headers?: {
@ -130,7 +129,8 @@ export default class MultiTable extends Component<Props, State> {
static defaultProps = {
mode: "light",
size: 10,
limit: 10,
page: 1,
sortBy: "fcas",
fontFamily: "inherit",
columns: [
@ -142,6 +142,9 @@ export default class MultiTable extends Component<Props, State> {
],
rows: {
alternating: true
},
trend: {
changeOver: 7
}
};
@ -153,11 +156,12 @@ export default class MultiTable extends Component<Props, State> {
const res = await this.props.api.fetchMetrics({
assets: this.props.assets,
exclusions: this.props.exclusions,
page: 1,
size: 10,
page: this.props.page,
size: this.props.limit,
sort_by: COLUMNS[this.state.sortColumn].sortKey,
sort_desc: true,
metrics: ["fcas", "utility", "dev", "market-maturity"]
metrics: ["fcas", "utility", "dev", "market-maturity"],
change_over: this.props.trend.changeOver
});
this.setState({
loading: false,