Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add independent component for side config panel #1505

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 14 additions & 46 deletions src/components/EditMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -617,21 +617,10 @@
</v-card>
</GlassModal>
</teleport>
<transition
enter-active-class="transition-transform duration-500 ease-in-out"
leave-active-class="transition-transform duration-0 ease-in-out"
enter-from-class="translate-x-full opacity-0"
enter-to-class="translate-x-0 opacity-100"
leave-from-class="translate-x-0 opacity-100"
leave-to-class="translate-x-full opacity-0"
>
<div
v-if="store.isElementsPropsDrawerVisible && store.editingMode && store.elementToShowOnDrawer"
class="flex fixed w-[250px] h-[78vh] right-0 top-0 border-l-[1px] border-[#FFFFFF44] text-white elevation-5 bg-[#051e2d]"
>
<ElementConfigPanel />
</div>
</transition>

<SideConfigPanel position="right">
<ElementConfigPanel v-if="store.elementToShowOnDrawer?.hash" />
</SideConfigPanel>
Comment on lines -620 to +623
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always nice to see this kind of cleaning happening in the code.

Can we also remove the styles and other parts not used anymore in this file?

</template>

<script setup lang="ts">
Expand Down Expand Up @@ -672,10 +661,11 @@ import {
WidgetType,
} from '@/types/widgets'

import ElementConfigPanel from './ElementConfigPanel.vue'
import ExpansiblePanel from './ExpansiblePanel.vue'
import GlassModal from './GlassModal.vue'
import ElementConfigPanel from './InputElementConfig.vue'
import MiniWidgetInstantiator from './MiniWidgetInstantiator.vue'
import SideConfigPanel from './SideConfigPanel.vue'

const { showDialog, closeDialog } = useInteractionDialog()

Expand Down Expand Up @@ -714,6 +704,14 @@ const emit = defineEmits<{
(e: 'update:editMode', editMode: boolean): void
}>()

watch(
() => store.elementToShowOnDrawer?.hash,
(newValue) => {
if (newValue) interfaceStore.configPanelVisible = true
if (!newValue) interfaceStore.configPanelVisible = false
}
)

const availableWidgetTypes = computed(() => Object.values(WidgetType))
const availableMiniWidgetTypes = computed(() =>
Object.values(MiniWidgetType).map((widgetType) => ({
Expand Down Expand Up @@ -1064,25 +1062,6 @@ const vehicleTypesAssignedToCurrentProfile = computed({
color: white;
}

.fade-and-suffle-move,
.fade-and-suffle-enter-active,
.fade-and-suffle-leave-active,
.fade-enter-active,
.fade-leave-active {
transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
}
.fade-and-suffle-enter-from,
.fade-enter-from,
.fade-and-suffle-leave-to,
.fade-leave-to {
opacity: 0;
transform: scaleY(0.01) translate(30px, 0);
}

.sortable-ghost {
cursor: grabbing;
}

.icon-btn {
display: flex;
align-items: center;
Expand All @@ -1097,13 +1076,6 @@ const vehicleTypesAssignedToCurrentProfile = computed({
cursor: pointer;
opacity: 0.8;
}
.icon-bt {
opacity: 1;
}

.selected-view {
@apply bg-slate-400;
}

.content-expand-collapse {
width: 100%;
Expand All @@ -1120,10 +1092,6 @@ const vehicleTypesAssignedToCurrentProfile = computed({
max-height: 0;
}

.linear-gradient {
background: linear-gradient(90deg, rgba(39, 56, 66, 0) 0%, rgba(39, 56, 66, 1) 57%, rgba(39, 56, 66, 1) 100%);
}

.wrapclass {
overflow: hidden;
text-overflow: ellipsis;
Expand Down
Loading
Loading