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
00895d4c
Commit
00895d4c
authored
1 year ago
by
Niklas Schrötler
Browse files
Options
Downloads
Patches
Plain Diff
Implemented CalloutPanel
parent
ed8f0a1a
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/panels/Callout/CalloutPanel.tsx
+42
-0
42 additions, 0 deletions
src/panels/Callout/CalloutPanel.tsx
src/panels/_Panels.tsx
+3
-1
3 additions, 1 deletion
src/panels/_Panels.tsx
with
45 additions
and
1 deletion
src/panels/Callout/CalloutPanel.tsx
0 → 100644
+
42
−
0
View file @
00895d4c
import
React
from
'
react
'
;
import
PanelWrapper
from
"
../../meta/PanelWrapper
"
;
import
PanelContent
from
"
../../meta/PanelContent
"
;
import
{
Warning
}
from
"
@phosphor-icons/react
"
;
export
type
CalloutPanelDefinition
=
{
type
?:
"
warning
"
,
title
?:
string
,
description
?:
string
}
const
CalloutPanel
=
(
props
:
{
definition
:
CalloutPanelDefinition
})
=>
{
return
(
<
PanelWrapper
>
<
div
className
=
{
"
flex flex-row h-full w-full
"
}
>
<
div
className
=
{
"
bg-yellow-500 aspect-square flex justify-center items-center
"
}
>
<
Warning
size
=
{
48
}
className
=
{
"
text-zinc-900
"
}
/>
</
div
>
<
PanelContent
className
=
{
"
flex-1 flex justify-start items-center
"
}
padding
=
{
false
}
>
<
div
className
=
{
"
px-6 py-5
"
}
>
{
props
.
definition
.
title
&&
(
<
h2
className
=
{
"
text-lg font-semibold
"
}
>
{
props
.
definition
.
title
}
</
h2
>
)
}
{
props
.
definition
.
description
&&
(
<
p
className
=
{
"
mt-1 text-sm
"
}
>
{
props
.
definition
.
description
}
</
p
>
)
}
</
div
>
</
PanelContent
>
</
div
>
</
PanelWrapper
>
);
};
export
default
CalloutPanel
;
This diff is collapsed.
Click to expand it.
src/panels/_Panels.tsx
+
3
−
1
View file @
00895d4c
...
@@ -9,13 +9,14 @@ import {PanelDefinition} from "../types/LayoutConfig";
...
@@ -9,13 +9,14 @@ import {PanelDefinition} from "../types/LayoutConfig";
import
PanelWrapper
from
"
../meta/PanelWrapper
"
;
import
PanelWrapper
from
"
../meta/PanelWrapper
"
;
import
BildPanel
from
"
./Bild/BildPanel
"
;
import
BildPanel
from
"
./Bild/BildPanel
"
;
import
MensaplanPanel
from
"
./Mensaplan/MensaplanPanel
"
;
import
MensaplanPanel
from
"
./Mensaplan/MensaplanPanel
"
;
import
CalloutPanel
from
"
./Callout/CalloutPanel
"
;
/*
/*
* 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
"
|
"
bild
"
;
export
type
PanelTypes
=
"
fahrplan
"
|
"
bild
"
|
"
mensaplan
"
|
"
callout
"
;
/*
/*
* 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
...
@@ -26,6 +27,7 @@ export const PanelRenderers: {[panelType: string]: React.FC<any & {definition: P
...
@@ -26,6 +27,7 @@ export const PanelRenderers: {[panelType: string]: React.FC<any & {definition: P
"
fahrplan
"
:
FahrplanPanel
,
"
fahrplan
"
:
FahrplanPanel
,
"
bild
"
:
BildPanel
,
"
bild
"
:
BildPanel
,
"
mensaplan
"
:
MensaplanPanel
,
"
mensaplan
"
:
MensaplanPanel
,
"
callout
"
:
CalloutPanel
,
"
placeholder
"
:
()
=>
(
"
placeholder
"
:
()
=>
(
<
PanelWrapper
className
=
{
"
flex flex-col items-center justify-center text-zinc-400
"
}
>
<
PanelWrapper
className
=
{
"
flex flex-col items-center justify-center text-zinc-400
"
}
>
Dieses Panel wird noch entwickelt
Dieses Panel wird noch entwickelt
...
...
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