-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from dcos-labs/gt/feat/enable-lowercase-heade…
…rcell Enable lower case HeaderCell
- Loading branch information
Showing
6 changed files
with
86 additions
and
14 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 |
---|---|---|
@@ -1,9 +1,31 @@ | ||
import { default as Cell } from "./Cell"; | ||
import * as React from "react"; | ||
|
||
import { default as Cell, CellProps } from "./Cell"; | ||
import styled from "react-emotion"; | ||
import { headerCellCss } from "../style"; | ||
import { headerCellCss, textCapitalize } from "../style"; | ||
import { textTruncate } from "../../shared/styles/styleUtils"; | ||
|
||
export default styled(Cell)` | ||
${headerCellCss}; | ||
${textTruncate}; | ||
`; | ||
export interface HeaderCellProps extends CellProps { | ||
/** | ||
* lowerCase is indicating if we want the HeaderCell to be automatically capitalized. | ||
*/ | ||
lowerCase?: boolean; | ||
} | ||
|
||
export class HeaderCell extends React.PureComponent<HeaderCellProps, {}> { | ||
public render() { | ||
const HeaderCell = this.props.lowerCase | ||
? styled(Cell)` | ||
${headerCellCss}; | ||
${textTruncate}; | ||
` | ||
: styled(Cell)` | ||
${headerCellCss}; | ||
${textCapitalize}; | ||
${textTruncate}; | ||
`; | ||
return <HeaderCell>{this.props.children}</HeaderCell>; | ||
} | ||
} | ||
|
||
export default HeaderCell; |
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
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
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