contacts: add resizable "notes" field

This commit is contained in:
Matilde Park 2020-02-13 12:27:27 -07:00
parent f316d0f118
commit ced119271f
2 changed files with 7 additions and 2 deletions

View File

@ -384,6 +384,7 @@ export class ContactCard extends Component {
onChange={this.notesToSet}
onDeleteClick={() => this.setField("removeNotes")}
onSaveClick={() => this.setField("notes")}
resizable={true}
showButtons={!props.share} />
</div>
</div>

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Route, Link } from 'react-router-dom';
import { Route, Link } from 'react-router-dom';
export class EditElement extends Component {
@ -19,6 +19,10 @@ export class EditElement extends Component {
state.currentValue !== ""
);
let inputStyles = (props.resizable)
? { resize: "vertical", height: 40, paddingTop: 10 }
: { resize: "none", height: 40, paddingTop: 10 }
return (
<div>
<p className="f9 gray2">{props.title}</p>
@ -26,7 +30,7 @@ export class EditElement extends Component {
<textarea
ref={props.title}
className="w-100 ba pl3 b--gray4"
style={{ resize: "none", height: 40, paddingTop: 10 }}
style={ inputStyles }
onChange={(e) => {
let val = (' ' + e.target.value).slice(1);
this.setState({