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

Iris 3052 typescript conversition #177

Merged
merged 23 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
40efa95
chore: progress save
gnekoz Jul 29, 2022
e40cd4a
chore: progress save
gnekoz Aug 1, 2022
2716509
chore: saving progress
geeky-abhishek Aug 1, 2022
bdf0b0d
chore: progress save
gnekoz Aug 3, 2022
b9d0588
Merge remote-tracking branch 'origin' into refactored_design_system_i…
gnekoz Aug 3, 2022
d64595d
chore: progress save
gnekoz Aug 3, 2022
5f59f09
chore: saving progress
geeky-abhishek Aug 4, 2022
12797b9
Merge remote-tracking branch 'origin' into refactored_design_system_i…
gnekoz Aug 5, 2022
b8d6f6c
chore: saving progress
geeky-abhishek Aug 8, 2022
89617f3
Merge remote-tracking branch 'origin/refactored_design_system_integra…
geeky-abhishek Aug 8, 2022
5c8239a
chore: merge updates from devel
gnekoz Aug 10, 2022
63b472e
Merge remote-tracking branch 'origin/fix_share_folder_information' in…
gnekoz Aug 10, 2022
7cde266
chore: merge updates from fix_share_folder_information
gnekoz Aug 10, 2022
2f5df50
chore: saving progress
geeky-abhishek Aug 16, 2022
a05219b
chore: sync with design system refactor branch
geeky-abhishek Aug 16, 2022
3a92036
fix: fixing types
geeky-abhishek Aug 16, 2022
ad46e14
chore: saving progress
geeky-abhishek Aug 17, 2022
c6220c1
chore: dependencies updated
gnekoz Sep 2, 2022
42a3478
chore: progress save
gnekoz Sep 12, 2022
631b5d6
chore: progress save
gnekoz Sep 13, 2022
42969d2
chore: progress save
gnekoz Sep 13, 2022
15715d4
chore: progress save
gnekoz Sep 13, 2022
7ddd677
Merge branch 'devel' into IRIS-3052_typescript_conversition
giuliano176 Sep 20, 2022
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
1 change: 1 addition & 0 deletions .idea/jsLinters/eslint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 16 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 9 additions & 16 deletions src/commons/actions-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { noop } from 'lodash';
import React, { createContext, FC, SyntheticEvent, useCallback, useContext, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import {
useIntegratedComponent,
Expand All @@ -19,12 +19,13 @@ import { Conversation, MailMessage } from '../types';

type ACPProps = {
folderId: string;
isConversation?: boolean;
};

type ActionObj = {
id: string;
label: string;
click: (event: SyntheticEvent<HTMLElement, Event> | KeyboardEvent) => void;
click: (event: MouseEvent) => void;
icon: string;
};

Expand All @@ -44,7 +45,6 @@ export const ActionsContext = createContext<{
});

export const ActionsContextProvider: FC<ACPProps> = ({ children, folderId }) => {
const [t] = useTranslation();
const dispatch = useDispatch();
const createSnackbar = useContext(SnackbarManagerContext);
const createModal = useContext(ModalManagerContext);
Expand All @@ -53,33 +53,26 @@ export const ActionsContextProvider: FC<ACPProps> = ({ children, folderId }) =>
const timezone = useMemo(() => settings?.prefs.zimbraPrefTimeZoneId, [settings]);
const tags = useTags();

const [ContactInput, integrationAvailable] = useIntegratedComponent('contact-input');
const [ContactInput] = useIntegratedComponent('contact-input');

const [conversationActionsCallback, messageActionsCallback] = useMemo(
() => [
conversationActions({
folderId,
t,
dispatch,
createSnackbar,
createModal,
ContactInput,
tags,
account
account,
deselectAll: noop
}),
messageActions({
folderId,
t,
dispatch,
createSnackbar,
createModal,
ContactInput,
timezone,
account,
tags
tags,
deselectAll: noop
})
],
[folderId, t, dispatch, createSnackbar, createModal, ContactInput, tags, account, timezone]
[folderId, dispatch, tags, account]
);
const getMessageActions = useCallback<GetMsgActionsFunction>(
(item: MailMessage, closeEditor: boolean): [ActionList, ActionList] =>
Expand Down
Loading