Last active
April 23, 2020 15:09
-
-
Save dmoss18/95abe6aba4b1e4084c65bc70b0406dec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//scrolling-statistics-row.tsx | |
export type KeyedStatisticRenderer = { key: string, render: StatisticRenderer } | |
export function keyedRenderer(key: string, renderer: StatisticRenderer): KeyedStatisticRenderer { return { key, render: renderer } } | |
const WatchlistStatisticRenderers = { | |
[WatchlistColumn.EstimatedEarnings]: keyedRenderer('watchlist-estimated-earnings', createStatisticFieldRenderer(() => 0)) | |
[WatchlistColumn.Range]: keyedRenderer('watchlist-range', RangeFieldRenderer) | |
} | |
<AnimatedSyncedHorizontalScrollView offsetObserver={this.props.offsetObserver} style={this.props.style} onPress={this.props.onPress}> | |
{this.props.columnRenderers.map((renderer, index) => ( | |
<View | |
key={renderer.key} | |
style={[{ width: this.columnWidth }, Styles.container]} | |
> | |
{renderer.render({ quote: this.props.quote, positionStatistic: this.props.positionStatistic })} | |
</View> | |
))} | |
</AnimatedSyncedHorizontalScrollView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment