Skip to content

Instantly share code, notes, and snippets.

View oops-wrong's full-sized avatar

Denis Kutalo oops-wrong

  • Russia, Rostov-on-Don
View GitHub Profile
import { CheckoutEmailAddress } from './checkout';
import { Price } from './price';
import { Merchandise } from './product';
// Explanations https://shopify.dev/api/storefront/2022-04/objects/Order
export interface Order {
canceledAt?: string;
cancelReason?: string;
currencyCode: string;
import { Platform } from '@angular/cdk/platform';
import { APP_BASE_HREF } from '@angular/common';
import { Device } from '@awesome-cordova-plugins/device/ngx';
export function getBaseLocation(platform: Platform, device: Device) {
if ((platform.ANDROID || platform.IOS) && device.uuid) {
return '/';
}
return '/preview/';
}
import { CheckoutEmailAddress } from './checkout';
import { Price } from './price';
import { Merchandise } from './product';
// Explanations https://shopify.dev/api/storefront/2022-04/objects/Order
export interface Order {
canceledAt?: string;
cancelReason?: string;
currencyCode: string;
import { Injectable } from '@angular/core';
import { ApolloClient, createHttpLink, gql, InMemoryCache } from '@apollo/client/core';
import {
BdNodeDataImage,
PagedData,
shopifyHandleError,
shopifyMapEdges,
ShopifyPagedResponse,
} from '@builder-lib';
import { last } from 'lodash-es';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { ApolloClient, gql } from '@apollo/client/core';
import { BdNodeDataImage, shopifyHandleError } from '@builder-lib';
import { combineLatest, concatMap, from, map, Observable, switchMap } from 'rxjs';
import { tap } from 'rxjs/operators';
import {
ShopifyCreateFile,
ShopifyStagedTarget,
ShopifyStagedUploadsCreate,
import { BdNodeDataImage } from './bd-node';
export interface Collection {
id: string;
title: string;
description: string;
image: BdNodeDataImage;
}
import { BdNodeDataImage } from './bd-node';
import { Price } from './price';
export interface ProductSelectedOption {
name: string;
value: string;
}
export interface ProductVariant {
id: string;
import { Price } from './price';
import { ProductVariant } from './product';
export interface CartLine {
id: string;
subtotalAmount: string;
totalAmount: string;
estimatedCost: {
subtotalAmount: Price; // The estimated cost of the merchandise line before discounts.
totalAmount: Price; // The estimated total cost of the merchandise line.
import { isPlatformBrowser } from '@angular/common';
import {
AfterViewInit,
ApplicationRef,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentRef,
ElementRef,
Inject,
<ng-template #template>
<app-cart-item-image
*ngIf="item.type === bdNodeType.CartTableItemImage"
[bindSource]="bindSource"
[node]="item"
></app-cart-item-image>
<app-cart-item-title
*ngIf="item.type === bdNodeType.CartTableItemTitle"
[bindSource]="bindSource"