Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/citizen-pwa/src/App.routes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ vi.mock('./components/MapTab/index.js', () => ({
MapTab: () => <div>Map tab</div>,
}))

vi.mock('./components/SubmitReportForm.js', () => ({
vi.mock('./components/SubmitReportForm/index.js', () => ({
SubmitReportForm: () => <div>Report form</div>,
}))

Expand Down Expand Up @@ -41,10 +41,11 @@ describe('App routes', () => {
expect(screen.getByRole('button', { name: /map/i })).toHaveAttribute('aria-current', 'page')
})

it('shows the report shell at /report', async () => {
it('shows the report form at /report', async () => {
await renderAppAt('/report')
expect(screen.getByText('Report form')).toBeInTheDocument()
expect(screen.getByRole('button', { name: /report/i })).toHaveAttribute('aria-current', 'page')
expect(screen.queryByRole('banner')).not.toBeInTheDocument()
expect(screen.queryByRole('navigation', { name: /main navigation/i })).not.toBeInTheDocument()
})
Comment thread
coderabbitai[bot] marked this conversation as resolved.

it('navigates between shell tabs', async () => {
Expand Down
29 changes: 13 additions & 16 deletions apps/citizen-pwa/src/components/CitizenShell.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { ReactNode } from 'react'
import { useLocation, useNavigate } from 'react-router-dom'
import { Map, Rss, AlertTriangle, Bell, User } from 'lucide-react'
import '../styles/design-tokens.css'

const TABS = [
{ label: 'Map', path: '/' },
{ label: 'Feed', path: '/feed' },
{ label: 'Report', path: '/report' },
{ label: 'Alerts', path: '/alerts' },
{ label: 'Profile', path: '/profile' },
{ label: 'Map', path: '/', Icon: Map },
{ label: 'Feed', path: '/feed', Icon: Rss },
{ label: 'Report', path: '/report', Icon: AlertTriangle },
{ label: 'Alerts', path: '/alerts', Icon: Bell },
{ label: 'Profile', path: '/profile', Icon: User },
] as const

export function CitizenShell({ children }: { children: ReactNode }) {
Expand Down Expand Up @@ -80,17 +81,13 @@ export function CitizenShell({ children }: { children: ReactNode }) {
cursor: 'pointer',
}}
>
<span style={{ fontSize: '1.25rem', lineHeight: 1 }}>
{tab.label === 'Report'
? '🚨'
: tab.label === 'Alerts'
? '⚠️'
: tab.label === 'Profile'
? '👤'
: tab.label === 'Feed'
? '📋'
: '🗺'}
</span>
<tab.Icon
size={20}
strokeWidth={pathname === tab.path ? 2.5 : 2}
color={
pathname === tab.path ? 'var(--color-primary)' : 'var(--color-on-surface-variant)'
}
/>
{tab.label}
</button>
))}
Expand Down
245 changes: 0 additions & 245 deletions apps/citizen-pwa/src/components/SubmitReportForm.tsx

This file was deleted.

Loading
Loading