Skip to content

Commit

Permalink
feat: Change OpenPanelButton.js to tsx (#1116)
Browse files Browse the repository at this point in the history
* changed OpenPanelButton.js to tsx

* fix: Make import more general

* fix: Add semicolon after line 12
  • Loading branch information
teresalee99 authored Jan 31, 2024
1 parent 2d9f55f commit b863a85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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;

0 comments on commit b863a85

Please sign in to comment.