Skip to content

Commit

Permalink
[TM-1568] move function out
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarLima1 committed Dec 30, 2024
1 parent 1e2ba82 commit e83bc9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/extensive/BlurContainer/BlurContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ import { twMerge as tw } from "tailwind-merge";

import Text from "@/components/elements/Text/Text";
import { TEXT_TYPES } from "@/constants/dashboardConsts";
import { useLogout } from "@/hooks/logout";

export interface BlurContainerProps {
isBlur: boolean;
textType?: string;
children: React.ReactNode;
className?: string;
logout?: () => void;
}

const BlurContainer = ({ isBlur, textType, children, className }: BlurContainerProps) => {
const BlurContainer = ({ isBlur, textType, children, className, logout }: BlurContainerProps) => {
const t = useT();
const logout = useLogout();

if (!isBlur) {
return <>{children}</>;
Expand Down
3 changes: 3 additions & 0 deletions src/pages/dashboard/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
TEXT_TYPES
} from "@/constants/dashboardConsts";
import { useDashboardContext } from "@/context/dashboard.provider";
import { useLogout } from "@/hooks/logout";
import {
formatLabelsVolunteers,
getFrameworkName,
Expand Down Expand Up @@ -59,6 +60,7 @@ export interface GraphicLegendProps {
const Dashboard = () => {
const t = useT();
const [, { user }] = useMyUser();
const logout = useLogout();
const { filters, setFilters, frameworks } = useDashboardContext();
const {
dashboardHeader,
Expand Down Expand Up @@ -297,6 +299,7 @@ const Dashboard = () => {
<BlurContainer
isBlur={isUserAllowed !== undefined ? !isUserAllowed?.allowed : false}
textType={user !== undefined ? TEXT_TYPES.LOGGED_USER : TEXT_TYPES.NOT_LOGGED_USER}
logout={logout}
>
<div className="grid w-full grid-cols-3 gap-4">
{dashboardHeader.map((item, index) => (
Expand Down

0 comments on commit e83bc9d

Please sign in to comment.