mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
groups: set sigil color on blur, not automatically
This commit is contained in:
parent
7dbd2a09f0
commit
48e65499e2
@ -53,7 +53,7 @@ export class ContactCard extends Component {
|
|||||||
|
|
||||||
if (hexTest && (hexTest[1] !== currentColor) && !props.share) {
|
if (hexTest && (hexTest[1] !== currentColor) && !props.share) {
|
||||||
api.contactEdit(props.path, `~${props.ship}`, {color: hexTest[1]});
|
api.contactEdit(props.path, `~${props.ship}`, {color: hexTest[1]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editToggle() {
|
editToggle() {
|
||||||
@ -116,6 +116,18 @@ export class ContactCard extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
switch (field) {
|
switch (field) {
|
||||||
|
case "color": {
|
||||||
|
let currentColor = (props.contact.color) ? props.contact.color : "000000";
|
||||||
|
currentColor = uxToHex(currentColor);
|
||||||
|
let hexExp = /([0-9A-Fa-f]{6})/
|
||||||
|
let hexTest = hexExp.exec(this.state.colorToSet);
|
||||||
|
|
||||||
|
if (hexTest && (hexTest[1] !== currentColor) && !props.share) {
|
||||||
|
api.contactEdit(props.path, `~${props.ship}`, { color: hexTest[1] }).then(() => {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "email": {
|
case "email": {
|
||||||
if (
|
if (
|
||||||
(state.emailToSet === "") ||
|
(state.emailToSet === "") ||
|
||||||
@ -318,6 +330,7 @@ export class ContactCard extends Component {
|
|||||||
onChange={this.sigilColorSet}
|
onChange={this.sigilColorSet}
|
||||||
defaultValue={defaultColor}
|
defaultValue={defaultColor}
|
||||||
key={"default" + defaultColor}
|
key={"default" + defaultColor}
|
||||||
|
onBlur={(() => this.setField("color"))}
|
||||||
style={{
|
style={{
|
||||||
resize: "none",
|
resize: "none",
|
||||||
height: 40,
|
height: 40,
|
||||||
|
Loading…
Reference in New Issue
Block a user