161 lines
3.5 KiB
Vue
161 lines
3.5 KiB
Vue
<template>
|
|
<div class="mobile-header">
|
|
<SideBarLogo
|
|
:logo-url="tenantMake.logo_url"
|
|
:make-name="tenantMake.name"
|
|
class="mobile-logo"
|
|
/>
|
|
|
|
<LanguageSelector
|
|
:initial-language="initialLanguage"
|
|
:current-language="currentLanguage"
|
|
:supported-language-details="supportedLanguageDetails"
|
|
:allowed-languages="allowedLanguages"
|
|
@language-changed="handleLanguageChange"
|
|
class="mobile-language-selector"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue';
|
|
import SideBarLogo from './SideBarLogo.vue';
|
|
import LanguageSelector from './LanguageSelector.vue';
|
|
|
|
const props = defineProps({
|
|
tenantMake: {
|
|
type: Object,
|
|
default: () => ({
|
|
name: '',
|
|
logo_url: '',
|
|
subtitle: ''
|
|
})
|
|
},
|
|
initialLanguage: {
|
|
type: String,
|
|
default: 'en'
|
|
},
|
|
supportedLanguageDetails: {
|
|
type: Object,
|
|
default: () => ({})
|
|
},
|
|
allowedLanguages: {
|
|
type: Array,
|
|
default: () => ['nl', 'en', 'fr', 'de']
|
|
},
|
|
apiPrefix: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
});
|
|
|
|
const emit = defineEmits(['language-changed']);
|
|
|
|
const currentLanguage = ref(props.initialLanguage);
|
|
|
|
const handleLanguageChange = (newLanguage) => {
|
|
currentLanguage.value = newLanguage;
|
|
|
|
// Emit to parent
|
|
emit('language-changed', newLanguage);
|
|
|
|
// Global event for backward compatibility
|
|
const globalEvent = new CustomEvent('language-changed', {
|
|
detail: { language: newLanguage }
|
|
});
|
|
document.dispatchEvent(globalEvent);
|
|
|
|
// Update chatConfig
|
|
if (window.chatConfig) {
|
|
window.chatConfig.language = newLanguage;
|
|
}
|
|
|
|
// Save preference
|
|
localStorage.setItem('preferredLanguage', newLanguage);
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.mobile-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 10px 15px;
|
|
background: var(--sidebar-background);
|
|
color: var(--sidebar-color);
|
|
border-bottom: 1px solid rgba(0,0,0,0.1);
|
|
min-height: 60px;
|
|
}
|
|
|
|
/* Mobile logo container - meer specifieke styling */
|
|
.mobile-logo {
|
|
flex-shrink: 0;
|
|
display: flex !important;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
height: 50px; /* Vaste hoogte voor consistentie */
|
|
min-width: 120px; /* Minimale breedte */
|
|
}
|
|
|
|
/* Diepere styling voor het logo component */
|
|
.mobile-logo :deep(.sidebar-logo) {
|
|
padding: 0 !important;
|
|
margin: 0 !important;
|
|
display: flex !important;
|
|
align-items: center !important;
|
|
justify-content: flex-start !important;
|
|
height: 100% !important;
|
|
}
|
|
|
|
.mobile-logo :deep(.logo-image) {
|
|
max-height: 40px !important;
|
|
max-width: 120px !important;
|
|
height: auto !important;
|
|
width: auto !important;
|
|
object-fit: contain !important;
|
|
display: block !important;
|
|
}
|
|
|
|
.mobile-logo :deep(.logo-placeholder) {
|
|
width: 40px !important;
|
|
height: 40px !important;
|
|
font-size: 1rem !important;
|
|
display: flex !important;
|
|
align-items: center !important;
|
|
justify-content: center !important;
|
|
}
|
|
|
|
/* Mobile language selector styling */
|
|
.mobile-language-selector {
|
|
flex-shrink: 1;
|
|
min-width: 140px;
|
|
}
|
|
|
|
.mobile-language-selector :deep(.language-selector) {
|
|
margin: 0;
|
|
}
|
|
|
|
.mobile-language-selector :deep(label) {
|
|
display: none; /* Hide label in mobile header */
|
|
}
|
|
|
|
.mobile-language-selector :deep(.language-select) {
|
|
padding: 6px 10px;
|
|
font-size: 0.85rem;
|
|
min-width: 120px;
|
|
margin: 0;
|
|
}
|
|
|
|
/* Media queries voor responsiviteit */
|
|
@media (max-width: 768px) {
|
|
.mobile-header {
|
|
display: flex;
|
|
}
|
|
}
|
|
|
|
@media (min-width: 769px) {
|
|
.mobile-header {
|
|
display: none;
|
|
}
|
|
}
|
|
</style> |