Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
source
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TEAM-F-2019
source
Merge requests
!11
A bit of everything
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
A bit of everything
ABitOfEverything
into
develop
Overview
0
Commits
3
Pipelines
0
Changes
5
Merged
L5047
requested to merge
ABitOfEverything
into
develop
5 years ago
Overview
0
Commits
3
Pipelines
0
Changes
5
Expand
0
0
Merge request reports
Compare
develop
version 1
5d4a1815
5 years ago
develop (base)
and
latest version
latest version
0d26d44f
3 commits,
5 years ago
version 1
5d4a1815
2 commits,
5 years ago
5 files
+
317
−
97
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
wearright/src/components/bootstrap/Clothes.js
+
71
−
18
Options
import
React
,
{
Component
}
from
'
react
'
;
import
{
Row
,
Col
}
from
'
react-bootstrap
'
;
import
{
Row
,
Col
,
Figure
}
from
'
react-bootstrap
'
;
class
Clothes
extends
Component
{
render
()
{
const
{
clothing
}
=
this
.
props
;
constructor
(
props
)
{
super
(
props
);
this
.
manageClothes
=
this
.
manageClothes
.
bind
(
this
);
}
manageClothes
(
clothing
,
profile
)
{
let
cl
=
clothing
;
// If age is between 18 and 70 filter by gender
if
(
profile
.
age
>=
18
&&
profile
.
age
<=
70
)
{
cl
=
cl
.
filter
(
t
=>
t
.
Henkilo
===
profile
.
sex
);
}
const
retClothes
=
{};
for
(
let
i
=
0
;
i
<
cl
.
length
;
i
++
)
{
const
c
=
cl
[
i
];
if
(
!
retClothes
[
c
.
Kategoria
])
retClothes
[
c
.
Kategoria
]
=
[];
retClothes
[
c
.
Kategoria
].
push
(
c
);
}
let
cList
=
<
ul
>
Lataa
...
<
/ul
>
return
(
<
div
>
{
retClothes
[
"
head
"
]
?
this
.
manageSubCategories
(
"
Päähineet
"
,
retClothes
[
"
head
"
])
:
null
}
{
retClothes
[
"
body
"
]
?
this
.
manageSubCategories
(
"
Vartalo
"
,
retClothes
[
"
body
"
])
:
null
}
{
retClothes
[
"
hands
"
]
?
this
.
manageSubCategories
(
"
Käsineet
"
,
retClothes
[
"
hands
"
])
:
null
}
{
retClothes
[
"
legs
"
]
?
this
.
manageSubCategories
(
"
Housut
"
,
retClothes
[
"
legs
"
])
:
null
}
{
retClothes
[
"
feet
"
]
?
this
.
manageSubCategories
(
"
Jalkineet
"
,
retClothes
[
"
feet
"
])
:
null
}
{
retClothes
[
"
accessory
"
]
?
this
.
manageSubCategories
(
"
Lisävarusteet
"
,
retClothes
[
"
accessory
"
])
:
null
}
<
/div
>
)
}
manageSubCategories
(
titleName
,
arr
)
{
return
(
<
div
>
<
h3
>
{
titleName
}
<
/h3
>
<
Row
>
{
arr
.
map
((
t
,
i
)
=>
<
Col
key
=
{
i
}
xl
=
{
2
}
lg
=
{
3
}
md
=
{
4
}
sm
=
{
4
}
xs
=
{
6
}
>
<
Figure
>
<
Figure
.
Image
fluid
=
{
true
}
alt
=
{
t
.
Vaatenimi
}
src
=
"
https://i.imgur.com/C9N8qhi.png
"
/>
<
Figure
.
Caption
>
{
t
.
Vaatenimi
}
<
/Figure.Caption
>
<
/Figure
>
<
/Col
>
)}
<
/Row
>
<
/div
>
)
}
render
()
{
const
{
clothing
,
profile
}
=
this
.
props
;
let
cList
=
null
;
if
(
clothing
)
cList
=
<
ul
>
{
clothing
.
map
((
t
,
i
)
=>
<
li
key
=
{
i
}
>
{
t
.
Vaatenimi
}
<
/li>
)
}
<
/ul
>
if
(
clothing
)
{
cList
=
this
.
manageClothes
(
clothing
,
profile
);
}
return
(
<
Row
>
<
Col
>
<
h2
>
Sinun
kannattaisi
pukea
jotain
seuraavista
:
<
/h2
>
{
cList
}
<
/Col
>
<
/Row
>
<
div
>
<
h1
>
Sinun
kannattaisi
pukea
jotain
seuraavista
:
<
/h1
>
{
cList
}
<
/div
>
)
}
}
Loading