soto: shorten comet/moon patp in prompt

This commit is contained in:
Matilde Park 2020-03-11 16:57:19 -04:00
parent 1ed1eb36fd
commit f8dc023aa7
3 changed files with 16 additions and 10 deletions

View File

@ -1,6 +1,7 @@
import React, { Component } from 'react';
import { store } from '../store';
import { api } from '../api';
import { cite } from '../lib/util';
export class Input extends Component {
constructor(props) {
@ -66,7 +67,7 @@ export class Input extends Component {
render() {
return (
<div className="flex flex-row flex-grow-1">
<div className="flex-shrink-0">~{this.props.ship}:dojo
<div className="flex-shrink-0">{cite(this.props.ship)}:dojo
</div>
<span id="prompt">
{this.props.prompt}

View File

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import classnames from 'classnames';
import { IconHome } from '/components/lib/icons/icon-home';
import { Sigil } from '/components/lib/icons/sigil';
import { cite } from '../../lib/util';
export class HeaderBar extends Component {
render() {
@ -41,7 +42,7 @@ export class HeaderBar extends Component {
verticalAlign: "text-top",
paddingTop: 3
}}>{title}</span>
<div className="absolute right-1 lh-copy"
<div className="absolute right-1 lh-copy flex"
style={{ top: 12 }}>
<Sigil
ship={"~" + window.ship}
@ -49,7 +50,9 @@ export class HeaderBar extends Component {
color={"#000000"}
classes="mix-blend-diff"
/>
<span className="mono black white-d f9 ml2 v-top">{"~" + window.ship}</span>
<span className="mono black white-d f9 ml2 v-top c-default flex-shrink-0">
{cite(window.ship)}
</span>
</div>
</div>
);

View File

@ -1,21 +1,23 @@
import React, { Component } from 'react';
import { sigil, reactRenderer } from 'urbit-sigil-js';
import React, { Component } from "react";
import { sigil, reactRenderer } from "urbit-sigil-js";
export class Sigil extends Component {
render() {
const { props } = this;
let classes = !!this.props.classes ? this.props.classes : "";
let classes = props.classes || "";
if (props.ship.length > 14) {
return (
<div className="bg-black flex-shrink-0" style={{ width: props.size, height: props.size }}>
</div>
<div
className={"bg-black dib " + classes}
style={{ width: props.size, height: props.size }}></div>
);
} else {
return (
<div className={"dib flex-shrink-0 " + classes} style={{ flexBasis: 32, backgroundColor: props.color }}>
<div
className={"dib " + classes}
style={{ flexBasis: 32, backgroundColor: props.color }}>
{sigil({
patp: props.ship,
renderer: reactRenderer,