Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change OpenPanelButton.js to tsx #1116

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import React from 'react';
* togglePanel: function to call when you want the Profile Panel to disappear/reappear
*/

const OpenPanelButton = function ({ panelOpen, togglePanel }) {
interface OpenPanelButtonProps {
panelOpen: boolean;
togglePanel: () => void;
}

const OpenPanelButton = function ({ panelOpen, togglePanel }: OpenPanelButtonProps) {
// if the left panel is closed, show nothing
// otherwise show hamburger icon
if (panelOpen) {
Expand Down
9 changes: 3 additions & 6 deletions src/components/common/containers/OpenPanelButtonContainer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import { togglePanel } from '../../../actions/uiActions.js';
import OpenPanelButton from '../OpenPanelButton.js';
import { togglePanel } from '../../../actions/uiActions';
import OpenPanelButton from '../OpenPanelButton';

const mapStateToProps = (state) => ({
panelOpen: state.ui.panelOpen,
Expand All @@ -10,9 +10,6 @@ const mapDispatchToProps = (dispatch) => ({
togglePanel: () => dispatch(togglePanel()),
});

const OpenPanelButtonContainer = connect(
mapStateToProps,
mapDispatchToProps,
)(OpenPanelButton);
const OpenPanelButtonContainer = connect(mapStateToProps, mapDispatchToProps)(OpenPanelButton);

export default OpenPanelButtonContainer;
Loading