mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
p2 (Pi Mobile on Chord v2) moves from pi-private into pi as one commit. Root scripts that loop all workspaces use --if-present; npm test, ./test.sh and the release script cover packages/* only (p2: cd apps/p2 && npm test); sync-versions also updates apps' workspace pins.
26 lines
726 B
TypeScript
26 lines
726 B
TypeScript
import { contribute, defineFacet } from "@p2/app/v1";
|
|
import { closeLayers, openLayer, Slots, useOwner, useSheet } from "@p2/app/v1/web";
|
|
import { EnvsPanel } from "./EnvsPanel.tsx";
|
|
|
|
function EnvsButton() {
|
|
const sheet = useSheet("envs");
|
|
if (!useOwner()) return null;
|
|
return (
|
|
<>
|
|
<button
|
|
className="foot-button"
|
|
type="button"
|
|
onClick={() => openLayer({ kind: "sheet", name: "envs" }, { fromDrawer: true })}
|
|
title="Remote environments"
|
|
>
|
|
Envs
|
|
</button>
|
|
{sheet && <EnvsPanel env={sheet.locator} onClose={closeLayers} />}
|
|
</>
|
|
);
|
|
}
|
|
export default defineFacet((host) => {
|
|
contribute(host, "p2.web-envs", (self) => {
|
|
self.contribute(Slots, { "sidebar-foot:envs": EnvsButton });
|
|
});
|
|
});
|