-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
Adds TableFormatsExample to docs. Adds ITruncatedFormatProps and IJSONFormatProps interfaces to docs. Fixes #228
return { | ||
name: arr[2], | ||
offsetMsec: (arr[1] as number) * 60 * 60 * 1000 + LOCAL_TIMEZONE_OFFSET_MSEC, | ||
offsetString: arr[0], |
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.
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 |
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.
👍 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"]}; |
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.
spaces inside braces please
Adds TableFormatsExample to docs.
Adds ITruncatedFormatProps and IJSONFormatProps interfaces to docs.
Fixes #228
Checklist