Skip to content

Tooltip not working in Next.js + Mantine #205

@YunusEmreAlps

Description

@YunusEmreAlps

Hello,

I hope you're well and everything is good with you.

I'm using this library with mantine + next.js. Everything working good but tooltip feature not working. How can I activate this feature in my code?

               <CalendarHeatmap
                  startDate={
                    currentYear.startDate
                  }
                  endDate={
                    currentYear.endDate
                  }
                  values={
                    pastShellsbyDate && pastShellsbyDate?.length > 0
                      ? pastShellsbyDate?.map((s: any) => {
                          return {
                            date: moment(s?.started_at).isValid()
                              ? moment(s?.started_at).format("YYYY-MM-DD")
                              : moment().format("YYYY-MM-DD"),
                            count: s?.shells?.length ?? 1,
                          };
                        })
                      : []
                  }
                  showWeekdayLabels={false}
                  tooltipDataAttrs={(value: any) => {
                    return {
                      "data-tip": `${value.date} has count: ${value.count}`,
                    };
                  }}
                  showOutOfRangeDays={true}
                  classForValue	={(value: any) => {
                    if (!value) {
                      return "color-empty";
                    } else if (value.count < 4) {
                      return `color-gitlab-${value.count}`;
                    } else {
                      return `color-gitlab-4`;
                    }
                  }}
                  monthLabels	= {[
                    tp("january_short"),
                    tp("february_short"),
                    tp("march_short"),
                    tp("april_short"),
                    tp("may_short"),
                    tp("june_short"),
                    tp("july_short"),
                    tp("august_short"),
                    tp("september_short"),
                    tp("october_short"),
                    tp("november_short"),
                    tp("december_short"),
                  ]}
                />

Thank you very much.
Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions