feat: enhance sidebar and theme utilities for improved UI consistency
- Updated the Sidebar component styles to utilize theme-based classes for better visual consistency. - Added new utility functions to retrieve and convert theme colors for use in components, enhancing theming capabilities. - Improved layout logic to ensure the default theme is applied correctly based on user preferences and document readiness.
This commit is contained in:
@@ -1467,9 +1467,8 @@
|
||||
</div>
|
||||
<div
|
||||
bind:this={terminalScrollRef}
|
||||
class="bg-neutral text-neutral-content max-h-64 overflow-y-auto rounded-lg p-4 font-mono text-sm"
|
||||
style="background-color: #1a1a1a; color: #e5e5e5;"
|
||||
>
|
||||
class="bg-base-200 text-base-content max-h-64 overflow-y-auto rounded-lg p-4 font-mono text-sm border border-base-300"
|
||||
>
|
||||
{#if logsEnvio.length === 0}
|
||||
<div class="text-neutral-content/60 italic">Aguardando envio de notificação...</div>
|
||||
{:else}
|
||||
|
||||
@@ -18,19 +18,30 @@
|
||||
|
||||
// Aplicar tema quando o usuário for carregado
|
||||
$effect(() => {
|
||||
if (currentUser?.data?.temaPreferido) {
|
||||
// Usuário logado com tema preferido - aplicar tema salvo
|
||||
aplicarTema(currentUser.data.temaPreferido);
|
||||
} else if (currentUser?.data === null || (currentUser !== undefined && !currentUser.data)) {
|
||||
// Usuário não está logado - aplicar tema padrão (roxo)
|
||||
aplicarTemaPadrao();
|
||||
}
|
||||
if (typeof document === 'undefined') return;
|
||||
|
||||
const htmlElement = document.documentElement;
|
||||
|
||||
// Aguardar um pouco para garantir que o DOM está pronto
|
||||
const timeoutId = setTimeout(() => {
|
||||
if (currentUser?.data?.temaPreferido) {
|
||||
// Usuário logado com tema preferido - aplicar tema salvo
|
||||
aplicarTema(currentUser.data.temaPreferido);
|
||||
} else if (currentUser !== undefined) {
|
||||
// Se a query terminou (mesmo que não haja usuário), aplicar tema padrão
|
||||
if (!htmlElement.getAttribute('data-theme')) {
|
||||
aplicarTemaPadrao();
|
||||
}
|
||||
}
|
||||
}, 50);
|
||||
|
||||
return () => clearTimeout(timeoutId);
|
||||
});
|
||||
|
||||
// Aplicar tema padrão imediatamente ao carregar (antes de verificar usuário)
|
||||
$effect(() => {
|
||||
if (typeof document !== 'undefined') {
|
||||
// Se não há tema aplicado ainda, aplicar o padrão
|
||||
// Se não há tema aplicado ainda, aplicar o padrão imediatamente
|
||||
const htmlElement = document.documentElement;
|
||||
if (!htmlElement.getAttribute('data-theme')) {
|
||||
aplicarTemaPadrao();
|
||||
|
||||
Reference in New Issue
Block a user