Skip to content

Commit

Permalink
fix(navigation): corrected the description change form [YTFRONT-4083]
Browse files Browse the repository at this point in the history
  • Loading branch information
SimbiozizV authored and ma-efremoff committed Mar 28, 2024
1 parent 14a59b0 commit 93ee0d1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from 'react';

import {DialogControlProps} from '../../components/Dialog/Dialog.types';
import {
EditTextWithPreview,
EditTextWithPreviewProps,
} from '../../components/EditTextWithPreview/EditTextWithPreview';
import {Markdown} from '../../components/Markdown/Markdown';
import {DialogControlProps} from '../Dialog/Dialog.types';
import {EditTextWithPreviewProps, EditTextWithPreviewWithState} from '../EditTextWithPreview';
import {Markdown} from '../Markdown/Markdown';

export type EditAnnotationProps = DialogControlProps<
EditTextWithPreviewProps['value'],
Expand Down Expand Up @@ -82,7 +79,7 @@ export function EditAnnotationWithPreview(props: EditAnnotationProps) {
}

return (
<EditTextWithPreview
<EditTextWithPreviewWithState
className={className}
value={valueProp}
onChange={onChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import cn from 'bem-cn-lite';
import SplitPane from 'react-split-pane';

import {DialogControlProps} from '../../components/Dialog/Dialog.types';
import {DialogControlProps} from '../Dialog/Dialog.types';
import MonacoEditor from '../../components/MonacoEditor';
import Icon from '../../components/Icon/Icon';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, {FC, useState} from 'react';
import {EditTextWithPreview, EditTextWithPreviewProps} from './EditTextWithPreview';

export const EditTextWithPreviewWithState: FC<EditTextWithPreviewProps> = ({
onChange,
value,
...props
}) => {
const [editorValue, setEditorValue] = useState(value);

const handleChange = (newValue: {value: string | undefined}) => {
setEditorValue(newValue);
onChange(newValue);
};

return <EditTextWithPreview {...props} value={editorValue} onChange={handleChange} />;
};
3 changes: 3 additions & 0 deletions packages/ui/src/ui/components/EditTextWithPreview/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export {EditTextWithPreview} from './EditTextWithPreview';
export type {EditTextWithPreviewProps} from './EditTextWithPreview';
export {EditTextWithPreviewWithState} from './EditTextWithPreviewWithState';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ExpandButton: FC<Props> = ({expanded, toggleExpanded}) => {
title={expanded ? 'Collapse' : 'Expand'}
onClick={toggleExpanded}
>
<Icon className={block('expand', {expanded})} data={expandedIcon} />
<Icon className={block('expand', {expanded})} data={expandedIcon} size={16} />
</Button>
);
};

0 comments on commit 93ee0d1

Please # to comment.