Skip to content

Commit

Permalink
refactor: replace material ui TextField for Input
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Aug 12, 2024
1 parent 24be388 commit 63d63ea
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 356 deletions.
16 changes: 2 additions & 14 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-08-02T09:44:11.640Z\n"
"PO-Revision-Date: 2024-08-02T09:44:11.640Z\n"
"POT-Creation-Date: 2024-08-08T08:57:10.390Z\n"
"PO-Revision-Date: 2024-08-08T08:57:10.390Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -490,18 +490,6 @@ msgstr "Contains text"
msgid "Yes"
msgstr "Yes"

msgid "mm/dd/yyyy"
msgstr "mm/dd/yyyy"

msgid "Years"
msgstr "Years"

msgid "Months"
msgstr "Months"

msgid "Days"
msgstr "Days"

msgid "Uploading file"
msgstr "Uploading file"

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @flow
import { Input } from '@dhis2/ui';
import React, { Component } from 'react';
import TextField from '@material-ui/core/TextField';

type Props = {
onChange?: ?(value: string, event: SyntheticEvent<HTMLInputElement>) => void,
onBlur?: ?(value: string, event: SyntheticEvent<HTMLInputElement>) => void,
onChange?: ?(value: string, event: HTMLInputElement) => void,
onBlur?: ?(value: string, event: HTMLInputElement) => void,
value: ?string,
};

Expand All @@ -21,12 +21,12 @@ export class D2TextField extends Component<Props> {
this.handleBlur = this.handleBlur.bind(this);
}

handleChange = (event: SyntheticEvent<HTMLInputElement>) => {
this.props.onChange && this.props.onChange(event.currentTarget.value, event);
handleChange = (event: HTMLInputElement) => {
this.props.onChange && this.props.onChange(event.value, event);
}

handleBlur = (event: SyntheticEvent<HTMLInputElement>) => {
this.props.onBlur && this.props.onBlur(event.currentTarget.value, event);
handleBlur = (event: HTMLInputElement) => {
this.props.onBlur && this.props.onBlur(event.value, event);
}

focus() {
Expand All @@ -39,7 +39,7 @@ export class D2TextField extends Component<Props> {
return (
<div ref={(containerInstance) => { this.materialUIContainerInstance = containerInstance; }}>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<TextField
<Input
inputRef={(inst) => { this.materialUIInstance = inst; }}
value={value || ''}
onChange={this.handleChange}
Expand Down
Loading

0 comments on commit 63d63ea

Please sign in to comment.