Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IT2810_P2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IT2810-H19
T
Teams
Team 36
IT2810_P2
Commits
ebf93d07
Commit
ebf93d07
authored
Sep 27, 2019
by
Svein Olav Styve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some final fixes
parent
e0b0c118
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
40 deletions
+30
-40
src/App.js
src/App.js
+3
-2
src/components/Artwork.js
src/components/Artwork.js
+20
-31
src/components/DisplayChooser.js
src/components/DisplayChooser.js
+4
-4
src/components/MediaContainer.js
src/components/MediaContainer.js
+3
-3
No files found.
src/App.js
View file @
ebf93d07
...
...
@@ -219,12 +219,13 @@ class App extends React.Component {
<
div
className
=
"
App
"
>
<
div
className
=
"
cluster
"
>
<
div
className
=
"
chooser
"
>
<
DisplayChooser
categorySelections
=
{
categorySelections
}
handler
=
{
this
}
/
>
<
DisplayChooser
categorySelections
=
{
categorySelections
}
handleCategoryChange
=
{
this
.
handleCategoryChange
}
/
>
<
FavoriteSection
save
=
{
this
.
saveAsFavorite
}
open
=
{
this
.
openFavorite
}
/
>
<
/div
>
<
div
className
=
"
artworkArea
"
>
<
Artwork
artwork
=
{
this
.
state
.
artwork
}
handle
r
=
{
this
}
handle
ArtworkChange
=
{
this
.
handleArtworkChange
}
categorySelections
=
{
categorySelections
}
/
>
<
/div
>
<
/div
>
...
...
src/components/Artwork.js
View file @
ebf93d07
...
...
@@ -5,37 +5,26 @@ import Audio from './Audio';
import
Tabs
from
'
./Tabs
'
;
import
'
../style/Artwork.css
'
;
export
default
class
Artwork
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
export
default
function
Artwork
(
props
)
{
this
.
handleArtworkChange
=
this
.
handleArtworkChange
.
bind
(
this
);
}
handleArtworkChange
(
artwork
)
{
this
.
props
.
handler
.
handleArtworkChange
(
artwork
);
}
render
()
{
const
artwork
=
this
.
props
.
artwork
;
const
textCat
=
this
.
props
.
categorySelections
.
textCat
;
const
imgCat
=
this
.
props
.
categorySelections
.
imageCat
;
const
audioCat
=
this
.
props
.
categorySelections
.
audioCat
;
return
(
<
div
className
=
"
theArtwork
"
>
<
div
className
=
"
tabs
"
>
<
Tabs
artwork
=
{
artwork
}
onArtworkChange
=
{
this
.
handleArtworkChange
}
/
>
<
/div
>
<
div
className
=
"
text
"
>
<
Text
artwork
=
{
artwork
}
cat
=
{
textCat
}
/
>
<
/div
>
<
div
className
=
"
theImage
"
>
<
Image
id
=
"
myImage
"
artwork
=
{
artwork
}
cat
=
{
imgCat
}
/
>
<
/div
>
<
div
className
=
"
audio
"
>
<
Audio
artwork
=
{
artwork
}
cat
=
{
audioCat
}
/
>
<
/div
>
const
artwork
=
props
.
artwork
;
const
textCat
=
props
.
categorySelections
.
textCat
;
const
imgCat
=
props
.
categorySelections
.
imageCat
;
const
audioCat
=
props
.
categorySelections
.
audioCat
;
return
(
<
div
className
=
"
theArtwork
"
>
<
div
className
=
"
tabs
"
>
<
Tabs
artwork
=
{
artwork
}
onArtworkChange
=
{
props
.
handleArtworkChange
}
/
>
<
/div
>
<
div
className
=
"
text
"
>
<
Text
artwork
=
{
artwork
}
cat
=
{
textCat
}
/
>
<
/div
>
<
div
className
=
"
theImage
"
>
<
Image
id
=
"
myImage
"
artwork
=
{
artwork
}
cat
=
{
imgCat
}
/
>
<
/div
>
<
div
className
=
"
audio
"
>
<
Audio
artwork
=
{
artwork
}
cat
=
{
audioCat
}
/
>
<
/div
>
);
}
<
/div
>
);
}
src/components/DisplayChooser.js
View file @
ebf93d07
...
...
@@ -10,7 +10,7 @@ export default class DisplayChooser extends React.Component {
}
combineMediaCategories
=
event
=>
{
this
.
props
.
handle
r
.
handle
CategoryChange
(
event
.
target
.
name
,
event
.
target
.
value
);
this
.
props
.
handleCategoryChange
(
event
.
target
.
name
,
event
.
target
.
value
);
localStorage
.
setItem
(
event
.
target
.
name
,
event
.
target
.
value
);
};
...
...
@@ -19,11 +19,11 @@ export default class DisplayChooser extends React.Component {
return
(
<
div
className
=
"
Display-chooser
"
>
<
MediaContainer
checkedIndex
=
{
this
.
props
.
categorySelections
.
textCat
}
categoryNames
=
{
categoryNames
}
media
=
"
Text
"
handler
=
{
this
}
/
>
media
=
"
Text
"
combineMediaCategories
=
{
this
.
combineMediaCategories
}
/
>
<
MediaContainer
checkedIndex
=
{
this
.
props
.
categorySelections
.
imageCat
}
categoryNames
=
{
categoryNames
}
media
=
"
Image
"
handler
=
{
this
}
/
>
media
=
"
Image
"
combineMediaCategories
=
{
this
.
combineMediaCategories
}
/
>
<
MediaContainer
checkedIndex
=
{
this
.
props
.
categorySelections
.
audioCat
}
categoryNames
=
{
categoryNames
}
media
=
"
Audio
"
handler
=
{
this
}
/
>
media
=
"
Audio
"
combineMediaCategories
=
{
this
.
combineMediaCategories
}
/
>
<
/div
>
);
}
...
...
src/components/MediaContainer.js
View file @
ebf93d07
...
...
@@ -16,17 +16,17 @@ export default class MediaContainer extends React.Component {
<
div
className
=
"
Media-component
"
>
<
h3
>
{
this
.
props
.
media
}
<
/h3
>
<
Categories
value
=
{
categories
[
0
]}
mediaType
=
{
this
.
props
.
media
}
handleChange
=
{
this
.
props
.
handler
.
combineMediaCategories
}
handleChange
=
{
this
.
props
.
combineMediaCategories
}
categoryName
=
{
this
.
props
.
categoryNames
[
0
]}
selectionName
=
{
this
.
props
.
media
+
categories
[
0
]}
checked
=
{
checked
[
0
]}
/
>
<
Categories
value
=
{
categories
[
1
]}
mediaType
=
{
this
.
props
.
media
}
handleChange
=
{
this
.
props
.
handler
.
combineMediaCategories
}
handleChange
=
{
this
.
props
.
combineMediaCategories
}
categoryName
=
{
this
.
props
.
categoryNames
[
1
]}
selectionName
=
{
this
.
props
.
media
+
categories
[
1
]}
checked
=
{
checked
[
1
]}
/
>
<
Categories
value
=
{
categories
[
2
]}
mediaType
=
{
this
.
props
.
media
}
handleChange
=
{
this
.
props
.
handler
.
combineMediaCategories
}
handleChange
=
{
this
.
props
.
combineMediaCategories
}
categoryName
=
{
this
.
props
.
categoryNames
[
2
]}
selectionName
=
{
this
.
props
.
media
+
categories
[
2
]}
checked
=
{
checked
[
2
]}
/
>
...
...
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