Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scientia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Zhige Yu
scientia
Commits
97ba11b9
Commit
97ba11b9
authored
4 years ago
by
danieldeng2
Browse files
Options
Downloads
Patches
Plain Diff
Pass style directly into ModuleHeading
parent
665400f1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/pages/Timeline/components/ModuleHeading/index.tsx
+8
-3
8 additions, 3 deletions
...ponents/pages/Timeline/components/ModuleHeading/index.tsx
src/components/pages/Timeline/index.tsx
+5
-6
5 additions, 6 deletions
src/components/pages/Timeline/index.tsx
with
13 additions
and
9 deletions
src/components/pages/Timeline/components/ModuleHeading/index.tsx
+
8
−
3
View file @
97ba11b9
import
React
from
"
react
"
;
import
React
,
{
CSSProperties
}
from
"
react
"
;
import
Card
from
"
react-bootstrap/Card
"
;
import
Card
from
"
react-bootstrap/Card
"
;
import
styles
from
"
./style.module.scss
"
;
import
styles
from
"
./style.module.scss
"
;
export
interface
ModuleHeadingprops
{
export
interface
ModuleHeadingprops
{
moduleCode
:
string
;
moduleCode
:
string
;
title
:
string
;
title
:
string
;
style
?:
CSSProperties
;
}
}
const
ModuleHeading
:
React
.
FC
<
ModuleHeadingprops
>
=
({
moduleCode
,
title
})
=>
{
const
ModuleHeading
:
React
.
FC
<
ModuleHeadingprops
>
=
({
moduleCode
,
title
,
style
,
})
=>
{
return
(
return
(
<
Card
className
=
{
styles
.
moduleCard
}
>
<
Card
style
=
{
style
}
className
=
{
styles
.
moduleCard
}
>
<
Card
.
Header
>
<
Card
.
Header
>
<
span
>
{
moduleCode
}
</
span
>
<
span
>
{
moduleCode
}
</
span
>
</
Card
.
Header
>
</
Card
.
Header
>
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/Timeline/index.tsx
+
5
−
6
View file @
97ba11b9
...
@@ -33,7 +33,7 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
...
@@ -33,7 +33,7 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
this
.
props
.
initSideBar
();
this
.
props
.
initSideBar
();
let
moduleTracks
:
ModuleTracks
=
{};
let
moduleTracks
:
ModuleTracks
=
{};
modulesList
.
forEach
(({
code
})
=>
{
modulesList
.
forEach
(({
code
})
=>
{
moduleTracks
[
code
]
=
[[],
[]];
moduleTracks
[
code
]
=
[[],
[]];
});
});
this
.
setState
({
moduleTracks
:
moduleTracks
});
this
.
setState
({
moduleTracks
:
moduleTracks
});
}
}
...
@@ -62,13 +62,12 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
...
@@ -62,13 +62,12 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
const
tracks
=
this
.
state
.
moduleTracks
[
code
];
const
tracks
=
this
.
state
.
moduleTracks
[
code
];
if
(
tracks
)
{
if
(
tracks
)
{
moduleHeadings
.
push
(
moduleHeadings
.
push
(
<
div
<
ModuleHeading
key
=
{
code
}
key
=
{
code
}
className
=
{
styles
.
moduleHeading
}
style
=
{
{
height
:
`
${
tracks
.
length
*
trackHeight
}
rem`
}
}
style
=
{
{
height
:
`
${
tracks
.
length
*
trackHeight
}
rem`
}
}
>
moduleCode
=
{
code
}
<
ModuleHeading
moduleCode
=
{
code
}
title
=
{
modulesList
[
i
].
title
}
/>
title
=
{
modulesList
[
i
].
title
}
</
div
>
/
>
);
);
const
timelineBackgroundsClass
=
classNames
(
const
timelineBackgroundsClass
=
classNames
(
i
%
2
===
0
i
%
2
===
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment