Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-ui-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
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
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
ccce
dev
ce-ui-common
Commits
a2945280
Commit
a2945280
authored
1 month ago
by
Johanna Szepanski
Browse files
Options
Downloads
Patches
Plain Diff
cleaned up IconBadge and added gap prop
parent
4f2069aa
No related branches found
No related tags found
1 merge request
!221
CE-3638: Migrate iconbadge and iconmenubutton
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/common/IconBadge/IconBadge.tsx
+31
-58
31 additions, 58 deletions
src/components/common/IconBadge/IconBadge.tsx
with
31 additions
and
58 deletions
src/components/common/IconBadge/IconBadge.tsx
+
31
−
58
View file @
a2945280
import
{
ReactNode
}
from
"
react
"
;
import
{
Grid
,
Typography
}
from
"
@mui/material
"
;
import
{
Typography
}
from
"
@mui/material
"
;
import
{
Stack
}
from
"
@mui/system
"
;
interface
IconBadgeProps
{
icon
:
ReactNode
;
title
:
string
;
subtitle
?:
string
|
ReactNode
;
gap
?:
number
;
}
export
const
IconBadge
=
({
icon
,
title
,
subtitle
}:
IconBadgeProps
)
=>
(
<
Grid
container
export
const
IconBadge
=
({
icon
,
title
,
subtitle
,
gap
=
3
}:
IconBadgeProps
)
=>
(
<
Stack
flexDirection
=
"row"
alignItems
=
"center"
direction
=
"row"
gap
=
{
gap
}
>
<
Grid
item
xs
=
{
3
}
sm
=
{
2
}
md
=
{
1
}
>
<
Grid
container
justifyContent
=
"center"
direction
=
"column"
alignItems
=
"center"
{
icon
}
<
Stack
>
<
Typography
variant
=
"subtitle1"
component
=
"p"
color
=
"textPrimary"
>
{
icon
}
</
Grid
>
</
Grid
>
<
Grid
item
xs
=
{
9
}
sm
=
{
10
}
md
=
{
11
}
>
<
Grid
container
justifyContent
=
"flex-start"
>
<
Grid
item
xs
=
{
12
}
zeroMinWidth
>
<
Typography
noWrap
variant
=
"subtitle1"
component
=
"p"
color
=
"textPrimary"
>
{
title
}
</
Typography
>
</
Grid
>
<
Grid
item
xs
=
{
12
}
zeroMinWidth
{
title
}
</
Typography
>
{
typeof
subtitle
===
"
string
"
?
(
<
Typography
component
=
"p"
variant
=
"subtitle2"
>
<
Typography
noWrap
component
=
"p"
variant
=
"subtitle2"
>
{
subtitle
}
</
Typography
>
</
Grid
>
</
Grid
>
</
Grid
>
</
Grid
>
{
subtitle
}
</
Typography
>
)
:
(
subtitle
)
}
</
Stack
>
</
Stack
>
);
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