mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-14 17:43:04 +00:00
style: Prettier on B84 quick-action files
This commit is contained in:
parent
eea2d9afa1
commit
940b866630
5 changed files with 11 additions and 23 deletions
|
|
@ -4,7 +4,6 @@ import { useCallback, useState } from 'react'
|
|||
|
||||
import { CampaignHomeActionStrip } from '@/components/campaign/dashboard/CampaignHomeActionStrip'
|
||||
import { Drawer, DrawerContent, DrawerTitle } from '@/components/ui/Drawer'
|
||||
import type { CampaignQuickAction } from '@/lib/campaignQuickActionTypes'
|
||||
import {
|
||||
QUICK_ACTIONS_SNAP_COLLAPSED,
|
||||
QUICK_ACTIONS_SNAP_EXPANDED,
|
||||
|
|
@ -12,6 +11,7 @@ import {
|
|||
quickActionsSnapIsExpanded,
|
||||
type QuickActionsSnapPoint,
|
||||
} from '@/lib/campaignQuickActionSnap'
|
||||
import type { CampaignQuickAction } from '@/lib/campaignQuickActionTypes'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const SNAP_POINTS = [...QUICK_ACTIONS_SNAP_POINTS]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {
|
|||
wizardActionHref,
|
||||
type CampaignWizardActionId,
|
||||
} from '@/lib/campaignActionRoutes'
|
||||
import { homeActionsForRole, toHomeActionButtonProps } from '@/lib/campaignHomeActions'
|
||||
import type { CampaignQuickActionContext } from '@/lib/campaignQuickActionContext'
|
||||
import {
|
||||
ACTIVITY_NEW_PATH,
|
||||
|
|
@ -12,7 +13,6 @@ import {
|
|||
type ActivityQuickActionSurface,
|
||||
} from '@/lib/campaignQuickActionPaths'
|
||||
import type { CampaignQuickAction } from '@/lib/campaignQuickActionTypes'
|
||||
import { homeActionsForRole, toHomeActionButtonProps } from '@/lib/campaignHomeActions'
|
||||
import { isStaffCampaignRole, type CampaignRole } from '@/lib/campaignRoles'
|
||||
|
||||
const WIZARD_ACTION_IDS: readonly CampaignWizardActionId[] = [
|
||||
|
|
@ -110,4 +110,4 @@ export const resolveActivityQuickActions = (
|
|||
}
|
||||
|
||||
return [...wizardActionsWithMunicipalityPrefill(role, municipalitySlug), ...detailActions]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { CAMPAIGN_ACTIONS_HOME } from '@/lib/campaignActionRoutes'
|
||||
import { isActivityTourComposerPath } from '@/lib/campaignQuickActionPaths'
|
||||
import { CAMPAIGN_HOME, LEADER_CONTACTS_HOME } from '@/lib/campaignPaths'
|
||||
import { isActivityTourComposerPath } from '@/lib/campaignQuickActionPaths'
|
||||
import { isStaffCampaignRole, type CampaignRole } from '@/lib/campaignRoles'
|
||||
|
||||
/** Início matches only exactly — same rule as sidebar nav. */
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ export const ACTIVITY_NEW_PATH = '/campanha/atividades/nova' as const
|
|||
|
||||
export const ACTIVITY_TOUR_COMPOSER_PATH = '/campanha/atividades/giros' as const
|
||||
|
||||
export type ActivityQuickActionSurface =
|
||||
| { kind: 'list' }
|
||||
| { kind: 'detail'; activitySlug: string }
|
||||
export type ActivityQuickActionSurface = { kind: 'list' } | { kind: 'detail'; activitySlug: string }
|
||||
|
||||
const normalizePathname = (pathname: string): string =>
|
||||
pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
<<<<<<< HEAD
|
||||
import {
|
||||
resolveStaffHomeQuickActions,
|
||||
type ResolvedCampaignHomeAction,
|
||||
} from '@/lib/campaignHomeActions'
|
||||
import { CAMPAIGN_TERRITORIES_HOME } from '@/lib/campaignPaths'
|
||||
=======
|
||||
import { resolveActivityQuickActions } from '@/lib/activityQuickActions'
|
||||
>>>>>>> ccc5faf (B84 — Ações rápidas na vertical Atividades (lista + detalhe))
|
||||
import { resolveStaffHomeQuickActions } from '@/lib/campaignHomeActions'
|
||||
import type { CampaignQuickActionContext } from '@/lib/campaignQuickActionContext'
|
||||
import { parseActivityQuickActionSurface } from '@/lib/campaignQuickActionPaths'
|
||||
import type { CampaignQuickAction } from '@/lib/campaignQuickActionTypes'
|
||||
import { CAMPAIGN_TERRITORIES_HOME } from '@/lib/campaignPaths'
|
||||
import type { CampaignRole } from '@/lib/campaignRoles'
|
||||
|
||||
const isTerritoriesListPath = (pathname: string): boolean =>
|
||||
|
|
@ -23,13 +17,6 @@ const isTerritoriesListPath = (pathname: string): boolean =>
|
|||
export const resolveQuickActionsForPath = (
|
||||
pathname: string,
|
||||
role: CampaignRole,
|
||||
<<<<<<< HEAD
|
||||
_context: CampaignQuickActionContext,
|
||||
): readonly ResolvedCampaignHomeAction[] => {
|
||||
if (isTerritoriesListPath(pathname)) {
|
||||
return resolveStaffHomeQuickActions(role)
|
||||
}
|
||||
=======
|
||||
context: CampaignQuickActionContext,
|
||||
): readonly CampaignQuickAction[] => {
|
||||
const activitySurface = parseActivityQuickActionSurface(pathname)
|
||||
|
|
@ -37,6 +24,9 @@ export const resolveQuickActionsForPath = (
|
|||
return resolveActivityQuickActions(activitySurface, role, context)
|
||||
}
|
||||
|
||||
>>>>>>> ccc5faf (B84 — Ações rápidas na vertical Atividades (lista + detalhe))
|
||||
if (isTerritoriesListPath(pathname)) {
|
||||
return resolveStaffHomeQuickActions(role)
|
||||
}
|
||||
|
||||
return []
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue