For the complete documentation index, see llms.txt. This page is also available as Markdown.

Phase 5: Restriction Status

← Back to Index

Effort: 1 hour Risk: Low Priority: Low Previous: Phase 4: Download Logic Next: Phase 6: Duplicate Index Calls

Goal

Add isCurrentCanvasRestricted to context instead of calculating it in ViewerTopBar.

Why?

  • ViewerTopBar calculates this value

  • Other components might need it too

  • Centralise restriction logic in one place

  • Clear boolean name makes intent obvious

Note: The restricted-images merge added the canonical hasRestrictedItem() helper that should be used for all restriction checks.

Steps

3.1 Add to Context Type

File: content/webapp/contexts/ItemViewerContextV2/index.tsx

type Props = {
  // ... existing ...
  isCurrentCanvasRestricted: boolean;  // Current canvas has restricted access
};

3.2 Calculate in IIIFViewer.refactored.tsx

3.3 Update ViewerTopBar.refactored.tsx

Testing

Success Criteria

Time: ~1 hour


Next: Phase 6: Duplicate Index Calls

Last updated