mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +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) {
|
||||
api.contactEdit(props.path, `~${props.ship}`, {color: hexTest[1]});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editToggle() {
|
||||
@ -116,6 +116,18 @@ export class ContactCard extends Component {
|
||||
);
|
||||
|
||||
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": {
|
||||
if (
|
||||
(state.emailToSet === "") ||
|
||||
@ -318,6 +330,7 @@ export class ContactCard extends Component {
|
||||
onChange={this.sigilColorSet}
|
||||
defaultValue={defaultColor}
|
||||
key={"default" + defaultColor}
|
||||
onBlur={(() => this.setField("color"))}
|
||||
style={{
|
||||
resize: "none",
|
||||
height: 40,
|
||||
|
Loading…
Reference in New Issue
Block a user