master @ 24 LINES
[ HISTORY ] [ UP ]
┌─ TS ───────────────────────────────────────────────────────────────────────┐
│ // Double-line frame rules for the modal - ═ distinguishes the overlay │
│ // from single-ruled page content. │
│ import { checkGrid, len } from "../../lib/ascii"; │
│ │
│ export interface Props { │
│ id: string; │
│ title: string; │
│ /** Frame width in cells; defaults to the mobile frame so it fits any │
│ * viewport. */ │
│ width?: number; │
│ } │
│ │
│ export function buildDialogTop(title: string, width: number): string { │
│ return checkGrid( │
│ `╔═ ${title} ${"═".repeat(Math.max(0, width - 5 - len(title)))}╗`, │
│ width, │
│ `dialog(${title})`, │
│ ); │
│ } │
│ │
│ export function buildDialogBottom(width: number): string { │
│ return `╚${"═".repeat(width - 2)}╝`; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ TS ─────────────────────────────────┐
│ // Double-line frame rules for the modal - ═ │
│ distinguishes the overlay │
│ // from single-ruled page content. │
│ import { checkGrid, len } from "../../lib/as │
│ cii"; │
│ │
│ export interface Props { │
│ id: string; │
│ title: string; │
│ /** Frame width in cells; defaults to the │
│ mobile frame so it fits any │
│ * viewport. */ │
│ width?: number; │
│ } │
│ │
│ export function buildDialogTop(title: string │
│ , width: number): string { │
│ return checkGrid( │
│ `╔═ ${title} ${"═".repeat(Math.max(0, wi │
│ dth - 5 - len(title)))}╗`, │
│ width, │
│ `dialog(${title})`, │
│ ); │
│ } │
│ │
│ export function buildDialogBottom(width: num │
│ ber): string { │
│ return `╚${"═".repeat(width - 2)}╝`; │
│ } │
└──────────────────────────────────────────────┘
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET