-
-
Notifications
You must be signed in to change notification settings - Fork 579
Expand file tree
/
Copy pathVerseActionTranslationsSettings.tsx
More file actions
44 lines (38 loc) · 1.32 KB
/
VerseActionTranslationsSettings.tsx
File metadata and controls
44 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import useTranslation from 'next-translate/useTranslation';
import { useDispatch } from 'react-redux';
import IconContainer, { IconColor, IconSize } from '@/dls/IconContainer/IconContainer';
import PopoverMenu from '@/dls/PopoverMenu/PopoverMenu';
import TranslationsIcon from '@/icons/translation.svg';
import { setIsSettingsDrawerOpen, setSettingsView, SettingsView } from '@/redux/slices/navbar';
type VerseActionTranslationsSettingsProps = {
onActionTriggered?: () => void;
};
const VerseActionTranslationsSettings = ({
onActionTriggered,
}: VerseActionTranslationsSettingsProps) => {
const { t } = useTranslation('common');
const dispatch = useDispatch();
// Open the settings drawer and navigate to the Translations settings view
const onTranslationsSettingsClick = () => {
dispatch(setSettingsView(SettingsView.Translation));
dispatch(setIsSettingsDrawerOpen(true));
onActionTriggered?.();
};
return (
<PopoverMenu.Item
icon={
<IconContainer
icon={<TranslationsIcon />}
color={IconColor.tertiary}
size={IconSize.Custom}
shouldFlipOnRTL={false}
/>
}
onClick={onTranslationsSettingsClick}
shouldCloseMenuAfterClick
>
{t('translations')}
</PopoverMenu.Item>
);
};
export default VerseActionTranslationsSettings;