Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
feat: use react-query logo as toggle button (#37)
Browse files Browse the repository at this point in the history
* build: update @babel/preset-env to avoid nodejs/node#32852

* feat: use react-query logo as toggle button
  • Loading branch information
stefanprobst authored Jun 21, 2020
1 parent 9ca65b8 commit dc0bdcb
Show file tree
Hide file tree
Showing 4 changed files with 882 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"react-query": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@babel/preset-react": "^7.8.3",
"@rollup/plugin-json": "^4.0.2",
"@rollup/plugin-replace": "^2.3.1",
Expand Down
32 changes: 32 additions & 0 deletions src/Logo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { ThemeProvider } from './theme'
import { getQueryStatusLabel, getQueryStatusColor } from './utils'
import Explorer from './Explorer'
import Logo from './Logo'

const isServer = typeof window === 'undefined'

Expand Down Expand Up @@ -122,27 +123,33 @@ export function ReactQueryDevtools({
</Button>
</ThemeProvider>
) : (
<div
<button
{...otherToggleButtonProps}
onClick={() => {
setIsOpen(true)
onToggleClick && onToggleClick()
}}
style={{
background: 'none',
border: 0,
padding: 0,
position: 'fixed',
bottom: '0',
right: '0',
zIndex: '99999',
display: 'inline-block',
display: 'inline-flex',
fontSize: '1.5rem',
margin: '.5rem',
cursor: 'pointer',
textShadow: 'rgba(0,0,0,0.4) 0px 5px 10px',
...toggleButtonStyle,
}}
>
<span>🎛</span>
</div>
<Logo
width="1.5em"
height="1.5em"
aria-label="Open React Query Devtools"
/>
</button>
)}
</div>
)
Expand Down
Loading

0 comments on commit dc0bdcb

Please sign in to comment.