aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tabs/tab/tab.component.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-07-12 09:31:50 +0800
committerGitHub <noreply@github.com>2018-07-12 09:31:50 +0800
commit0d4dbbec2abfa8c8015063d6e4a5ff0d34abe7b9 (patch)
tree10251992448d308123c16a6a01e02d7b422ddad2 /ui/app/components/tabs/tab/tab.component.js
parent4521de19e641e4cda27b906c47b46929ddb831ec (diff)
parent67017711df521e4d9f92cfc756b5468f7704a79c (diff)
downloadtangerine-wallet-browser-0d4dbbec2abfa8c8015063d6e4a5ff0d34abe7b9.tar.gz
tangerine-wallet-browser-0d4dbbec2abfa8c8015063d6e4a5ff0d34abe7b9.tar.zst
tangerine-wallet-browser-0d4dbbec2abfa8c8015063d6e4a5ff0d34abe7b9.zip
Merge pull request #4691 from MetaMask/i4404-confirm-refactor
Refactor and redesign confirm transaction views
Diffstat (limited to 'ui/app/components/tabs/tab/tab.component.js')
-rw-r--r--ui/app/components/tabs/tab/tab.component.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/ui/app/components/tabs/tab/tab.component.js b/ui/app/components/tabs/tab/tab.component.js
new file mode 100644
index 000000000..a59da8904
--- /dev/null
+++ b/ui/app/components/tabs/tab/tab.component.js
@@ -0,0 +1,31 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+import classnames from 'classnames'
+
+const Tab = props => {
+ const { name, onClick, isActive, tabIndex } = props
+
+ return (
+ <li
+ className={classnames(
+ 'tab',
+ isActive && 'tab--active',
+ )}
+ onClick={event => {
+ event.preventDefault()
+ onClick(tabIndex)
+ }}
+ >
+ { name }
+ </li>
+ )
+}
+
+Tab.propTypes = {
+ name: PropTypes.string.isRequired,
+ onClick: PropTypes.func,
+ isActive: PropTypes.bool,
+ tabIndex: PropTypes.number,
+}
+
+export default Tab