Skip to content

Migrate styled-jsx to CSS Modules #128

@tmshv

Description

@tmshv

Problems

6 components use <style jsx> which requires 'use client' in Next.js 15 and is inconsistent with the rest of the codebase (CSS Modules). Migrate all to CSS Modules.

Files to migrate

  • src/components/UnitHighlight/index.tsx
  • src/components/Button/index.tsx
  • src/components/Z1/index.tsx
  • src/components/UnitCanvas/index.tsx
  • src/special/heterotopia/Highlight.tsx
  • src/special/heterotopia/Title.tsx

Additional: rewrite UnitCanvas as functional component

UnitCanvas is the only class component in the project. While migrating its styles, also:

  • Rewrite as functional component with useRef/useEffect
  • Add null guards for canvas and context (currently uses non-null assertions)
  • Clear stopTimeout in cleanup to fix timer leak
  • Add 'use client' directive

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions