From 5af1fc7c96530d8845601ac38b8b985a0287ba61 Mon Sep 17 00:00:00 2001 From: Johns Beharry Date: Sun, 28 Nov 2021 22:33:55 -0600 Subject: [PATCH] build(app): define webln type on window object --- src/api/index.ts | 12 ++++++++++++ src/global.d.ts | 3 +++ src/redux/features/wallet.slice.ts | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 src/global.d.ts diff --git a/src/api/index.ts b/src/api/index.ts index d68614e..e2b4404 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,7 +1,19 @@ import { Project, ProjectCard, ProjectCategory } from "../utils/interfaces"; +import { gql } from "@apollo/client"; import data from "./mockData.json"; export async function getAllCategories(): Promise { + let ALL_CATEGORIES = gql` + query GetCategories { + allCategories { + id + title + } + } + `; + + console.log(ALL_CATEGORIES) + return data.categories; } diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..be05ea9 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,3 @@ +declare interface Window { + webln: any; +} diff --git a/src/redux/features/wallet.slice.ts b/src/redux/features/wallet.slice.ts index 3d9732b..1781455 100644 --- a/src/redux/features/wallet.slice.ts +++ b/src/redux/features/wallet.slice.ts @@ -3,11 +3,13 @@ import { createSlice } from "@reduxjs/toolkit"; interface StoreState { isConnected: boolean; isLoading: boolean; + provider: any; } const initialState = { isConnected: false, isLoading: false, + provider: null, } as StoreState; export const walletSlice = createSlice({