Skip to content

Commit

Permalink
chore: use new material-ui instead of d2-ui-core for TextField (#316)
Browse files Browse the repository at this point in the history
d2-ui-core TextField uses old material-ui so replace it with direct use of new material-ui.
This will again be replaced when ui-core textarea is published
  • Loading branch information
jenniferarnesen authored May 14, 2019
1 parent 2f1ab87 commit 41de2ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Item/TextItem/Item.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import { connect } from 'react-redux';
import i18n from '@dhis2/d2-i18n';
import TextField from '@dhis2/d2-ui-core/text-field/TextField';
import Input from '@material-ui/core/Input';
import {
Parser as RichTextParser,
Editor as RichTextEditor,
Expand All @@ -25,6 +25,7 @@ const style = {
width: '90%',
margin: '0 auto',
display: 'block',
lineHeight: '24px',
},
container: {
marginBottom: '20px',
Expand All @@ -35,10 +36,10 @@ const style = {
const TextItem = props => {
const { item, editMode, text, acUpdateDashboardItem } = props;

const onChangeText = text => {
const onChangeText = event => {
const updatedItem = {
...item,
text,
text: event.target.value,
};

acUpdateDashboardItem(updatedItem);
Expand All @@ -60,10 +61,9 @@ const TextItem = props => {
<Line />
<div className="dashboard-item-content">
<RichTextEditor onEdit={onChangeText}>
<TextField
<Input
value={text}
multiline
rows={1}
fullWidth
style={style.textField}
placeholder={i18n.t('Add text here')}
Expand Down

0 comments on commit 41de2ef

Please sign in to comment.