浏览代码

[https://github.com/tracim/tracim/issues/809] added lang label on header

Skylsmoi 6 年前
父节点
当前提交
8c0af6cdf3

+ 3 - 1
frontend/src/component/Header/MenuActionListItem/DropdownLang.jsx 查看文件

@@ -4,6 +4,7 @@ import PropTypes from 'prop-types'
4 4
 require('./DropdownLang.styl')
5 5
 
6 6
 const DropdownLang = props => {
7
+  const activeLang = props.langList.find(l => l.id === props.idLangActive)
7 8
   return (
8 9
     <li className='header__menu__rightside__itemlanguage'>
9 10
       <div className='header__menu__rightside__itemlanguage__languagedropdown dropdown'>
@@ -15,7 +16,8 @@ const DropdownLang = props => {
15 16
           aria-haspopup='true'
16 17
           aria-expanded='false'
17 18
         >
18
-          <img className='languagedropdown__btnlanguage__imgselected' src={props.langList.find(l => l.id === props.idLangActive).icon} />
19
+          <img className='languagedropdown__btnlanguage__imgselected' src={activeLang.icon} />
20
+          { activeLang.label }
19 21
         </button>
20 22
         <div className='languagedropdown__subdropdown dropdown-menu' aria-labelledby='headerDropdownMenuButton'>
21 23
           { props.langList.filter(l => l.id !== props.idLangActive).map(l =>

+ 1 - 0
frontend/src/component/Header/MenuActionListItem/DropdownLang.styl 查看文件

@@ -12,6 +12,7 @@
12 12
       margin-right 10px
13 13
       width 20px
14 14
       height 15px
15
+      vertical-align middle
15 16
   &__subdropdown
16 17
     padding 0
17 18
     min-width 0