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
93f9eaf7
Commit
93f9eaf7
authored
Apr 11, 2020
by
apple502j
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix editor title when not logged in
parent
d8df3158
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
src/views/preview/meta.jsx
src/views/preview/meta.jsx
+14
-4
src/views/preview/project-view.jsx
src/views/preview/project-view.jsx
+4
-1
No files found.
src/views/preview/meta.jsx
View file @
93f9eaf7
const
React
=
require
(
'
react
'
);
const
React
=
require
(
'
react
'
);
const
Helmet
=
require
(
'
react-helmet
'
).
default
;
const
Helmet
=
require
(
'
react-helmet
'
).
default
;
const
PropTypes
=
require
(
'
prop-types
'
);
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
const
Meta
=
props
=>
{
const
Meta
=
props
=>
{
const
{
id
,
title
,
instructions
,
author
}
=
props
.
projectInfo
;
const
{
id
,
title
,
instructions
,
author
}
=
props
.
projectInfo
;
// Do not want to render any meta tags unless all the info is loaded
if
(
!
author
)
{
// Check only author (object) because it is ok to have empty string instructions
// Project info is not ready. It's either fetching state, or logged-out users creating project.
if
(
!
author
)
return
null
;
if
(
!
props
.
userPresent
)
{
return
(
<
Helmet
>
<
title
>
Scratch - Imagine, Program, Share
</
title
>
</
Helmet
>
);
}
return
null
;
}
const
truncatedInstructions
=
instructions
.
split
(
'
'
)
const
truncatedInstructions
=
instructions
.
split
(
'
'
)
.
slice
(
0
,
50
)
.
slice
(
0
,
50
)
...
@@ -38,7 +47,8 @@ const Meta = props => {
...
@@ -38,7 +47,8 @@ const Meta = props => {
};
};
Meta
.
propTypes
=
{
Meta
.
propTypes
=
{
projectInfo
:
projectShape
projectInfo
:
projectShape
,
userPresent
:
PropTypes
.
bool
};
};
module
.
exports
=
Meta
;
module
.
exports
=
Meta
;
src/views/preview/project-view.jsx
View file @
93f9eaf7
...
@@ -700,7 +700,10 @@ class Preview extends React.Component {
...
@@ -700,7 +700,10 @@ class Preview extends React.Component {
return
(
return
(
<
React
.
Fragment
>
<
React
.
Fragment
>
<
Meta
projectInfo=
{
this
.
props
.
projectInfo
}
/>
<
Meta
projectInfo=
{
this
.
props
.
projectInfo
}
userPresent=
{
this
.
props
.
userPresent
}
/>
{
this
.
props
.
playerMode
?
{
this
.
props
.
playerMode
?
<
Page
<
Page
className=
{
classNames
({
className=
{
classNames
({
...
...
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