Skip to content

Commit bb083c5

Browse files
committed
Merge branch 'feature-timeline-wall' into timeline-wall-api-issues-18
# Conflicts: # src/shared/containers/timeline-wall/index.jsx
2 parents 3084810 + 394fcf9 commit bb083c5

File tree

3 files changed

+74
-5
lines changed

3 files changed

+74
-5
lines changed
Lines changed: 3 additions & 0 deletions
Loading

src/shared/containers/timeline-wall/index.jsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import React, { useState, useEffect, useRef } from 'react';
1+
import React, {
2+
useState, useEffect, useRef, useMemo,
3+
} from 'react';
24
import PT from 'prop-types';
35
import { connect } from 'react-redux';
46
import TopBanner from 'assets/images/timeline-wall/top-banner.png';
57
import TopBannerMobile from 'assets/images/timeline-wall/top-banner-mobile.png';
68
import IconCheveronDownBlue from 'assets/images/timeline-wall/cheveron-down-blue.svg';
9+
import IconArrowRight from 'assets/images/timeline-wall/icon-arrow-right.svg';
710
import { deleteEventById, approveEventById, rejectEventById } from 'services/timelineWall';
811
import cn from 'classnames';
912
import moment from 'moment';
@@ -155,10 +158,23 @@ function TimelineWallContainer(props) {
155158
};
156159

157160
const sortedEvents = _.orderBy(events, ['eventDate'], ['desc']);
161+
const shouldShowDiscuss = useMemo(() => {
162+
if (tab !== 0) {
163+
return false;
164+
}
165+
if (isAdmin) {
166+
return !isMobile;
167+
}
168+
return true;
169+
}, [isAdmin, isMobile, tab]);
158170

159171
return (
160172
<div styleName="container">
161-
<div styleName={isAdmin ? 'header header-admin' : 'header'}>
173+
<div styleName={cn('header', {
174+
'header-admin': isAdmin,
175+
'header-with-discuss': shouldShowDiscuss,
176+
})}
177+
>
162178
<img src={TopBanner} alt="top-banner" styleName="header-bg hide-mobile" />
163179
<img src={TopBannerMobile} alt="top-banner" styleName="header-bg hide-desktop show-mobile" />
164180

@@ -188,6 +204,16 @@ function TimelineWallContainer(props) {
188204
</div>
189205
) : (<h1 styleName="header-content-1">Topcoder Timeline Wall</h1>)}
190206

207+
{shouldShowDiscuss ? (
208+
<button
209+
type="button"
210+
styleName="btn-discuss"
211+
>
212+
<span>DISCUSS</span>
213+
<IconArrowRight />
214+
</button>
215+
) : null}
216+
191217
<button
192218
onClick={() => {
193219
setShowRightFilterMobile(true);

src/shared/containers/timeline-wall/styles.scss

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
@media (max-width: 768px) {
1818
min-height: 190px;
1919
}
20-
}
2120

22-
.header-admin {
23-
min-height: 207px;
21+
&.header-with-discuss {
22+
@media (max-width: 768px) {
23+
min-height: 214px;
24+
}
25+
}
26+
27+
&.header-admin {
28+
min-height: 207px;
29+
}
2430
}
2531

2632
.header-content-1 {
@@ -68,6 +74,40 @@
6874
display: none !important;
6975
}
7076

77+
.btn-discuss {
78+
margin-top: 11px;
79+
display: flex;
80+
align-items: center;
81+
position: absolute;
82+
top: 33px;
83+
left: 1408px;
84+
padding: 0;
85+
background: transparent;
86+
border: none;
87+
color: white;
88+
89+
@media (max-width: 1500px) {
90+
left: unset;
91+
right: 0;
92+
}
93+
94+
@media (max-width: 768px) {
95+
position: relative;
96+
right: unset;
97+
top: 0;
98+
margin-left: 27px;
99+
}
100+
101+
span {
102+
@include roboto-bold;
103+
104+
font-weight: 700;
105+
font-size: 16px;
106+
line-height: 16px;
107+
margin-right: 4px;
108+
}
109+
}
110+
71111
.tab-item {
72112
border: none;
73113
background-color: transparent;

0 commit comments

Comments
 (0)