Skip to content

Commit

Permalink
1944
Browse files Browse the repository at this point in the history
  • Loading branch information
beganovich committed Aug 1, 2024
1 parent 5fd1a9f commit a5dbf09
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/pages/dashboard/components/PastDueInvoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import { useFormatMoney } from '$app/common/hooks/money/useFormatMoney';
import { DataTable, DataTableColumns } from '$app/components/DataTable';
import { t } from 'i18next';
import { route } from '$app/common/helpers/route';
import { Invoice } from '$app/common/interfaces/invoice';
import { Card } from '$app/components/cards';
Expand All @@ -19,8 +18,10 @@ import { Badge } from '$app/components/Badge';
import { useDisableNavigation } from '$app/common/hooks/useDisableNavigation';
import { useCurrentCompanyDateFormats } from '$app/common/hooks/useCurrentCompanyDateFormats';
import { DynamicLink } from '$app/components/DynamicLink';
import { useTranslation } from 'react-i18next';

export function PastDueInvoices() {
const [t] = useTranslation();
const formatMoney = useFormatMoney();
const { dateFormat } = useCurrentCompanyDateFormats();

Expand Down
3 changes: 2 additions & 1 deletion src/pages/dashboard/components/RecentPayments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import { useFormatMoney } from '$app/common/hooks/money/useFormatMoney';
import { DataTable, DataTableColumns } from '$app/components/DataTable';
import { t } from 'i18next';
import { route } from '$app/common/helpers/route';
import { Payment } from '$app/common/interfaces/payment';
import { Card } from '$app/components/cards';
Expand All @@ -20,8 +19,10 @@ import { date } from '$app/common/helpers';
import { useCurrentCompanyDateFormats } from '$app/common/hooks/useCurrentCompanyDateFormats';
import { useDisableNavigation } from '$app/common/hooks/useDisableNavigation';
import { DynamicLink } from '$app/components/DynamicLink';
import { useTranslation } from 'react-i18next';

export function RecentPayments() {
const [t] = useTranslation();
const formatMoney = useFormatMoney();
const { dateFormat } = useCurrentCompanyDateFormats();

Expand Down
3 changes: 2 additions & 1 deletion src/pages/dashboard/components/UpcomingInvoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import { useFormatMoney } from '$app/common/hooks/money/useFormatMoney';
import { DataTable, DataTableColumns } from '$app/components/DataTable';
import { t } from 'i18next';
import { route } from '$app/common/helpers/route';
import { Invoice } from '$app/common/interfaces/invoice';
import { Card } from '$app/components/cards';
Expand All @@ -19,8 +18,10 @@ import { Badge } from '$app/components/Badge';
import { useDisableNavigation } from '$app/common/hooks/useDisableNavigation';
import { useCurrentCompanyDateFormats } from '$app/common/hooks/useCurrentCompanyDateFormats';
import { DynamicLink } from '$app/components/DynamicLink';
import { useTranslation } from 'react-i18next';

export function UpcomingInvoices() {
const [t] = useTranslation();
const formatMoney = useFormatMoney();

const { dateFormat } = useCurrentCompanyDateFormats();
Expand Down
3 changes: 2 additions & 1 deletion src/pages/dashboard/components/UpcomingRecurringInvoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@

import { useFormatMoney } from '$app/common/hooks/money/useFormatMoney';
import { DataTable, DataTableColumns } from '$app/components/DataTable';
import { t } from 'i18next';
import { route } from '$app/common/helpers/route';
import { Card } from '$app/components/cards';
import { Badge } from '$app/components/Badge';
import { useDisableNavigation } from '$app/common/hooks/useDisableNavigation';
import { DynamicLink } from '$app/components/DynamicLink';
import { RecurringInvoice } from '$app/common/interfaces/recurring-invoice';
import { useDateTime } from '$app/common/hooks/useDateTime';
import { useTranslation } from 'react-i18next';

export function UpcomingRecurringInvoices() {
const [t] = useTranslation();
const dateTime = useDateTime();
const formatMoney = useFormatMoney();
const disableNavigation = useDisableNavigation();
Expand Down
7 changes: 4 additions & 3 deletions src/pages/dashboard/hooks/useGenerateActivityElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { ActivityRecord } from '$app/common/interfaces/activity-record';
import { route } from '$app/common/helpers/route';
import reactStringReplace from 'react-string-replace';
import { Link } from '$app/components/forms';
import { t } from 'i18next';
import { styled } from 'styled-components';
import { useColorScheme } from '$app/common/colors';
import { useTranslation } from 'react-i18next';

const Div = styled.div`
border-color: ${(props) => props.theme.borderColor};
Expand All @@ -26,19 +26,20 @@ const Div = styled.div`
`;

export function useGenerateActivityElement() {
const [t] = useTranslation();
const { dateFormat } = useCurrentCompanyDateFormats();

const generate = (activity: ActivityRecord) => {
let text = trans(`activity_${activity.activity_type_id}`, {});

if(activity.activity_type_id === 10 && activity.contact) {
if (activity.activity_type_id === 10 && activity.contact) {
text = trans(`activity_10_online`, {});
}

if (activity.activity_type_id === 54 && activity.contact) {
text = text.replace(':user', ':contact');
}

const replacements = {
client: (
<Link to={route('/clients/:id', { id: activity.client?.hashed_id })}>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/projects/common/hooks/useInvoiceProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { parseTimeLog } from '$app/pages/tasks/common/helpers/calculate-time';
import { useSetAtom } from 'jotai';
import { useCompanyTimeFormat } from '$app/common/hooks/useCompanyTimeFormat';
import { toast } from '$app/common/helpers/toast/toast';
import { t } from 'i18next';
import { useTranslation } from 'react-i18next';

export const calculateTaskHours = (timeLog: string) => {
const parsedTimeLogs = parseTimeLog(timeLog);
Expand All @@ -49,6 +49,7 @@ export const calculateTaskHours = (timeLog: string) => {
};

export function useInvoiceProject() {
const [t] = useTranslation();
const navigate = useNavigate();
const company = useCurrentCompany();

Expand Down
2 changes: 1 addition & 1 deletion src/pages/reports/common/components/SortableColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
import { cloneDeep } from 'lodash';
import { Record, clientMap } from '$app/common/constants/exports/client-map';
import { paymentMap } from '$app/common/constants/exports/payment-map';
import { t } from 'i18next';
import { quoteMap } from '$app/common/constants/exports/quote-map';
import { creditMap } from '$app/common/constants/exports/credit-map';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -265,6 +264,7 @@ export function useColumns({ report, columns }: Props) {
}

export function SortableColumns({ report, columns }: Props) {
const [t] = useTranslation();
const { update } = usePreferences();
const { data, defaultColumns } = useColumns({ report, columns });

Expand Down
3 changes: 2 additions & 1 deletion src/pages/tasks/common/hooks/useAddTasksOnInvoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ import {
import { route } from '$app/common/helpers/route';
import { Task } from '$app/common/interfaces/task';
import { useCurrentCompany } from '$app/common/hooks/useCurrentCompany';
import { t } from 'i18next';
import { cloneDeep } from 'lodash';
import { useTranslation } from 'react-i18next';

interface Params {
tasks: Task[];
}

export function useAddTasksOnInvoice(params: Params) {
const [t] = useTranslation();
const navigate = useNavigate();

const { tasks } = params;
Expand Down

0 comments on commit a5dbf09

Please sign in to comment.