Skip to content

Commit 197cfb7

Browse files
author
vikasrohit
authored
Merge pull request #1126 from appirio-tech/feature/rendering-singe-section
Github issue#1125, Do not show section number when there is only one section
2 parents 4b6c8df + 23f4595 commit 197cfb7

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/projects/detail/components/SidebarNav.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
import React, { Component, PropTypes } from 'react'
33
import { Link as DirectLink } from 'react-scroll'
4+
import cn from 'classnames'
45
import { Icons } from 'appirio-tech-react-components'
56

67
require('./SidebarNav.scss')
@@ -39,7 +40,7 @@ const SidebarNavItem = ({ name, link, required, subItems, index}) =>
3940
<div className="item">
4041
<DirectLink to={link} {...scrollProps} href="javascript:">
4142
<h4 className="title">
42-
<span className="number">{index}.</span>{name}
43+
<span className="number" >{index}.</span>{name}
4344
{required && <span className="required">* required</span>}
4445
</h4>
4546
</DirectLink>
@@ -59,7 +60,7 @@ class SidebarNav extends Component {
5960
)
6061
}
6162
return (
62-
<div className="list-group">
63+
<div className={cn('list-group', {'single-section' : items.length === 1})}>
6364
{items.map(renderChild)}
6465
</div>
6566
)

src/projects/detail/components/SidebarNav.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,18 @@
8181
}
8282
}
8383
}
84+
85+
&.single-section {
86+
.title {
87+
padding-left: 0px;
88+
89+
.number {
90+
display: none;
91+
}
92+
}
93+
94+
.boxs {
95+
padding-left: 20px;// 42 - 22
96+
}
97+
}
8498
}

0 commit comments

Comments
 (0)