Skip to content

Commit

Permalink
clean up info-tip (#1484)
Browse files Browse the repository at this point in the history
* clean up info-tip

* changeset
  • Loading branch information
handeyeco authored Aug 5, 2024
1 parent 653b520 commit 8089560
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .changeset/silly-ears-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/perseus": patch
"@khanacademy/perseus-editor": patch
---

Minor cleanup around InfoTip
3 changes: 0 additions & 3 deletions packages/perseus-editor/src/widgets/cs-program-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@ class CSProgramEditor extends React.Component<any> {
pairs={this.props.settings}
onChange={this._handleSettingsChange}
/>
{/* InfoTip is complaining about <code> not being a string
or React.ReactElement even though it should be valid.
@ts-expect-error - TS2769 - No overload matches this call. */}
<InfoTip>
Settings that you add here are available to the program
as an object returned by <code>Program.settings()</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export const TextOnMouseover = (args: StoryArgs): React.ReactElement => {

export const CodeInText = (args: StoryArgs): React.ReactElement => {
return (
// InfoTip is complaining about <code> not being a string
// or React.ReactElement even though it should be valid.
// @ts-expect-error - TS2769 - No overload matches this call.
<InfoTip>
Settings that you add here are available to the program as an object
returned by <code>Program.settings()</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import * as React from "react";

import ReactComponentsInfoTip from "./info-tip/info-tip";
import InfoTipBase from "./info-tip-base";

import type {PropsFor} from "@khanacademy/wonder-blocks-core";

type Props = PropsFor<typeof ReactComponentsInfoTip>;
type Props = PropsFor<typeof InfoTipBase>;

type State = {
didMount: boolean;
Expand All @@ -30,7 +30,7 @@ class InfoTip extends React.Component<Props, State> {

render(): React.ReactNode {
if (this.state.didMount) {
return <ReactComponentsInfoTip {...this.props} />;
return <InfoTipBase {...this.props} />;
}
return <div />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {StyleSheet} from "aphrodite";
import * as React from "react";

type Props = {
children: string | React.ReactElement | React.ReactElement[];
children: React.ReactNode;
};

export const InfoTip = (props: Props) => {
const InfoTipBase = (props: Props) => {
return (
<Tooltip
content={<Body style={styles.body}>{props.children}</Body>}
Expand All @@ -34,4 +34,4 @@ const styles = StyleSheet.create({
},
});

export default InfoTip;
export default InfoTipBase;

0 comments on commit 8089560

Please sign in to comment.