2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00
RTL/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.html
2023-02-20 23:54:28 -08:00

102 lines
6.0 KiB
HTML

<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign="space-between stretch">
<div fxFlex="35" class="modal-qr-code-container padding-gap-large" [fxLayoutAlign]="offer?.bolt12 && offer?.bolt12 !== '' ? 'center start' : 'center center'" [ngClass]="{'display-none': screenSize === screenSizeEnum.XS || screenSize === screenSizeEnum.SM}">
<qr-code *ngIf="offer?.bolt12 && offer?.bolt12 !== ''" [value]="offer?.bolt12" [size]="qrWidth" [errorCorrectionLevel]="'L'"></qr-code>
<span *ngIf="!offer?.bolt12 || offer?.bolt12 === ''" class="font-size-300">N/A</span>
</div>
<div fxFlex="65">
<mat-card-header fxLayout="row" fxLayoutAlign="space-between center" class="modal-info-header">
<div fxFlex="95" fxLayoutAlign="start start">
<fa-icon class="page-title-img mr-1" [icon]="faReceipt"></fa-icon>
<span class="page-title">{{screenSize === screenSizeEnum.XS ? (newlyAdded ? 'Created' : 'Offer') : (newlyAdded ? 'Offer Created' : 'Offer Information')}}</span>
</div>
<button tabindex="3" fxFlex="5" fxLayoutAlign="center center" class="btn-close-x p-0" mat-button (click)="onClose()">X</button>
</mat-card-header>
<mat-card-content class="padding-gap-x-large" [ngClass]="{'xs-scroll-y': screenSize === screenSizeEnum.XS}">
<div fxLayout="column">
<div fxFlex="30" class="modal-qr-code-container padding-gap" [fxLayoutAlign]="offer?.bolt12 && offer?.bolt12 !== '' ? 'center start' : 'center center'" [ngClass]="{'display-none': screenSize !== screenSizeEnum.XS && screenSize !== screenSizeEnum.SM}">
<qr-code *ngIf="offer?.bolt12 && offer?.bolt12 !== ''" [value]="offer?.bolt12" [size]="qrWidth" [errorCorrectionLevel]="'L'"></qr-code>
<span *ngIf="!offer?.bolt12 || offer?.bolt12 === ''" class="font-size-120">QR Code Not Applicable</span>
</div>
<mat-divider *ngIf="screenSize === screenSizeEnum.XS || screenSize === screenSizeEnum.SM" class="my-1" [inset]="true"></mat-divider>
<div fxLayout="row">
<div fxFlex="50">
<h4 fxLayoutAlign="start" class="font-bold-500">Amount Requested (Sats)</h4>
<span class="foreground-secondary-text">
{{ !offerDecoded?.offer_amount_msat || offerDecoded?.offer_amount === 0 ? 'Open Offer' : ((offerDecoded?.offer_amount / 1000) | number) }}
</span>
</div>
<div fxFlex="50">
<h4 fxLayoutAlign="start" class="font-bold-500">Valid</h4>
<span class="foreground-secondary-text">
{{ !offerDecoded?.valid ? 'N/K' : offerDecoded?.valid ? 'Yes' : 'No' }}
</span>
</div>
</div>
<mat-divider class="w-100 my-1"></mat-divider>
<div fxLayout="row">
<div fxFlex="100">
<h4 fxLayoutAlign="start" class="font-bold-500">Description</h4>
<span class="foreground-secondary-text">
{{offerDecoded?.offer_description}}
</span>
</div>
</div>
<mat-divider class="w-100 my-1"></mat-divider>
<div fxLayout="row">
<div fxFlex="100">
<h4 fxLayoutAlign="start" class="font-bold-500">Offer Node ID</h4>
<span class="foreground-secondary-text">{{offerDecoded?.offer_node_id}}</span>
</div>
</div>
<div *ngIf="showAdvanced">
<mat-divider *ngIf="offer?.used || offer?.single_use" class="w-100 my-1"></mat-divider>
<div *ngIf="offer?.used || offer?.single_use" fxLayout="row">
<div fxFlex="50">
<h4 fxLayoutAlign="start" class="font-bold-500">Used</h4>
<span class="foreground-secondary-text">
{{ !offer?.used ? 'N/K' : offer?.used ? 'Yes' : 'No' }}
</span>
</div>
<div fxFlex="50">
<h4 fxLayoutAlign="start" class="font-bold-500">Single Use</h4>
<span class="foreground-secondary-text">
{{ !offer?.single_use ? 'N/K' : offer?.single_use ? 'Yes' : 'No' }}
</span>
</div>
</div>
<mat-divider *ngIf="offerDecoded?.issuer" class="w-100 my-1"></mat-divider>
<div *ngIf="offerDecoded?.issuer" fxLayout="row">
<div fxFlex="100">
<h4 fxLayoutAlign="start" class="font-bold-500">Issuer</h4>
<span class="overflow-wrap foreground-secondary-text">{{offerDecoded?.offer_issuer}}</span>
</div>
</div>
<mat-divider *ngIf="offer.label" class="w-100 my-1"></mat-divider>
<div *ngIf="offer.label" fxLayout="row">
<div fxFlex="100">
<h4 fxLayoutAlign="start" class="font-bold-500">Label</h4>
<span class="foreground-secondary-text">{{ offer.label }}</span>
</div>
</div>
<mat-divider class="w-100 my-1"></mat-divider>
<div fxLayout="row">
<div fxFlex="100">
<h4 fxLayoutAlign="start" class="font-bold-500">Offer ID</h4>
<span class="foreground-secondary-text">{{ offerDecoded.offer_id }}</span>
</div>
</div>
<mat-divider class="w-100 my-1"></mat-divider>
</div>
<div fxLayout="row" fxLayoutAlign="end center" [ngClass]="{'mt-2': !showAdvanced, 'mt-1': showAdvanced}">
<button class="mr-1" mat-button color="primary" type="reset" tabindex="1" (click)="onShowAdvanced()">
<p *ngIf="!showAdvanced; else hideAdvancedText">Show Advanced</p>
<ng-template #hideAdvancedText><p>Hide Advanced</p></ng-template>
</button>
<button *ngIf="offer?.bolt12 && offer?.bolt12 !== ''" autoFocus mat-button color="primary" tabindex="2" type="submit" rtlClipboard [payload]="offer?.bolt12" (copied)="onCopyOffer($event)">Copy Offer</button>
<button *ngIf="!offer?.bolt12 || offer?.bolt12 === ''" autoFocus mat-button color="primary" tabindex="2" type="button" (click)="onClose()">OK</button>
</div>
</div>
</mat-card-content>
</div>
</div>