Skip to content

Commit 609a08b

Browse files
mediedhueitan
andauthored
Experiment UI final touches (#363)
* always return true in the experiment config * Fix description margin * Update feed loading styling * Add rectangle delay animation * Restore feed loading flow * Restore experiment config Co-authored-by: Huei Tan <huei90@gmail.com>
1 parent 58a98c5 commit 609a08b

File tree

2 files changed

+39
-24
lines changed

2 files changed

+39
-24
lines changed

src/components/Feed.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const Feed = ({ lang, isExpanded, setIsExpanded, lastIndex, setNavigation
4444
}
4545

4646
const Loading = ({ isExpanded }) => {
47+
const i18n = useI18n()
4748
const loadingExpanded = () => {
4849
const loadingItem = (selectable = false) => {
4950
return (
@@ -59,6 +60,9 @@ const Loading = ({ isExpanded }) => {
5960

6061
return (
6162
<div class='expanded'>
63+
<div class='top'>
64+
<div class='header'><span>{i18n('feed-header')}</span></div>
65+
</div>
6266
{loadingItem(true)}
6367
{loadingItem()}
6468
{loadingItem()}
@@ -67,8 +71,7 @@ const Loading = ({ isExpanded }) => {
6771
}
6872

6973
return (
70-
<div class='loading'>
71-
{!isExpanded && <div class='collapsed' />}
74+
<div class={`loading ${!isExpanded ? 'collapsed' : ''}`}>
7275
{isExpanded && loadingExpanded()}
7376
</div>
7477
)

style/feed.less

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@
109109
&.withImg {
110110
width: 155px;
111111
}
112+
113+
p {
114+
margin: 0;
115+
}
112116
}
113117
}
114118

@@ -140,57 +144,65 @@
140144
}
141145

142146
.loading {
143-
background-color: #fff;
147+
background-color: #eaecf0;
144148
height: 300px;
145-
margin-top: -5px;
146149

147-
.collapsed {
150+
&.collapsed {
148151
height: 55px;
149-
background-color: #d8d8d8;
150-
margin-right: 10px;
151-
margin-left: 10px;
152-
margin-top: 10px;
152+
margin-top: -9px;
153153
border-radius: 6px 6px 0 0;
154-
padding: 0 10px;
155154
}
156155

157156
.expanded {
158-
padding-top: 25px;
157+
.top {
158+
background-color: #eaecf0;
159+
height: 38px;
160+
padding-top: 5px;
161+
}
159162

160163
.item {
161164
display: flex;
162165
justify-content: space-between;
163-
margin-left: 10px;
164-
margin-right: 10px;
165166
margin-bottom: 5px;
166-
border-radius: 2px;
167-
border: solid 1px #d8d8d8;
168-
height: 60px;
167+
background-color: #fff;
168+
height: 67px;
169169

170170
.bars {
171171
height: 49px;
172172
width: 147px;
173173
background-color: #fff;
174174
padding-top: 12px;
175-
padding-left: 5px;
175+
padding-left: 10px;
176176

177177
.bar {
178-
width: 148px;
179-
height: 11px;
180-
margin: 0 0 10px;
178+
width: 160px;
179+
height: 12px;
180+
margin: 0 0 14px;
181181
border-radius: 2px;
182-
background-color: #d8d8d8;
182+
background-color: #eaecf0;
183183

184184
&.smaller {
185-
width: 118px;
185+
width: 110px;
186+
height: 10px;
186187
}
187188
}
188189
}
189190

190191
.rectangle {
191-
height: 58px;
192+
height: 50px;
192193
width: 50px;
193-
background-color: #d8d8d8;
194+
background-color: #eaecf0;
195+
margin-top: 4px;
196+
margin-right: 5px;
197+
border-radius: 6px;
198+
visibility: hidden;
199+
animation: rectangleDelay 0s 200ms forwards;
200+
201+
@keyframes rectangleDelay {
202+
to {
203+
visibility: visible;
204+
}
205+
}
194206
}
195207
}
196208
}

0 commit comments

Comments
 (0)