Skip to content

Commit

Permalink
Fix icons in tree title (#727)
Browse files Browse the repository at this point in the history
* fixed tree icon

* build files

* Automatic frontend build

---------

Co-authored-by: Corepex <[email protected]>
  • Loading branch information
Corepex and Corepex authored Nov 21, 2024
1 parent a31d550 commit 24bbd17
Show file tree
Hide file tree
Showing 21 changed files with 2,093 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@
import { Icon } from '@Pimcore/components/icon/icon'
import React from 'react'
import { useStyles } from './title-view.styles'
import { type ElementIcon } from '@Pimcore/modules/asset/asset-api-slice.gen'

interface TitleViewProps {
title: string
icon: string
icon: ElementIcon
className?: string
}

const TitleView = (props: TitleViewProps): React.JSX.Element => {
const { styles } = useStyles()
const { title, icon, className } = props

console.log(icon)

return (
<div className={ [styles.WidgetTitle, className].join(' ') }>
<div className={ [styles.WidgetTitle, className, 'foobar'].join(' ') }>
<Icon
options={ {
width: 18,
height: 18
} }
value={ icon }
{ ...icon }
/>

<span>{title}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ const WidgetContainer = (props: WidgetContainerProps): React.JSX.Element => {
const { node, component: Component } = props
const [nodeId] = useState(node.getId())
const isBorderNode = node.getParent() instanceof BorderNode
const config = node.getConfig()
const icon = config.icon ?? { value: 'widget-default', type: 'name' }

return useMemo(() => (
<WidgetContext.Provider value={ { nodeId } }>
<WidgetView
icon={ node.getIcon() ?? 'widget-default' }
icon={ icon }
showTitle={ isBorderNode }
title={ node.getName() }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import { TitleView } from './title/title-view'
import { useStyles } from './widget-view.styles'
import { useTranslation } from 'react-i18next'
import { useCssContainer, type UseCssContainerProps } from '@Pimcore/utils/hooks/use-css-container/use-css-container'
import { type ElementIcon } from '@Pimcore/modules/asset/asset-api-slice.gen'

interface WidgetViewProps {
title: string
showTitle?: boolean
icon: string
icon: ElementIcon
children: React.ReactNode
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"main": {
"js": [
"/bundles/pimcorestudioui/build/736f3394-3cac-4ba6-b519-6883f9433d23/main.js"
]
}
}
}
2 changes: 2 additions & 0 deletions public/build/736f3394-3cac-4ba6-b519-6883f9433d23/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
*
* /**
* * Pimcore
* *
* * This source file is available under two different licenses:
* * - Pimcore Open Core License (POCL)
* * - Pimcore Commercial License (PCL)
* * Full copyright and license information is available in
* * LICENSE.md which is distributed with this source code.
* *
* * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* * @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
* * /
*
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/736f3394-3cac-4ba6-b519-6883f9433d23/main.js": "/bundles/pimcorestudioui/build/736f3394-3cac-4ba6-b519-6883f9433d23/main.js"
}
2 changes: 2 additions & 0 deletions public/build/a7655a99-bba9-4955-ba46-18fb35d3cb71/947.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
*
* /**
* * Pimcore
* *
* * This source file is available under two different licenses:
* * - Pimcore Open Core License (POCL)
* * - Pimcore Commercial License (PCL)
* * Full copyright and license information is available in
* * LICENSE.md which is distributed with this source code.
* *
* * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* * @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
* * /
*
*/
16 changes: 16 additions & 0 deletions public/build/a7655a99-bba9-4955-ba46-18fb35d3cb71/core-dll.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions public/build/a7655a99-bba9-4955-ba46-18fb35d3cb71/core-dll.js

Large diffs are not rendered by default.

Loading

0 comments on commit 24bbd17

Please sign in to comment.