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
| <SomeComponent.Footer> | |
| {(slotProps) => | |
| <div>{slotProps.loading ? 'Loading...' : null}</div> | |
| } | |
| </SomeComponent.Footer> |
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
| // Needs Google Spreadsheets PowerTools | |
| =COUNTA(valuesByColor("#f4cccc", "", B4:E4)) |
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
| const styling = { | |
| Container: style.div` | |
| padding: 16px; | |
| ${props => props.isBig && css` | |
| padding: 32px; | |
| `} | |
| `, | |
| Heading: styled.div` | |
| display: flex; | |
| `, |
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
| // ++++++++++++++++ | |
| // ++ ++ | |
| // + + + + | |
| // + + + + | |
| // + + + + | |
| // + + + + | |
| // + + + + | |
| // + ++ + | |
| // + + + + | |
| // + + + + |
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
| const layout = ( | |
| <BaseLayout> | |
| <BaseLayout.Header> | |
| <h1>Here might be a page title</h1> | |
| </BaseLayout.Header> | |
| <BaseLayout.Body> | |
| <p>A paragraph for the main content.</p> | |
| <p>And another one.</p> | |
| </BaseLayout.Body> |
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
| function Header() { | |
| return null | |
| } | |
| function Body() { | |
| return null | |
| } | |
| function Footer() { | |
| return null |
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
| <base-layout> | |
| <template slot="header"> | |
| <h1>Here might be a page title</h1> | |
| </template> | |
| <p>A paragraph for the main content.</p> | |
| <p>And another one.</p> | |
| <template slot="footer"> | |
| <p>Here's some contact info</p> |
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
| <div class="container"> | |
| <header> | |
| <slot name="header"></slot> | |
| </header> | |
| <main> | |
| <slot></slot> | |
| </main> | |
| <footer> | |
| <slot name="footer"></slot> | |
| </footer> |
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
| <MyPopover open={this.state.open} | |
| onOpen={this.handleOpen} | |
| onClose={this.handleClose} | |
| renderButton={<button>Click!</button>}> | |
| <h1>My Popover!!</h1> | |
| </MyPopover> |
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
| /** | |
| * Converts an array-like object into an array. | |
| * Array.from doesn't work if an object doesn't have a "length" property. | |
| * e.g., Array.from({ 0: 1 }) doesn't work; Array.from({ 0: 1, length: 1 }) does. | |
| */ | |
| function arrayFrom (obj: {}): Array<*> { | |
| return Object.keys(obj).reduce((set: Array, key: string) => { | |
| return [...set, obj[key]] | |
| }, []) | |
| } |