feat: implement theme customization and user preferences
- Added support for user-selected themes, allowing users to customize the appearance of the application. - Introduced a new `temaPreferido` field in the user schema to store the preferred theme. - Updated various components to apply the selected theme dynamically based on user preferences. - Enhanced the UI to include a theme selection interface, enabling users to preview and save their theme choices. - Implemented a polyfill for BlobBuilder to ensure compatibility across browsers, improving the functionality of the application.
This commit is contained in:
@@ -33,10 +33,6 @@
|
||||
let chartCanvas: HTMLCanvasElement;
|
||||
let chartInstance: Chart | null = null;
|
||||
|
||||
// Verificar autenticação primeiro
|
||||
const currentUserQuery = useQuery(api.auth.getCurrentUser, {});
|
||||
const usuarioAutenticado = $derived(currentUserQuery?.data !== null && currentUserQuery?.data !== undefined);
|
||||
|
||||
// Parâmetros reativos para queries
|
||||
const registrosParams = $derived({
|
||||
funcionarioId: funcionarioIdFiltro && funcionarioIdFiltro !== '' ? funcionarioIdFiltro : undefined,
|
||||
@@ -49,23 +45,11 @@
|
||||
funcionarioId: funcionarioIdFiltro && funcionarioIdFiltro !== '' ? funcionarioIdFiltro : undefined,
|
||||
});
|
||||
|
||||
// Queries condicionais - só executar se usuário estiver autenticado
|
||||
const funcionariosQuery = useQuery(
|
||||
api.funcionarios.getAll,
|
||||
usuarioAutenticado ? {} : 'skip'
|
||||
);
|
||||
const registrosQuery = useQuery(
|
||||
api.pontos.listarRegistrosPeriodo,
|
||||
usuarioAutenticado ? registrosParams : 'skip'
|
||||
);
|
||||
const estatisticasQuery = useQuery(
|
||||
api.pontos.obterEstatisticas,
|
||||
usuarioAutenticado ? estatisticasParams : 'skip'
|
||||
);
|
||||
const configQuery = useQuery(
|
||||
api.configuracaoPonto.obterConfiguracao,
|
||||
usuarioAutenticado ? {} : 'skip'
|
||||
);
|
||||
// Queries
|
||||
const funcionariosQuery = useQuery(api.funcionarios.getAll, {});
|
||||
const registrosQuery = useQuery(api.pontos.listarRegistrosPeriodo, registrosParams);
|
||||
const estatisticasQuery = useQuery(api.pontos.obterEstatisticas, estatisticasParams);
|
||||
const configQuery = useQuery(api.configuracaoPonto.obterConfiguracao, {});
|
||||
|
||||
const funcionarios = $derived(funcionariosQuery?.data || []);
|
||||
const registros = $derived(registrosQuery?.data || []);
|
||||
|
||||
Reference in New Issue
Block a user