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
4f4a5987
Unverified
Commit
4f4a5987
authored
Nov 19, 2018
by
Benjamin Wheeler
Committed by
GitHub
Nov 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2324 from benjiwheeler/remix-button
enable remix button; format remix, see inside button css
parents
3b1b96a0
50a20727
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
31 deletions
+58
-31
src/views/preview/presentation.jsx
src/views/preview/presentation.jsx
+32
-22
src/views/preview/preview.jsx
src/views/preview/preview.jsx
+14
-4
src/views/preview/preview.scss
src/views/preview/preview.scss
+11
-4
src/views/preview/subactions.scss
src/views/preview/subactions.scss
+1
-1
No files found.
src/views/preview/presentation.jsx
View file @
4f4a5987
...
...
@@ -43,10 +43,12 @@ const onKeyPress = e => {
};
const
PreviewPresentation
=
({
addToStudioOpen
,
assetHost
,
backpackHost
,
canAddToStudio
,
canDeleteComments
,
canRemix
,
canReport
,
canRestoreComments
,
canShare
,
...
...
@@ -61,39 +63,40 @@ const PreviewPresentation = ({
isFullScreen
,
isLoggedIn
,
isShared
,
loved
,
loveCount
,
loved
,
moreCommentsToLoad
,
originalInfo
,
parentInfo
,
projectHost
,
projectId
,
projectInfo
,
projectNotAvailable
,
remixes
,
reportOpen
,
replies
,
addToStudioOpen
,
projectStudios
,
singleCommentId
,
userOwnsProject
,
onAddComment
,
onAddToStudioClicked
,
onAddToStudioClosed
,
onDeleteComment
,
onFavoriteClicked
,
onLoadMore
,
onLoveClicked
,
onRemix
,
onReportClicked
,
onReportClose
,
onReportComment
,
onReportSubmit
,
onRestoreComment
,
onAddToStudioClicked
,
onAddToStudioClosed
,
onToggleStudio
,
onToggleComments
,
onSeeInside
,
onShare
,
onUpdate
onToggleComments
,
onToggleStudio
,
onUpdate
,
onUpdateProjectId
,
originalInfo
,
parentInfo
,
projectHost
,
projectId
,
projectInfo
,
projectNotAvailable
,
projectStudios
,
remixes
,
replies
,
reportOpen
,
singleCommentId
,
userOwnsProject
})
=>
{
const
shareDate
=
((
projectInfo
.
history
&&
projectInfo
.
history
.
shared
))
?
projectInfo
.
history
.
shared
:
''
;
...
...
@@ -154,9 +157,11 @@ const PreviewPresentation = ({
</
FlexRow
>
<
MediaQuery
minWidth=
{
frameless
.
mobile
}
>
<
div
className=
"project-buttons"
>
{
/* TODO: Hide Remix button for now until implemented */
}
{
(
!
userOwnsProject
&&
false
)
&&
<
Button
className=
"button remix-button"
>
{
canRemix
&&
<
Button
className=
"button remix-button"
onClick=
{
onRemix
}
>
<
FormattedMessage
id=
"project.remixButton"
/>
</
Button
>
}
...
...
@@ -177,12 +182,14 @@ const PreviewPresentation = ({
backpackHost=
{
backpackHost
}
backpackVisible=
{
canUseBackpack
}
basePath=
"/"
canRemix=
{
canRemix
}
className=
"guiPlayer"
cloudHost=
{
cloudHost
}
isFullScreen=
{
isFullScreen
}
previewInfoVisible=
"false"
projectHost=
{
projectHost
}
projectId=
{
projectId
}
onUpdateProjectId=
{
onUpdateProjectId
}
/>
</
div
>
<
MediaQuery
maxWidth=
{
frameless
.
tablet
-
1
}
>
...
...
@@ -449,6 +456,7 @@ PreviewPresentation.propTypes = {
backpackHost
:
PropTypes
.
string
,
canAddToStudio
:
PropTypes
.
bool
,
canDeleteComments
:
PropTypes
.
bool
,
canRemix
:
PropTypes
.
bool
,
canReport
:
PropTypes
.
bool
,
canRestoreComments
:
PropTypes
.
bool
,
canShare
:
PropTypes
.
bool
,
...
...
@@ -473,6 +481,7 @@ PreviewPresentation.propTypes = {
onFavoriteClicked
:
PropTypes
.
func
,
onLoadMore
:
PropTypes
.
func
,
onLoveClicked
:
PropTypes
.
func
,
onRemix
:
PropTypes
.
func
,
onReportClicked
:
PropTypes
.
func
.
isRequired
,
onReportClose
:
PropTypes
.
func
.
isRequired
,
onReportComment
:
PropTypes
.
func
.
isRequired
,
...
...
@@ -483,6 +492,7 @@ PreviewPresentation.propTypes = {
onToggleComments
:
PropTypes
.
func
,
onToggleStudio
:
PropTypes
.
func
,
onUpdate
:
PropTypes
.
func
,
onUpdateProjectId
:
PropTypes
.
func
,
originalInfo
:
projectShape
,
parentInfo
:
projectShape
,
projectHost
:
PropTypes
.
string
,
...
...
src/views/preview/preview.jsx
View file @
4f4a5987
...
...
@@ -50,6 +50,7 @@ class Preview extends React.Component {
'
handleRestoreComment
'
,
'
handleAddToStudioClick
'
,
'
handleAddToStudioClose
'
,
'
handleRemix
'
,
'
handleSeeInside
'
,
'
handleShare
'
,
'
handleUpdateProjectId
'
,
...
...
@@ -73,13 +74,13 @@ class Preview extends React.Component {
parseInt
(
window
.
location
.
hash
.
replace
(
commentHashPrefix
,
''
),
10
);
this
.
state
=
{
addToStudioOpen
:
false
,
extensions
:
[],
favoriteCount
:
0
,
loveCount
:
0
,
projectId
:
parts
[
1
]
===
'
editor
'
?
'
0
'
:
parts
[
1
],
singleCommentId
:
singleCommentId
,
addToStudioOpen
:
false
,
reportOpen
:
false
reportOpen
:
false
,
singleCommentId
:
singleCommentId
};
this
.
addEventListeners
();
/* In the beginning, if user is on mobile and landscape, go to fullscreen */
...
...
@@ -328,6 +329,9 @@ class Preview extends React.Component {
}));
}
}
handleRemix
()
{
this
.
props
.
remixProject
();
}
handleSeeInside
()
{
this
.
props
.
setPlayer
(
false
);
}
...
...
@@ -405,6 +409,7 @@ class Preview extends React.Component {
backpackHost=
{
this
.
props
.
backpackHost
}
canAddToStudio=
{
this
.
props
.
canAddToStudio
}
canDeleteComments=
{
this
.
props
.
isAdmin
||
this
.
props
.
userOwnsProject
}
canRemix=
{
this
.
props
.
canRemix
}
canReport=
{
this
.
props
.
canReport
}
canRestoreComments=
{
this
.
props
.
isAdmin
}
canShare=
{
this
.
props
.
canShare
}
...
...
@@ -440,6 +445,7 @@ class Preview extends React.Component {
onFavoriteClicked=
{
this
.
handleFavoriteToggle
}
onLoadMore=
{
this
.
handleLoadMore
}
onLoveClicked=
{
this
.
handleLoveToggle
}
onRemix=
{
this
.
handleRemix
}
onReportClicked=
{
this
.
handleReportClick
}
onReportClose=
{
this
.
handleReportClose
}
onReportComment=
{
this
.
handleReportComment
}
...
...
@@ -450,11 +456,11 @@ class Preview extends React.Component {
onToggleComments=
{
this
.
handleToggleComments
}
onToggleStudio=
{
this
.
handleToggleStudio
}
onUpdate=
{
this
.
handleUpdate
}
onUpdateProjectId=
{
this
.
handleUpdateProjectId
}
/>
</
Page
>
:
<
React
.
Fragment
>
<
IntlGUI
hideIntro
assetHost=
{
this
.
props
.
assetHost
}
authorId=
{
this
.
props
.
authorId
}
authorThumbnailUrl=
{
this
.
props
.
authorThumbnailUrl
}
...
...
@@ -544,6 +550,7 @@ Preview.propTypes = {
projectInfo
:
projectShape
,
projectNotAvailable
:
PropTypes
.
bool
,
projectStudios
:
PropTypes
.
arrayOf
(
PropTypes
.
object
),
remixProject
:
PropTypes
.
func
,
remixes
:
PropTypes
.
arrayOf
(
PropTypes
.
object
),
replies
:
PropTypes
.
objectOf
(
PropTypes
.
array
),
reportProject
:
PropTypes
.
func
,
...
...
@@ -728,6 +735,9 @@ const mapDispatchToProps = dispatch => ({
updateProject
:
(
id
,
formData
,
username
,
token
)
=>
{
dispatch
(
previewActions
.
updateProject
(
id
,
formData
,
username
,
token
));
},
remixProject
:
()
=>
{
dispatch
(
GUI
.
remixProject
());
},
setPlayer
:
player
=>
{
dispatch
(
GUI
.
setPlayer
(
player
));
},
...
...
src/views/preview/preview.scss
View file @
4f4a5987
...
...
@@ -163,6 +163,7 @@ $stage-width: 480px;
}
.project-buttons
{
font-weight
:
bold
;
flex-shrink
:
0
;
}
...
...
@@ -206,17 +207,23 @@ $stage-width: 480px;
.remix-button
,
.see-inside-button
{
margin-top
:
0
;
border-radius
:
.25rem
;
padding-top
:
.6875rem
;
padding-right
:
.9375rem
;
padding-bottom
:
.6875rem
;
padding-left
:
.875rem
;
height
:
2
.5rem
;
font-size
:
.875rem
;
font-weight
:
normal
;
&
:before
{
display
:
inline-block
;
margin-right
:
.5rem
;
margin-top
:
-2px
;
margin-right
:
.4375rem
;
background-repeat
:
no-repeat
;
background-position
:
center
center
;
background-size
:
contain
;
width
:
1
.25rem
;
height
:
1
.25rem
;
width
:
1
.
1
25rem
;
height
:
1
.
1
25rem
;
vertical-align
:
middle
;
content
:
""
;
}
...
...
src/views/preview/subactions.scss
View file @
4f4a5987
...
...
@@ -54,7 +54,7 @@
text-decoration
:
none
;
line-height
:
.875rem
;
font-size
:
.75rem
;
font-weight
:
normal
;
font-weight
:
bold
;
&
.studio-button
,
&
.copy-link-button
,
...
...
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