This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { graphql } from '~/library/saleor/gql'; | |
import { server$ } from '@builder.io/qwik-city'; | |
import { gqlQuery } from '~/library/gql-fetch/gql-fetch'; | |
import { FetchProductBySlugDocument } from '~/library/saleor/gql/graphql'; | |
import type { VariablesOf } from '@graphql-typed-document-node/core'; | |
export const queryFetchProductBySlug = server$(async function ( | |
variables: VariablesOf<typeof FetchProductBySlugDocument> | |
) { | |
const tokens = extractTokens(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { PropFunction, Signal } from '@builder.io/qwik'; | |
import { $, component$, Slot, useSignal, useTask$ } from '@builder.io/qwik'; | |
import { useTranslate } from 'qwik-speak'; | |
type Props = { | |
title?: string; | |
confirmAction?: PropFunction<() => void>; | |
cancelAction?: PropFunction<() => void>; | |
openSignal: Signal<boolean>; | |
isDangerous?: boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Modified version of https://unpkg.com/[email protected]/dist/twemoji.esm.js. | |
*/ | |
/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */ | |
const U200D = String.fromCharCode(8205); // zero-width joiner | |
const UFE0Fg = /\uFE0F/g; // variation selector regex | |
export function getIconCode(char: string) { | |
return toCodePoint(char.indexOf(U200D) < 0 ? char.replace(UFE0Fg, '') : char); | |
} | |
function toCodePoint(unicodeSurrogates: string) { |