Skip to content
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

Add docs and example for formatted cell components #495

Merged
merged 2 commits into from
Jan 18, 2017

Conversation

themadcreator
Copy link
Contributor

Adds TableFormatsExample to docs.
Adds ITruncatedFormatProps and IJSONFormatProps interfaces to docs.

Fixes #228

Checklist

  • Updated documentation

Adds TableFormatsExample to docs.
Adds ITruncatedFormatProps and IJSONFormatProps interfaces to docs.

Fixes #228
@blueprint-bot
Copy link

Add docs and example for formatted cell components

Preview: docs | landing | table
Coverage: core | datetime

return {
name: arr[2],
offsetMsec: (arr[1] as number) * 60 * 60 * 1000 + LOCAL_TIMEZONE_OFFSET_MSEC,
offsetString: arr[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect opportunity to deconstruct function arg:

([offsetString, offsetHour, name]) => ({
    name,
    offsetMsec: offsetHour * 60 * 60 * 1000 + LOCAL_TIMEZONE_OFFSET_MSEC,
    offsetString, 
})
// note the enclosing parens so it's an implicit object return

Below is a table of the largest potentially hazardous asteroid (based on absolute magnitude)
discovered in a given year. Try selecting a different preset loading configuration.

@react-example CellLoadingExample
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice move

Wrap your javascript object cell contents with a `JSONFormat` component like so:

```tsx
const content = {any: "javascript variable", even: [null, "is", "okay", "too"]};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces inside braces please

@blueprint-bot
Copy link

spaces in braces

Preview: docs | landing | table
Coverage: core | datetime

@giladgray giladgray merged commit 231f356 into master Jan 18, 2017
@giladgray giladgray deleted the bd/table-formats-examples branch January 18, 2017 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants