Skip to content

Commit

Permalink
Remove the legacy keypad and replace it with MobileKeypad (#825)
Browse files Browse the repository at this point in the history
## Summary:
Previously, the KeypadSwitch component let you toggle between the new
and old keypads. Now we always use the new keypad.

Issue: https://khanacademy.atlassian.net/browse/LC-739

Test plan:

`yarn test`

Author: benchristel

Reviewers: benchristel, handeyeco

Required Reviewers:

Approved By: handeyeco

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage, ✅ Publish npm snapshot (ubuntu-latest, 16.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Cypress (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 16.x), ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ gerald, ✅ Publish Storybook to Chromatic (ubuntu-latest, 16.x)

Pull Request URL: #825
  • Loading branch information
benchristel authored Nov 29, 2023
1 parent 427ea07 commit 7cb40e4
Show file tree
Hide file tree
Showing 95 changed files with 286 additions and 6,934 deletions.
11 changes: 11 additions & 0 deletions .changeset/funny-carrots-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@khanacademy/math-input": major
"@khanacademy/perseus": major
---

We've removed the deprecated `useV2Keypad` prop from the MobileKeypad component.

The V2 keypad is now the default, and the old keypad has been removed.

Additionally, the mobile keypad no longer accepts the `keypadActive` or
`setKeypadActive` props. It now gets those values itself from the `KeypadContext`.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import React, {useState} from "react";

import {KeypadType} from "../../enums";
import MathInput from "../input/math-input";
import {MobileKeypad} from "../keypad";
import {KeypadContext, StatefulKeypadContextProvider} from "../keypad-context";
import KeypadSwitch from "../keypad-switch";

import type {KeypadConfiguration} from "../../types";

Expand Down Expand Up @@ -60,11 +60,10 @@ function KeypadWithContext() {
<KeypadContext.Consumer>
{({setKeypadElement}) => {
return (
<KeypadSwitch
<MobileKeypad
onElementMounted={setKeypadElement}
onDismiss={() => {}}
onAnalyticsEvent={async () => {}}
useV2Keypad
/>
);
}}
Expand Down
Loading

0 comments on commit 7cb40e4

Please sign in to comment.