Skip to content

Commit

Permalink
[docs] Render a button over a custom emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 4, 2020
1 parent cedd986 commit 7349fc3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
15 changes: 11 additions & 4 deletions docs/src/pages/components/data-grid/rendering/RenderCellGrid.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import * as React from 'react';
import Button from '@material-ui/core/Button';
import { DataGrid } from '@material-ui/data-grid';

const columns = [
{
field: 'date',
headerName: 'Year',
width: 150,
renderCell: (params) => (
<strong>
{params.value.getFullYear()}{' '}
<span role="img" aria-label="birthday">
🎂
</span>
{params.value.getFullYear()}
<Button
variant="contained"
color="primary"
size="small"
style={{ marginLeft: 16 }}
>
Open
</Button>
</strong>
),
},
Expand Down
15 changes: 11 additions & 4 deletions docs/src/pages/components/data-grid/rendering/RenderCellGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import * as React from 'react';
import Button from '@material-ui/core/Button';
import { DataGrid, ColDef, ValueFormatterParams } from '@material-ui/data-grid';

const columns: ColDef[] = [
{
field: 'date',
headerName: 'Year',
width: 150,
renderCell: (params: ValueFormatterParams) => (
<strong>
{(params.value as Date).getFullYear()}{' '}
<span role="img" aria-label="birthday">
🎂
</span>
{(params.value as Date).getFullYear()}
<Button
variant="contained"
color="primary"
size="small"
style={{ marginLeft: 16 }}
>
Open
</Button>
</strong>
),
},
Expand Down
13 changes: 9 additions & 4 deletions docs/src/pages/components/data-grid/rendering/rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,15 @@ const columns: ColDef[] = [
headerName: 'Year',
renderCell: (params: ValueFormatterParams) => (
<strong>
{(params.value as Date).getFullYear()}{' '}
<span role="img" aria-label="birthday">
🎂
</span>
{(params.value as Date).getFullYear()}
<Button
variant="contained"
color="primary"
size="small"
style={{ marginLeft: 16 }}
>
Open
</Button>
</strong>
),
},
Expand Down

0 comments on commit 7349fc3

Please sign in to comment.