-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: BB-682 added headline live example
- Loading branch information
Jan Strouhal
committed
Aug 9, 2018
1 parent
3c09d74
commit 15aa8a1
Showing
3 changed files
with
92 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// (C) 2007-2018 GoodData Corporation | ||
import React, { Component } from 'react'; | ||
import { Headline } from '@gooddata/react-components'; | ||
|
||
import '@gooddata/react-components/styles/css/main.css'; | ||
|
||
import { | ||
projectId, | ||
franchiseFeesIdentifier, | ||
franchiseFeesAdRoyaltyIdentifier | ||
} from '../utils/fixtures'; | ||
|
||
export class HeadlineExample extends Component { | ||
onLoadingChanged(...params) { | ||
// eslint-disable-next-line no-console | ||
return console.log('ColumnChartExample onLoadingChanged', ...params); | ||
} | ||
|
||
onError(...params) { | ||
// eslint-disable-next-line no-console | ||
return console.log('ColumnChartExample onError', ...params); | ||
} | ||
|
||
render() { | ||
const primaryMeasure = { | ||
measure: { | ||
localIdentifier: 'franchiseFeesIdentifier', | ||
definition: { | ||
measureDefinition: { | ||
item: { | ||
identifier: franchiseFeesIdentifier | ||
} | ||
} | ||
}, | ||
format: '#,##0' | ||
} | ||
}; | ||
const secondaryMeasure = { | ||
measure: { | ||
localIdentifier: 'franchiseFeesAdRoyaltyIdentifier', | ||
definition: { | ||
measureDefinition: { | ||
item: { | ||
identifier: franchiseFeesAdRoyaltyIdentifier | ||
} | ||
} | ||
}, | ||
format: '#,##0' | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="s-headline" style={{ display: 'flex' }}> | ||
<style jsx> | ||
{` | ||
.column { | ||
flex: '1 1 50%' | ||
} | ||
`} | ||
</style> | ||
<div className="column"> | ||
<Headline | ||
projectId={projectId} | ||
primaryMeasure={primaryMeasure} | ||
onLoadingChanged={this.onLoadingChanged} | ||
onError={this.onError} | ||
/> | ||
</div> | ||
<div className="column"> | ||
<Headline | ||
projectId={projectId} | ||
primaryMeasure={primaryMeasure} | ||
secondaryMeasure={secondaryMeasure} | ||
onLoadingChanged={this.onLoadingChanged} | ||
onError={this.onError} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default HeadlineExample; |
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