Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
3b729fcb
Commit
3b729fcb
authored
Oct 25, 2015
by
Ray Schamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move "should show banner" test to one function
parent
8cde05fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
18 deletions
+11
-18
src/views/splash/splash.jsx
src/views/splash/splash.jsx
+11
-18
No files found.
src/views/splash/splash.jsx
View file @
3b729fcb
...
...
@@ -41,18 +41,15 @@ var Splash = injectIntl(React.createClass({
this
.
getActivity
();
this
.
getFeaturedCustom
();
this
.
getNews
();
if
(
this
.
state
.
session
.
flags
.
has_outstanding_email_confirmation
&&
this
.
state
.
session
.
flags
.
confirm_email_banner
)
{
window
.
addEventListener
(
'
message
'
,
this
.
onMessage
);
}
}
else
{
this
.
setState
({
featuredCustom
:
[]});
this
.
setState
({
activity
:
[]});
this
.
setState
({
news
:
[]});
this
.
getProjectCount
();
}
if
(
this
.
shouldShowEmailConfirmation
())
{
window
.
addEventListener
(
'
message
'
,
this
.
onMessage
);
}
else
{
window
.
removeEventListener
(
'
message
'
,
this
.
onMessage
);
}
}
...
...
@@ -63,16 +60,10 @@ var Splash = injectIntl(React.createClass({
this
.
getActivity
();
this
.
getFeaturedCustom
();
this
.
getNews
();
if
(
this
.
state
.
session
.
flags
.
has_outstanding_email_confirmation
&&
this
.
state
.
session
.
flags
.
confirm_email_banner
)
{
window
.
addEventListener
(
'
message
'
,
this
.
onMessage
);
}
}
else
{
this
.
getProjectCount
();
}
if
(
this
.
shouldShowEmailConfirmation
())
window
.
addEventListener
(
'
message
'
,
this
.
onMessage
);
},
componentWillUnmount
:
function
()
{
window
.
removeEventListener
(
'
message
'
,
this
.
onMessage
);
...
...
@@ -147,6 +138,11 @@ var Splash = injectIntl(React.createClass({
new
Date
(
new
Date
-
2
*
7
*
24
*
60
*
60
*
1000
)
// Two weeks ago
);
},
shouldShowEmailConfirmation
:
function
()
{
return
(
this
.
state
.
session
.
user
&&
this
.
state
.
session
.
flags
.
has_outstanding_email_confirmation
&&
this
.
state
.
session
.
flags
.
confirm_email_banner
);
},
renderHomepageRows
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
...
...
@@ -288,13 +284,10 @@ var Splash = injectIntl(React.createClass({
},
render
:
function
()
{
var
featured
=
this
.
renderHomepageRows
();
var
showEmailConfirmation
=
(
this
.
state
.
session
.
user
&&
this
.
state
.
session
.
flags
.
has_outstanding_email_confirmation
&&
this
.
state
.
session
.
flags
.
confirm_email_banner
);
var
emailConfirmationStyle
=
{
width
:
500
,
height
:
330
,
padding
:
1
};
return
(
<
div
className=
"splash"
>
{
showEmailConfirmation
?
[
{
this
.
shouldShowEmailConfirmation
()
?
[
<
Banner
key=
"confirmedEmail"
className=
"warning"
onRequestDismiss=
{
this
.
handleDismiss
.
bind
(
this
,
'
confirmed_email
'
)
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment