-
Notifications
You must be signed in to change notification settings - Fork 6
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: long headers values #76
Conversation
Preview is ready. |
src/lib/kit/components/Card/Card.tsx
Outdated
@@ -24,6 +24,9 @@ export interface CardProps { | |||
checkEmptyBody?: boolean; | |||
} | |||
|
|||
const POPOVER_PLACEMENT: PopoverProps['placement'] = ['bottom', 'top']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a separate file of constants you need to take out there
src/lib/kit/components/Card/Card.tsx
Outdated
@@ -112,7 +120,9 @@ export const Card: React.FC<CardProps> = ({ | |||
className={b('header', {interactive: Boolean(handleHeaderToggle)})} | |||
onClick={handleHeaderToggle} | |||
> | |||
<div className={b('header-left')}>{title}</div> | |||
<div ref={titleRef} className={b('header-left')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LayoutProps, | ||
Spec, | ||
ViewLayoutProps, | ||
type FieldRenderProps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not change code that is not related to the current task
@@ -27,6 +28,9 @@ interface SectionProps { | |||
descriptionAsSubtitle?: boolean; | |||
} | |||
|
|||
const POPOVER_PLACEMENT: PopoverProps['placement'] = ['bottom', 'top']; | |||
const MAX_TITLE_WIDTH = 533; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to common constants
@@ -76,15 +81,26 @@ const SectionBase = <D extends FieldValue, T extends FormValue, S extends Spec>( | |||
} | |||
} | |||
|
|||
const layoutTitle = spec.viewSpec.layoutTitle; | |||
const layoutTitlePopoverDisabled = (titleRef.current?.offsetWidth || 0) < MAX_TITLE_WIDTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qa={`${name}-accordeon-toggler`} | ||
width="auto" | ||
> | ||
{' '} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the extra space
@@ -9,6 +9,8 @@ import './MultiSelectView.scss'; | |||
|
|||
const b = block('multiselect-view'); | |||
|
|||
const POPOVER_PLACEMENT: PopoverProps['placement'] = ['bottom', 'top']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes do not apply to the current task, you should remove them, if you want to change imports and parameters, it is better to do it in a separate task
@@ -10,14 +10,16 @@ import './NumberWithScaleView.scss'; | |||
|
|||
const b = block('number-with-scale-view'); | |||
|
|||
const POPOVER_PLACEMENT: PopoverProps['placement'] = ['bottom', 'top']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes do not apply to the current task, you should remove them, if you want to change imports and parameters, it is better to do it in a separate task
@@ -97,19 +101,38 @@ export class SimpleVerticalAccordeon extends React.Component< | |||
return null; | |||
} | |||
|
|||
const title = this.getTitle(); | |||
const titlePopoverDisabled = | |||
(this.titleRef.current?.offsetWidth || 0) < MAX_TITLE_TEXT_WIDTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const titlePopoverDisabled = (this.titleRef.current?.offsetWidth || 0) <= MAX_TITLE_TEXT_WIDTH;
src/lib/kit/components/Card/Card.tsx
Outdated
@@ -66,22 +70,26 @@ export const Card: React.FC<CardProps> = ({ | |||
[], | |||
); | |||
|
|||
const titlePopoverDisabled = (titleRef.current?.offsetWidth || 0) < MAX_TITLE_WIDTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const titlePopoverDisabled =
(this.titleRef.current?.offsetWidth || 0) <= MAX_TITLE_TEXT_WIDTH;
Fix long headers value with ellipsis
Before
After