grid: always show treaty info if we have it

Fixes urbit/landscape#1259
This commit is contained in:
Liam Fitzgerald 2021-10-21 15:57:09 -05:00
parent 494793ba3c
commit 5fc81149bf
2 changed files with 7 additions and 9 deletions

View File

@ -8,7 +8,7 @@ import { Dialog, DialogClose, DialogContent, DialogTrigger } from './Dialog';
import { DocketHeader } from './DocketHeader';
import { Spinner } from './Spinner';
import { VatMeta } from './VatMeta';
import useDocketState, { ChargeWithDesk } from '../state/docket';
import useDocketState, { ChargeWithDesk, useTreaty } from '../state/docket';
import { getAppHref } from '../state/util';
import { addRecentApp } from '../nav/search/Home';
import { TreatyMeta } from './TreatyMeta';
@ -52,6 +52,7 @@ export const AppInfo: FC<AppInfoProps> = ({ docket, vat, className }) => {
const [ship, desk] = getRemoteDesk(docket, vat);
const publisher = vat?.arak?.rail?.publisher ?? ship;
const [copied, setCopied] = useState(false);
const treaty = useTreaty(ship, desk);
const installApp = async () => {
if (installStatus === 'installed') {
@ -135,18 +136,20 @@ export const AppInfo: FC<AppInfoProps> = ({ docket, vat, className }) => {
</PillButton>
</div>
</DocketHeader>
<div className="space-y-6">
{vat ? (
<>
<hr className="-mx-5 sm:-mx-8 border-gray-50" />
<VatMeta vat={vat} />
</>
) : null}
{'chad' in docket ? null : (
{!treaty ? null : (
<>
<hr className="-mx-5 sm:-mx-8 border-gray-50" />
<TreatyMeta treaty={docket} />
<TreatyMeta treaty={treaty} />
</>
)}
</div>
</div>
);
};

View File

@ -10,14 +10,9 @@ export function VatMeta(props: { vat: Vat }) {
const { desk: foreignDesk, ship, next } = arak.rail || {};
const pluralUpdates = next?.length !== 1;
console.log(cass);
return (
<div className="mt-5 sm:mt-8 space-y-5 sm:space-y-8">
<Attribute title="Developer Desk" attr="desk">
{ship}/{foreignDesk}
</Attribute>
<Attribute title="Last Software Update" attr="case">
{moment(cass.da).format('YYYY.MM.DD')}
</Attribute>
<Attribute title="Desk Hash" attr="hash">
{hash}
</Attribute>