From 1993a6588da298816589bead2e2839502dd55987 Mon Sep 17 00:00:00 2001 From: Callum Booth Date: Wed, 9 Oct 2019 12:45:52 +0100 Subject: [PATCH] Cleans up toggle button component --- .../main/Detail/ToggleStackDirectionButton.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/browser/main/Detail/ToggleStackDirectionButton.js b/browser/main/Detail/ToggleStackDirectionButton.js index c16e92e0..fb65a9bb 100644 --- a/browser/main/Detail/ToggleStackDirectionButton.js +++ b/browser/main/Detail/ToggleStackDirectionButton.js @@ -6,15 +6,16 @@ import i18n from 'browser/lib/i18n' const ToggleStackDirectionButton = ({ onClick, isStacking -}) => ( - -) +}) => { + const imgSrc = isStacking ? '../resources/icon/icon-panel-split-vertical.svg' : '../resources/icon/icon-panel-split-horizontal.svg' + const text = isStacking ? i18n.__('Split Panels Horizontally') : i18n.__('Split Panels Vertically') + return ( + + ) +} ToggleStackDirectionButton.propTypes = { onClick: PropTypes.func.isRequired,