Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Infoscreen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
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
Evy Storozhenko
Infoscreen
Commits
d0fd6697
Commit
d0fd6697
authored
1 year ago
by
Niklas Schrötler
Browse files
Options
Downloads
Patches
Plain Diff
Implemented Bild Panel
parent
0e911297
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/index.css
+4
-0
4 additions, 0 deletions
src/index.css
src/panels/Bild.tsx
+56
-0
56 additions, 0 deletions
src/panels/Bild.tsx
src/panels/_Panels.tsx
+3
-10
3 additions, 10 deletions
src/panels/_Panels.tsx
with
63 additions
and
10 deletions
src/index.css
+
4
−
0
View file @
d0fd6697
...
@@ -8,3 +8,7 @@
...
@@ -8,3 +8,7 @@
grid-template-rows
:
repeat
(
auto-fill
,
45px
);
grid-template-rows
:
repeat
(
auto-fill
,
45px
);
grid-gap
:
30px
;
grid-gap
:
30px
;
}
}
.bg-lower-gradient
{
background-image
:
linear-gradient
(
180deg
,
rgba
(
24
,
24
,
27
,
0
)
0%
,
rgba
(
24
,
24
,
27
,
0.70
)
60%
,
rgba
(
24
,
24
,
27
,
1.00
)
100%
)
}
This diff is collapsed.
Click to expand it.
src/panels/Bild.tsx
0 → 100644
+
56
−
0
View file @
d0fd6697
import
React
from
'
react
'
;
import
PanelWrapper
from
"
../meta/PanelWrapper
"
;
import
classNames
from
"
../util/classNames
"
;
import
PanelContent
from
"
../meta/PanelContent
"
;
export
type
BildPanelDefinition
=
{
url
:
string
,
fit
?:
"
fill
"
|
"
fit
"
,
title
?:
string
,
description
?:
string
}
const
BildPanel
=
(
props
:
{
definition
:
BildPanelDefinition
})
=>
{
return
(
<
PanelWrapper
className
=
{
"
relative
"
}
>
<
div
className
=
{
"
absolute inset-0 h-full w-full bg-cover blur-lg backdrop-brightness-75
"
}
style
=
{
{
backgroundImage
:
`url('
${
props
.
definition
.
url
}
')`
}
}
>
</
div
>
<
div
className
=
{
"
absolute inset-0 h-full w-full flex
"
}
>
<
div
className
=
{
classNames
(
"
bg-no-repeat bg-center flex-1 relative
"
,
(
props
.
definition
.
fit
===
"
fit
"
)
?
"
bg-contain
"
:
"
bg-cover
"
)
}
style
=
{
{
backgroundImage
:
`url('
${
props
.
definition
.
url
}
')`
}
}
>
{
props
.
definition
.
title
&&
(
<>
<
div
className
=
{
"
absolute inset-0 w-full h-full bg-lower-gradient
"
}
>
</
div
>
<
PanelContent
className
=
{
"
absolute inset-0 w-full h-full flex flex-col justify-end
"
}
>
<
h2
className
=
{
"
text-xl font-semibold
"
}
>
{
props
.
definition
.
title
}
</
h2
>
{
props
.
definition
.
description
&&
(
<
p
className
=
{
"
pr-6 leading-tight mt-1
"
}
>
{
props
.
definition
.
description
}
</
p
>
)
}
</
PanelContent
>
</>
)
}
</
div
>
</
div
>
</
PanelWrapper
>
);
};
export
default
BildPanel
;
This diff is collapsed.
Click to expand it.
src/panels/_Panels.tsx
+
3
−
10
View file @
d0fd6697
...
@@ -6,13 +6,14 @@
...
@@ -6,13 +6,14 @@
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
FahrplanPanel
from
"
./Fahrplan/FahrplanPanel
"
;
import
FahrplanPanel
from
"
./Fahrplan/FahrplanPanel
"
;
import
{
PanelDefinition
}
from
"
../types/LayoutConfig
"
;
import
{
PanelDefinition
}
from
"
../types/LayoutConfig
"
;
import
BildPanel
from
"
./Bild
"
;
/*
/*
* First, please claim a unique id for your panel here. Convention is that it is all lowercase, in snake-case to be
* First, please claim a unique id for your panel here. Convention is that it is all lowercase, in snake-case to be
* precise. So if you want to call your panel "My awesome Panel", please claim "my-awesome-panel". Add it by adding
* precise. So if you want to call your panel "My awesome Panel", please claim "my-awesome-panel". Add it by adding
* `| "my-awesome-panel"` before the semicolon in the type below this comment.
* `| "my-awesome-panel"` before the semicolon in the type below this comment.
*/
*/
export
type
PanelTypes
=
"
fahrplan
"
;
export
type
PanelTypes
=
"
fahrplan
"
|
"
bild
"
;
/*
/*
* Next, add your renderer. You'll get the definition that was written in the layout config as a prop. If you'd like to
* Next, add your renderer. You'll get the definition that was written in the layout config as a prop. If you'd like to
...
@@ -21,15 +22,7 @@ export type PanelTypes = "fahrplan";
...
@@ -21,15 +22,7 @@ export type PanelTypes = "fahrplan";
*/
*/
export
const
PanelRenderers
:
{[
panelType
:
string
]:
React
.
FC
<
any
&
{
definition
:
PanelDefinition
<
any
>
}
>
}
=
{
export
const
PanelRenderers
:
{[
panelType
:
string
]:
React
.
FC
<
any
&
{
definition
:
PanelDefinition
<
any
>
}
>
}
=
{
"
fahrplan
"
:
FahrplanPanel
,
"
fahrplan
"
:
FahrplanPanel
,
"
test
"
:
()
=>
(
"
bild
"
:
BildPanel
<
h1
>
Test!
</
h1
>
),
"
demo
"
:
()
=>
(
<
p
>
Demo!
</
p
>
),
"
foobar
"
:
()
=>
(
<
p
>
FooBar!
</
p
>
)
};
};
...
...
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