Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editable text style #6799

Merged
merged 13 commits into from
Feb 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix some types
  • Loading branch information
hotzenklotz committed Feb 1, 2023
commit a6d1e58bb2bf96dc882e28c67f08710fc3b58a44
6 changes: 3 additions & 3 deletions frontend/javascripts/components/text_with_description.tsx
Original file line number Diff line number Diff line change
@@ -4,11 +4,13 @@ import Markdown from "react-remarkable";
import * as React from "react";
import type { EditableTextLabelProp } from "oxalis/view/components/editable_text_label";
import EditableTextLabel from "oxalis/view/components/editable_text_label";

type EditableProps = EditableTextLabelProp & {
isEditable: true;
description: string;
};
type NonEditableProps = {
markdown?: boolean
isEditable: false;
description: string;
value: string;
@@ -61,8 +63,7 @@ class TextWithDescription extends React.PureComponent<Props> {
</Tooltip>
) : null}
</span>
{/* @ts-expect-error ts-migrate(2322) FIXME: Type 'string | null' is not assignable to type 'st... Remove this comment to see the full error message */}
<span className={hasDescription ? "flex-item" : null}>
<span className={hasDescription ? "flex-item" : undefined}>
{isEditable ? (
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
<EditableTextLabel {...editableProps} />
@@ -73,7 +74,6 @@ class TextWithDescription extends React.PureComponent<Props> {
display: "inline-block",
}}
>
{/* @ts-expect-error ts-migrate(2339) FIXME: Property 'markdown' does not exist on type 'Readon... Remove this comment to see the full error message */}
{this.props.markdown ? (
<Markdown
source={this.props.value}