-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leaderboard app with query #1864
Changes from all commits
55577ac
9018db5
fd0612f
76ccd1c
47f2988
a41f44c
50acae4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,6 @@ class LeaderBoard extends React.PureComponent<BoardProps & I18nProps, State> { | |
const { pageLength } = getConfig().publicRuntimeConfig.LEADERBOARD | ||
const showExpandButton = this.props.leaders.length >= (page + 1) * pageLength | ||
const sortedLeaders = this.props.leaders.sort(sorter).slice(0, pageLength * (page + 1)) | ||
|
||
const maxPoints = round(sortedLeaders[0].points * 1.1, 100) | ||
const width = this.state.width | ||
return ( | ||
|
@@ -95,10 +94,11 @@ function sorter(alpha: Competitor, bravo: Competitor) { | |
return -1 | ||
} | ||
|
||
const PORTIONS = 8 | ||
const Portions = 8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the change? for consts all caps is really more common, with Pascalcase I tend to think interfaces or classes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true, the linter was complaining, but we can revert |
||
|
||
function Axis({ max }: { max: number }) { | ||
const portion = max / PORTIONS | ||
const scaled_max = max / Math.pow(10, 20) | ||
const portion = scaled_max / Portions | ||
|
||
return ( | ||
<View style={[standardStyles.row, styles.xaxis]}> | ||
|
@@ -113,7 +113,7 @@ function Axis({ max }: { max: number }) { | |
) | ||
})} | ||
<Text key={max} style={[fonts.small, textStyles.invert]}> | ||
{max} | ||
{round(scaled_max)} | ||
</Text> | ||
</View> | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume eventually this will be a non localhost URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should be the one of
blockscout