From 905e9e2d13793c18df3c2afe44c5a7ea204139aa Mon Sep 17 00:00:00 2001 From: Matthew Curtis Date: Mon, 21 Oct 2024 12:12:01 -0500 Subject: [PATCH 1/2] remove fake-react-native text --- .../src/fake-react-native-web/index.ts | 1 - .../src/fake-react-native-web/text.tsx | 55 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 packages/math-input/src/fake-react-native-web/text.tsx diff --git a/packages/math-input/src/fake-react-native-web/index.ts b/packages/math-input/src/fake-react-native-web/index.ts index 5c52ca560d..7eaa38810f 100644 --- a/packages/math-input/src/fake-react-native-web/index.ts +++ b/packages/math-input/src/fake-react-native-web/index.ts @@ -7,5 +7,4 @@ * StyleSheets instead. */ -export {default as Text} from "./text"; export {default as View} from "./view"; diff --git a/packages/math-input/src/fake-react-native-web/text.tsx b/packages/math-input/src/fake-react-native-web/text.tsx deleted file mode 100644 index f723b4e9fb..0000000000 --- a/packages/math-input/src/fake-react-native-web/text.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import {StyleSheet, css} from "aphrodite"; -import * as React from "react"; - -import type {StyleType} from "@khanacademy/wonder-blocks-core"; -import type {CSSProperties} from "aphrodite"; - -type Props = { - children: React.ReactNode; - // The `dynamicStyle` prop is provided for animating dynamic - // properties, as creating Aphrodite StyleSheets in animation loops is - // expensive. `dynamicStyle` should be a raw style object, rather than - // a StyleSheet. - dynamicStyle?: CSSProperties; - numberOfLines?: number; - style?: StyleType; -}; - -class Text extends React.Component { - render(): React.ReactNode { - const {numberOfLines, style} = this.props; - - const className = css( - styles.initial, - ...(Array.isArray(style) ? style : [style]), - numberOfLines === 1 && styles.singleLineStyle, - ); - - return ( - - {this.props.children} - - ); - } -} - -// https://github.com/necolas/react-native-web/blob/master/src/components/Text/index.js -const styles = StyleSheet.create({ - initial: { - color: "inherit", - display: "inline", - font: "inherit", - margin: 0, - padding: 0, - textDecorationLine: "none", - wordWrap: "break-word", - }, - singleLineStyle: { - maxWidth: "100%", - overflow: "hidden", - textOverflow: "ellipsis", - whiteSpace: "nowrap", - }, -}); - -export default Text; From 51822e942ebb47c0996c213101b2de181539801e Mon Sep 17 00:00:00 2001 From: Matthew Curtis Date: Mon, 21 Oct 2024 14:32:06 -0500 Subject: [PATCH 2/2] changeset --- .changeset/curvy-rules-fix.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/curvy-rules-fix.md diff --git a/.changeset/curvy-rules-fix.md b/.changeset/curvy-rules-fix.md new file mode 100644 index 0000000000..cbc1510695 --- /dev/null +++ b/.changeset/curvy-rules-fix.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/math-input": patch +--- + +Remove unused fake-react-native Text component