diff --git a/services/web/frontend/js/features/ide-redesign/components/rail/rail-tab.tsx b/services/web/frontend/js/features/ide-redesign/components/rail/rail-tab.tsx
index 9798c70926..11478e8a5e 100644
--- a/services/web/frontend/js/features/ide-redesign/components/rail/rail-tab.tsx
+++ b/services/web/frontend/js/features/ide-redesign/components/rail/rail-tab.tsx
@@ -1,15 +1,14 @@
import OLTooltip from '@/shared/components/ol/ol-tooltip'
-import MaterialIcon, {
- AvailableUnfilledIcon,
-} from '@/shared/components/material-icon'
+import MaterialIcon from '@/shared/components/material-icon'
import classNames from 'classnames'
import { forwardRef, ReactElement } from 'react'
import { NavLink } from 'react-bootstrap'
+import { RailElement } from '../../utils/rail-types'
const RailTab = forwardRef<
HTMLAnchorElement,
{
- icon: AvailableUnfilledIcon
+ icon: RailElement['icon']
eventKey: string
open: boolean
indicator?: ReactElement
@@ -31,26 +30,43 @@ const RailTab = forwardRef<
})}
disabled={disabled}
>
- {open ? (
-
- ) : (
-
- )}
+
{indicator}
)
})
+const RailTabIcon = ({
+ icon,
+ title,
+ open,
+}: {
+ icon: RailElement['icon']
+ title: string
+ open: boolean
+}) => {
+ if (typeof icon === 'string') {
+ return open ? (
+
+ ) : (
+
+ )
+ } else {
+ const Component = icon
+ return
+ }
+}
+
RailTab.displayName = 'RailTab'
export default RailTab
diff --git a/services/web/frontend/js/features/ide-redesign/utils/rail-types.ts b/services/web/frontend/js/features/ide-redesign/utils/rail-types.ts
index 9963027a52..3d8e0d1f48 100644
--- a/services/web/frontend/js/features/ide-redesign/utils/rail-types.ts
+++ b/services/web/frontend/js/features/ide-redesign/utils/rail-types.ts
@@ -1,9 +1,11 @@
import { AvailableUnfilledIcon } from '@/shared/components/material-icon'
import { RailTabKey } from '../contexts/rail-context'
-import { ReactElement } from 'react'
+import { FC, ReactElement } from 'react'
+
+export type CustomRailTabIcon = FC<{ open: boolean; title: string }>
export type RailElement = {
- icon: AvailableUnfilledIcon
+ icon: AvailableUnfilledIcon | CustomRailTabIcon
key: RailTabKey
component: ReactElement | null
indicator?: ReactElement
diff --git a/services/web/frontend/stylesheets/pages/editor/rail.scss b/services/web/frontend/stylesheets/pages/editor/rail.scss
index cd95996120..2d777ed155 100644
--- a/services/web/frontend/stylesheets/pages/editor/rail.scss
+++ b/services/web/frontend/stylesheets/pages/editor/rail.scss
@@ -93,6 +93,12 @@ body {
font-size: 20px;
}
+ .ide-rail-tab-img-icon {
+ width: 20px;
+ max-height: 32px;
+ object-fit: contain;
+ }
+
&.open-rail {
color: var(--ide-rail-link-active-color);
background-color: var(--ide-rail-link-active-background);