diff --git a/pkg/interface/contacts/src/js/components/lib/card.js b/pkg/interface/contacts/src/js/components/lib/card.js index fe8e4e978f..0c6fe82395 100644 --- a/pkg/interface/contacts/src/js/components/lib/card.js +++ b/pkg/interface/contacts/src/js/components/lib/card.js @@ -1,10 +1,182 @@ import React, { Component } from 'react'; import { Sigil } from './icons/sigil'; +import { uxToHex } from '/lib/util'; +import { api } from '/api'; import { Route, Link } from 'react-router-dom'; export class ContactCard extends Component { + constructor() { + super(); + this.state = { + edit: false, + colorToSet: "" + } + this.editToggle = this.editToggle.bind(this); + this.sigilColorSet = this.sigilColorSet.bind(this); + } + + editToggle() { + let editSwitch = this.state.edit; + editSwitch = !editSwitch; + this.setState({edit: editSwitch}); + } + + sigilColorSet(event) { + //TODO regex for complete hex value and submit as change + this.setState({colorToSet: event.target.value}); + } + + shipParser(ship) { + switch(ship.length) { + case 3: return "Galaxy"; + case 6: return "Star"; + case 13: return "Planet"; + case 56: return "Comet"; + default: return "Unknown"; + } + } + + renderEditCard() { + //TODO if the path is our special invite flow path, autofill the details from /~/default's version of your contact, not this one + let shipType = this.shipParser(this.props.ship); + + let currentColor = (this.props.contact.color) ? this.props.contact.color : "0x0"; + let hexColor = uxToHex(currentColor); + + let sigilColor = "" + + if (this.props.contact.avatar === "TODO") { //TODO change to empty string once we have avatars + sigilColor = ( +
Sigil Color
+ +Ship Name
+~{this.props.ship}
+Ship Type
+{shipType}
+ +Ship Name
+~{this.props.ship}
+Ship Type
+{shipType}
+ +Nickname
+{this.props.contact.nickname}
+{this.props.contact.email}
+Phone
+{this.props.contact.phone}
+Website
+{this.props.contact.website}
+Notes
+{this.props.contact.notes}
+Ship Name
-~{this.props.ship}
-Alphanumeric characters and hyphens only
+ Invite ships to your group +
+