Skip to content

Commit 062e910

Browse files
authored
Merge pull request #18 from oslabs-beta/austin/cleanup-example-2
connected to chrome extension
2 parents dbc0c98 + b5bd2cc commit 062e910

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

examples/example-2/client/src/client/App.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import React, { useState, useEffect } from 'react';
22
import PostsOne from './components/PostsOne';
33
import PostsTwo from './components/PostsTwo';
44
import PostsThree from './components/PostsThree';
5-
import ChromeComponent from './components/ChromeComponent';
6-
import { useQuery } from '@tanstack/react-query';
7-
import { QueryKey } from '@tanstack/react-query';
5+
// import ChromeComponent from './components/ChromeComponent';
6+
import { useQuery, QueryKey } from '@tanstack/react-query';
87

98
type QueryEvent = {
109
eventType: string;
@@ -22,7 +21,6 @@ type QueryData = {
2221

2322
const App = () => {
2423
const [screenView, setScreenView] = useState<string>('Posts One');
25-
2624
const [queryData, setQueryData] = useState<QueryData>({});
2725

2826
// Fetch the data from React Query's cache
@@ -36,7 +34,6 @@ const App = () => {
3634
'queryHash' in queryEvent
3735
) {
3836
const newEvent = queryEvent as QueryEvent;
39-
4037
const queryHash = newEvent.queryHash;
4138
const existingUpdates = queryData[queryHash]?.updates || [];
4239

@@ -99,7 +96,7 @@ const App = () => {
9996
{screenView === 'Posts One' && <PostsOne />}
10097
{screenView === 'Posts Two' && <PostsTwo />}
10198
{screenView === 'Posts Three' && <PostsThree />}
102-
{screenView === 'Data' && <ChromeComponent queryData={queryData} />}
99+
{/* {screenView === 'Data' && <ChromeComponent queryData={queryData} />} */}
103100
</div>
104101
</>
105102
);

examples/example-2/client/src/client/components/ChromeComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type QuerySnapshot = {
2929

3030
const ChromeComponent: React.FC<ChromeComponentProps> = ({ queryData }) => {
3131
const [querySnapshot, setQuerySnapshot] = useState<QuerySnapshot>({});
32-
3332
const [currentIndex, setCurrentIndex] = useState(0);
3433

3534
const [selectedQueries, setSelectedQueries] = useState<SelectedQueriesState>(
@@ -97,6 +96,8 @@ const ChromeComponent: React.FC<ChromeComponentProps> = ({ queryData }) => {
9796
);
9897
};
9998

99+
console.log(queryData);
100+
100101
return (
101102
<>
102103
<div className="select-query">

0 commit comments

Comments
 (0)