Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
moved the rename / delete menu up to prevent the delete from being hi…
Browse files Browse the repository at this point in the history
…dden (#10934)

* moved the rename / delete menu up to prevent the delete from being hidden

* added boolean to the sceneItem props to determine if the menu should be moved up or not

---------

Co-authored-by: Hanzla Mateen <[email protected]>
  • Loading branch information
MbfloydIR and hanzlamateen authored Aug 13, 2024
1 parent a9135cd commit 9d22098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/client-core/src/admin/components/scene/SceneItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ import { twMerge } from 'tailwind-merge'
type SceneItemProps = {
scene: StaticResourceType
updateEditorState?: boolean
moveMenuUp?: boolean
handleOpenScene: () => void
refetchProjectsData: () => void
}

export const SceneItem = ({ scene, updateEditorState, handleOpenScene, refetchProjectsData }: SceneItemProps) => {
export const SceneItem = ({
scene,
updateEditorState,
moveMenuUp,
handleOpenScene,
refetchProjectsData
}: SceneItemProps) => {
const { t } = useTranslation()
const editorState = useMutableState(EditorState)

Expand Down Expand Up @@ -118,7 +125,8 @@ export const SceneItem = ({ scene, updateEditorState, handleOpenScene, refetchPr
<ul
className={twMerge(
'fixed z-10 block w-max translate-x-5 rounded-lg bg-theme-primary px-4 py-3 pr-10',
showContentMenu.value ? 'visible' : 'hidden'
showContentMenu.value ? 'visible' : 'hidden',
moveMenuUp ? '-translate-y-10' : ''
)}
style={{
top: menuPosition.top.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default function ScenesPanel() {
key={scene.id}
scene={scene}
updateEditorState
moveMenuUp={true}
handleOpenScene={() => onClickScene(scene)}
refetchProjectsData={scenesQuery.refetch}
/>
Expand Down

0 comments on commit 9d22098

Please sign in to comment.