-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): apollo client ui and routes
- Loading branch information
1 parent
e154267
commit b9bc85b
Showing
5 changed files
with
370 additions
and
0 deletions.
There are no files selected for viewing
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
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
118 changes: 118 additions & 0 deletions
118
apps/reactotron-app/src/renderer/pages/apolloClient/Cache.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import React from "react" | ||
import styled from "styled-components" | ||
import { Header } from "reactotron-core-ui" | ||
import { MdWarning } from "react-icons/md" | ||
import { HiDocumentSearch, HiOutlinePencilAlt } from "react-icons/hi" | ||
import { TbDatabaseDollar } from "react-icons/tb" | ||
import { Title } from "../reactNative/components/Shared" | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
` | ||
|
||
const StorybookContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
` | ||
|
||
const TopSection = styled.div` | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
` | ||
|
||
const WarningContainer = styled.div` | ||
display: flex; | ||
color: ${(props) => props.theme.warning}; | ||
background-color: ${(props) => props.theme.backgroundDarker}; | ||
border-top: 1px solid ${(props) => props.theme.chromeLine}; | ||
align-items: center; | ||
padding: 0 20px; | ||
` | ||
const WarningDescription = styled.div` | ||
margin-left: 20px; | ||
` | ||
|
||
function Cache() { | ||
return ( | ||
<Container> | ||
<Header | ||
isDraggable | ||
tabs={[ | ||
{ | ||
text: "Cache", | ||
icon: TbDatabaseDollar, | ||
isActive: true, | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
onClick: () => {}, | ||
}, | ||
{ | ||
text: "Queries", | ||
icon: HiDocumentSearch, | ||
isActive: false, | ||
onClick: () => { | ||
// TODO: Couldn't get react-router-dom to do it for me so I forced it. | ||
window.location.hash = "#/apolloClient/queries" | ||
}, | ||
}, | ||
{ | ||
text: "Mutations", | ||
icon: HiOutlinePencilAlt, | ||
isActive: false, | ||
onClick: () => { | ||
// TODO: Couldn't get react-router-dom to do it for me so I forced it. | ||
window.location.hash = "#/apolloClient/mutations" | ||
}, | ||
}, | ||
]} | ||
// actions={[ | ||
// { | ||
// tip: "Search", | ||
// icon: MdSearch, | ||
// onClick: () => { | ||
// toggleSearch() | ||
// }, | ||
// }, | ||
// { | ||
// tip: "Filter", | ||
// icon: MdFilterList, | ||
// onClick: () => { | ||
// openFilter() | ||
// }, | ||
// }, | ||
// { | ||
// tip: "Reverse Order", | ||
// icon: MdSwapVert, | ||
// onClick: () => { | ||
// toggleReverse() | ||
// }, | ||
// }, | ||
// { | ||
// tip: "Clear", | ||
// icon: MdDeleteSweep, | ||
// onClick: () => { | ||
// clearSelectedConnectionCommands() | ||
// }, | ||
// }, | ||
// ]} | ||
/> | ||
<StorybookContainer> | ||
<TopSection> | ||
<Title>TODO (utilize state subscription for right now)</Title> | ||
</TopSection> | ||
<WarningContainer> | ||
<MdWarning size={60} /> | ||
<WarningDescription>This is preview feature.</WarningDescription> | ||
</WarningContainer> | ||
</StorybookContainer> | ||
</Container> | ||
) | ||
} | ||
|
||
export default Cache |
117 changes: 117 additions & 0 deletions
117
apps/reactotron-app/src/renderer/pages/apolloClient/Mutations.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import React from "react" | ||
import styled from "styled-components" | ||
import { Header } from "reactotron-core-ui" | ||
import { MdWarning } from "react-icons/md" | ||
import { HiDocumentSearch, HiOutlinePencilAlt } from "react-icons/hi" | ||
import { TbDatabaseDollar } from "react-icons/tb" | ||
import { Title } from "../reactNative/components/Shared" | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
` | ||
|
||
const StorybookContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
` | ||
|
||
const TopSection = styled.div` | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
` | ||
|
||
const WarningContainer = styled.div` | ||
display: flex; | ||
color: ${(props) => props.theme.warning}; | ||
background-color: ${(props) => props.theme.backgroundDarker}; | ||
border-top: 1px solid ${(props) => props.theme.chromeLine}; | ||
align-items: center; | ||
padding: 0 20px; | ||
` | ||
const WarningDescription = styled.div` | ||
margin-left: 20px; | ||
` | ||
|
||
function Mutations() { | ||
return ( | ||
<Container> | ||
<Header | ||
isDraggable | ||
tabs={[ | ||
{ | ||
text: "Cache", | ||
icon: TbDatabaseDollar, | ||
isActive: false, | ||
onClick: () => { | ||
// TODO: Couldn't get react-router-dom to do it for me so I forced it. | ||
window.location.hash = "#/apolloClient/cache" | ||
}, | ||
}, | ||
{ | ||
text: "Queries", | ||
icon: HiDocumentSearch, | ||
isActive: false, | ||
onClick: () => { | ||
// TODO: Couldn't get react-router-dom to do it for me so I forced it. | ||
window.location.hash = "#/apolloClient/queries" | ||
}, | ||
}, | ||
{ | ||
text: "Mutations", | ||
icon: HiOutlinePencilAlt, | ||
isActive: true, | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
onClick: () => {}, | ||
}, | ||
]} | ||
// actions={[ | ||
// { | ||
// tip: "Search", | ||
// icon: MdSearch, | ||
// onClick: () => { | ||
// toggleSearch() | ||
// }, | ||
// }, | ||
// { | ||
// tip: "Filter", | ||
// icon: MdFilterList, | ||
// onClick: () => { | ||
// openFilter() | ||
// }, | ||
// }, | ||
// { | ||
// tip: "Reverse Order", | ||
// icon: MdSwapVert, | ||
// onClick: () => { | ||
// toggleReverse() | ||
// }, | ||
// }, | ||
// { | ||
// tip: "Clear", | ||
// icon: MdDeleteSweep, | ||
// onClick: () => { | ||
// clearSelectedConnectionCommands() | ||
// }, | ||
// }, | ||
// ]} | ||
/> | ||
<StorybookContainer> | ||
<TopSection> | ||
<Title>TODO</Title> | ||
</TopSection> | ||
<WarningContainer> | ||
<MdWarning size={60} /> | ||
<WarningDescription>This is preview feature.</WarningDescription> | ||
</WarningContainer> | ||
</StorybookContainer> | ||
</Container> | ||
) | ||
} | ||
|
||
export default Mutations |
Oops, something went wrong.