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

feat(react-scheduler): redesign AppointmentTooltip #2474

Merged
merged 35 commits into from
Oct 25, 2019

Conversation

AryamnovEugeniy
Copy link
Contributor

@AryamnovEugeniy AryamnovEugeniy commented Oct 22, 2019

Before:

image image

After:

image image
image

BREAKING CHANGE:
We have extended the headerComponent and contentComponent in the AppointmentTooltip plugin with new properties. If you use these components, add the following properties in your code:

...
<AppointmentTooltip
  headerComponent={({
+  commandButtonComponent
+  showOpenButton
+  showCloseButton
+  showDeleteButton
+  commandBottonIds
     ...restProps
  }) => (
    <AppointmentTooltip.Header
+      commandButtonComponent={commandButtonComponent}
+      showOpenButton={showOpenButton}
+      showCloseButton={showCloseButton}
+      showDeleteButton={showDeleteButton}
+      commandBottonIds={commandBottonIds}
       {...restProps}
    />
  )}
contentComponent={({
+   formatDate
     ...restProps
  }) => (
    <AppointmentTooltip.Content
+      formatDate={formatDate}
       {...restProps}
    />
  )}
/>
...

@AryamnovEugeniy
Copy link
Contributor Author

FPR

@MaximKudriavtsev
Copy link
Contributor

Can we add a padding top (or something else)? I think 2px would enough
image

Comment on lines 26 to 34
const Header = withStyles(style, { name: 'Header' })(({
children, appointmentData, classes, ...restProps
}) => (
<AppointmentTooltip.Header
{...restProps}
className={classes.header}
>
<span role="img" aria-label="Clock" className={classes.icon}>🕒</span>
<div className={classes.title}>
{appointmentData.title}
</div>
<AppointmentTooltip.Header {...restProps}>
{/* eslint-disable-next-line no-alert */}
<IconButton onClick={() => alert(JSON.stringify(appointmentData))}>
<MoreIcon />
</IconButton>
</AppointmentTooltip.Header>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use withStyles here? And why we should not pass appointmentData property farther?

Comment on lines 54 to 55
/** A React node used to render the tooltip header. */
children?: React.ReactNode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A React node used to render the additional part into tooltip header.

@AryamnovEugeniy
Copy link
Contributor Author

FPR

paddingLeft: spacing(1),
paddingRight: spacing(0.5),
paddingTop: spacing(0.25),
minHeight: spacing(3),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minHeight: spacing(3) -> minHeight: spacing(1.5), // 12 px would be better

@AryamnovEugeniy
Copy link
Contributor Author

FPR

@AryamnovEugeniy
Copy link
Contributor Author

FPR

@@ -64,22 +65,30 @@ showDeleteButton | boolean | Specifies the Delete button's visibility.
commandButtonIds | Array&lt;string&gt; | A command button's identifier list.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The command button", if you are talking about a specific button.

onHide?: () => void;
/** A component that renders a command button. */
commandButtonComponent: React.ComponentType<AppointmentTooltip.CommandButtonProps>;
/** A React node used to render the additional part of the tooltip header. */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's only one additional part? If there can be different parts, use "an additional part".

formatDate: FormatterFn;
/** A component that renders an icon for recurring appointments inside the AppointmentTooltip. */
recurringIconComponent: React.ComponentType<object>;
/** A React node used to render the additional part of the tooltip content. */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the previous comment.

@AryamnovEugeniy AryamnovEugeniy merged commit 41b8f28 into DevExpress:master Oct 25, 2019
@AryamnovEugeniy AryamnovEugeniy deleted the tooltip branch October 25, 2019 11:46
@boboci9
Copy link

boboci9 commented Aug 4, 2020

Hi, Is there a way to remove the default tooltipcontent?
I have my own tooltip content designed with different icons based on the appointment type etc. Can disable the default appointmentcontent in this case?
Screen Shot 2020-08-04 at 2 06 35 PM

<AppointmentTooltip {...(props.tooltipContent ? { contentComponent: props.tooltipContent } : null)} headerComponent={() => <></>} visible={props.tooltipVisible} showOpenButton onVisibilityChange={props.toggleTooltipVisibility} showCloseButton />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants