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

Styled tooltips for the project badges #254

Merged
merged 1 commit into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
import React from 'react';
import { t } from '../../../../utils';
import { TimesheetBadgeProps } from './TimesheetBadge';
import {t} from '../../../../utils';
import {TimesheetBadgeProps} from './TimesheetBadge';

import './InboundBadge.scss';
import {Tooltip} from "../../../../controls/Tooltip";

const AllInboundPaidBadge = (
<span className="badge rounded-pill text-white bg-success">
<i className="fa fa-inbox fa-1x" />
<i className="fa fa-inbox fa-1x"/>
{t('projectMonth.list.inboundAllPaid')}
</span>
);


/** ProjectMonth closed month Inbound badge */
export const InboundBadge = ({ pending, totals }: TimesheetBadgeProps) => {
export const InboundBadge = ({pending, totals}: TimesheetBadgeProps) => {
if (!pending) {
return AllInboundPaidBadge;
}

return (
<span className="badge rounded-pill bg-warning inbound-badges">
<i
className="fa fa-inbox fa-1x"
title={totals.inboundNew && `<b>${t('projectMonth.inboundNew')}</b><br>${totals.inboundNew}`}
>
<span>{totals.inboundNewCount}</span>
</i>
<Tooltip title={totals.inboundNew && `<b>${t('projectMonth.inboundNew')}</b><br>${totals.inboundNew}`}>
<i className="fa fa-inbox fa-1x">
<span>{totals.inboundNewCount}</span>
</i>
</Tooltip>

<i
className="fa fa-check fa-1x"
title={totals.inboundValidated && `<b>${t('projectMonth.inboundValidated')}</b><br>${totals.inboundValidated}`}
>
<span>{totals.inboundValidatedCount}</span>
</i>
<Tooltip
title={totals.inboundValidated && `<b>${t('projectMonth.inboundValidated')}</b><br>${totals.inboundValidated}`}>
<i className="fa fa-check fa-1x">
<span>{totals.inboundValidatedCount}</span>
</i>
</Tooltip>

<i
className="fa fa-coins fa-1x"
title={totals.inboundPaid && `<b>${t('projectMonth.inboundPaid')}</b><br>${totals.inboundPaid}`}
>
<Tooltip
title={totals.inboundPaid && `<b>${t('projectMonth.inboundPaid')}</b><br>${totals.inboundPaid}`}>
<i className="fa fa-coins fa-1x">
<span>{totals.inboundPaidCount}</span>
</i>
</i>
</Tooltip>
</span>
)
};
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { t } from '../../../../utils';
import { ProjectMonthBadgeTotals } from "../ProjectMonthBadgeTotals";
import {Tooltip} from "../../../../controls/Tooltip";

/** ProjectMonth closed month Outbound badge */
export const OutboundBadge = ({ totals }: { totals: ProjectMonthBadgeTotals; }) => {
return (
<span
className="badge rounded-pill bg-warning"
title={`<b>${t('projectMonth.outboundPaid')}</b><br>` + totals.unverified}
>
<i className="fa fa-coins fa-1x" />
{t('projectMonth.list.verifiedBadge', {verified: totals.verified, total: totals.total})}
</span>
<Tooltip title={`<b>${t('projectMonth.outboundPaid')}</b><br>` + totals.unverified}>
<span className="badge rounded-pill bg-warning">
<i className="fa fa-coins fa-1x" />
{t('projectMonth.list.verifiedBadge', {verified: totals.verified, total: totals.total})}
</span>
</Tooltip>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { t } from '../../../../utils';
import { ProjectMonthBadgeTotals } from "../ProjectMonthBadgeTotals";
import {Tooltip} from "../../../../controls/Tooltip";

export type TimesheetBadgeProps = {
pending: boolean;
Expand All @@ -22,9 +23,11 @@ export const TimesheetBadge = ({ pending, totals }: TimesheetBadgeProps) => {
}

return (
<span className="badge rounded-pill bg-warning">
<i className="fa fa-clock fa-1x" title={`<b>${t('projectMonth.timesheetValidated')}</b><br>` + totals.timesheetPending} />
{t('projectMonth.list.timesheetPending', {timesheetPendingCount: totals.timesheetPendingCount})}
</span>
<Tooltip title={`<b>${t('projectMonth.timesheetValidated')}</b><br>` + totals.timesheetPending}>
<span className="badge rounded-pill bg-warning">
<i className="fa fa-clock fa-1x" />
{t('projectMonth.list.timesheetPending', {timesheetPendingCount: totals.timesheetPendingCount})}
</span>
</Tooltip>
);
};