Skip to content

Refactor: Only use Button.tsx#12591

Open
jpye-finch wants to merge 2 commits intodevelopfrom
button-refactor
Open

Refactor: Only use Button.tsx#12591
jpye-finch wants to merge 2 commits intodevelopfrom
button-refactor

Conversation

@jpye-finch
Copy link
Copy Markdown
Contributor

Migrate deprecated button components to Button

Replaces all usages of the deprecated PrimaryButton,
SecondaryButton, TertiaryButton, DangerButton,
SuccessButton, and CircleButton components with the new unified
<Button type="..."> API. FloatingActionButton and LinkButton
are out of scope.

Mapping

Deprecated New
PrimaryButton <Button type="primary">
SecondaryButton <Button type="secondary">
TertiaryButton <Button type="tertiary" size="small">
DangerButton <Button type="negative">
SuccessButton <Button type="positive">
CircleButton <Button type="icon">

Changes

  • 21 files migrated across packages/client and
    packages/login
  • Converted old icon render-prop pattern (icon={() => <Icon />})
    to icon as a child node, consistent with the new API
  • Removed the ConfirmButton component-variable pattern in
    useQuickActionModal — replaced with an inline type conditional
    on a single <Button>
  • Removed PickerButton and StyledPrimaryButton styled-component
    wrappers in DateRangePicker — replaced with <Button> directly at
    both usage sites (DateRangePicker, LocationPicker)
  • Fixed incorrect import path in ReloadModal files
    (@opencrvs/components/src/buttons
    @opencrvs/components/lib/Button)
  • Removed ICON_ALIGNMENT usage from UserEditor (no longer
    needed)

@jpye-finch jpye-finch added this to the 2.1 milestone May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

ℹ️ Coverage metrics explained:
Statements — Executed code statements (basic logic lines)
Branches — Tested decision paths (if/else, switch, ternaries)
Functions — Functions invoked during tests
Lines — Source lines executed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

📊 commons test coverage

Statements: 75.48%
Branches:   39.88%
Functions:  56.85%
Lines:      75.05%
Updated at: Fri, 08 May 2026 14:49:29 GMT

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

📊 events test coverage

Statements: 86.98%
Branches:   84.94%
Functions:  92.08%
Lines:      86.98%
Updated at: Fri, 08 May 2026 14:58:48 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant