-
-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade redux-devtools to latest version (#781)
* Initial work of @redux-devtools/app upgrade * Add missing PersistGate * Fix lint errors * Add patches/@redux-devtools+inspector-monitor-trace-tab+1.0.0.patch * Add window dragable in header & custom buttons * Custom Settings (Remove connection tab) * Fix tabs style * Update docs/redux-devtools-integration.md * Update default instances state * Update E2E tests * Remove socketcluster-client alias * Cleanup
- Loading branch information
Showing
22 changed files
with
2,150 additions
and
1,400 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
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 was deleted.
Oops, something went wrong.
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,41 @@ | ||
import React from 'react'; | ||
import { useSelector, useDispatch } from 'react-redux'; | ||
import { Container, Notification } from '@redux-devtools/ui'; | ||
import { clearNotification } from '@redux-devtools/app/lib/esm/actions'; | ||
import Actions from '@redux-devtools/app/lib/esm/containers/Actions'; | ||
import Settings from './Settings'; | ||
import Header from './Header'; | ||
|
||
const App = () => { | ||
const section = useSelector(state => state.section); | ||
const theme = useSelector(state => state.theme); | ||
const notification = useSelector(state => state.notification); | ||
|
||
const dispatch = useDispatch(); | ||
|
||
let body; | ||
switch (section) { | ||
case 'Settings': | ||
body = <Settings />; | ||
break; | ||
default: | ||
body = <Actions />; | ||
} | ||
|
||
return ( | ||
<Container themeData={theme}> | ||
<Header section={section} /> | ||
{body} | ||
{notification && ( | ||
<Notification | ||
type={notification.type} | ||
onClose={() => dispatch(clearNotification())} | ||
> | ||
{notification.message} | ||
</Notification> | ||
)} | ||
</Container> | ||
); | ||
}; | ||
|
||
export default App; |
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,59 @@ | ||
import React, { useCallback } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { useDispatch } from 'react-redux'; | ||
import { Tabs, Toolbar, Button, Divider } from '@redux-devtools/ui'; | ||
import { GoBook } from 'react-icons/go'; | ||
import styled from 'styled-components'; | ||
import { changeSection } from '@redux-devtools/app/lib/esm/actions'; | ||
import { shell } from 'electron'; | ||
|
||
const WindowDraggable = styled.div` | ||
display: flex; | ||
flex: 1; | ||
height: 100%; | ||
-webkit-app-region: drag; | ||
-webkit-user-select: none; | ||
`; | ||
|
||
const tabs = [{ name: 'Actions' }, { name: 'Settings' }]; | ||
|
||
const Header = (props) => { | ||
const { section } = props; | ||
|
||
const dispatch = useDispatch(); | ||
|
||
const handleChangeSection = useCallback( | ||
(sec) => dispatch(changeSection(sec)), | ||
[dispatch, changeSection], | ||
); | ||
|
||
const openHelp = useCallback(() => shell.openExternal('https://goo.gl/SHU4yL'), []); | ||
|
||
return ( | ||
<Toolbar compact noBorder borderPosition="bottom"> | ||
<Tabs | ||
main | ||
collapsible | ||
tabs={tabs} | ||
onClick={handleChangeSection} | ||
selected={section || 'Actions'} | ||
style={{ flex: 'unset' }} | ||
/> | ||
<WindowDraggable /> | ||
<Divider /> | ||
<Button | ||
title="Documentation" | ||
tooltipPosition="bottom" | ||
onClick={openHelp} | ||
> | ||
<GoBook /> | ||
</Button> | ||
</Toolbar> | ||
); | ||
}; | ||
|
||
Header.propTypes = { | ||
section: PropTypes.string, | ||
}; | ||
|
||
export default Header; |
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,26 @@ | ||
/* eslint-disable import/no-named-as-default */ | ||
import React, { Component } from 'react'; | ||
import Tabs from '@redux-devtools/ui/lib/esm/Tabs/Tabs'; | ||
import Themes from '@redux-devtools/app/lib/esm/components/Settings/Themes'; | ||
|
||
export default class Settings extends Component { | ||
state = { selected: 'Themes' }; | ||
|
||
tabs = [ | ||
{ name: 'Themes', component: Themes }, | ||
]; | ||
|
||
handleSelect = (selected) => { | ||
this.setState({ selected }); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<Tabs | ||
tabs={this.tabs} | ||
selected={this.state.selected} | ||
onClick={this.handleSelect} | ||
/> | ||
); | ||
} | ||
} |
Oops, something went wrong.