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

Jmafoster1/237 consistent footer behaviour #698

Merged
merged 3 commits into from
Feb 3, 2025
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
2 changes: 2 additions & 0 deletions src/Hooks/useLoadSupportedLanguages.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";

import axios from "axios";
import { loadLanguages } from "redux/reducers/languageSupportReducer";

import { ROLES } from "../constants/roles";

const useLoadSupportedLanguage = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Typography from "@mui/material/Typography";
import HelpOutlineOutlinedIcon from "@mui/icons-material/HelpOutlineOutlined";

import { DataGrid, getGridSingleSelectOperators } from "@mui/x-data-grid";

import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace";

import useMyStyles from "../../../Shared/MaterialUiStyles/useMyStyles";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Typography from "@mui/material/Typography";
import HelpOutlineOutlinedIcon from "@mui/icons-material/HelpOutlineOutlined";

import { styled } from "@mui/system";

import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace";
import { v4 as uuidv4 } from "uuid";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Typography from "@mui/material/Typography";

import { ExpandLessOutlined, ExpandMoreOutlined } from "@mui/icons-material";

import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace";

import { TextCopy } from "../../../Shared/Utils/TextCopy";
import { Translate } from "../../../Shared/Utils/Translate";
import { getLanguageName } from "../../../Shared/Utils/languageUtils";
Expand All @@ -24,6 +26,7 @@ export default function TextFooter({
setExpanded,
expanded,
}) {
const keyword = i18nLoadNamespace("components/Shared/utils");
return (
<Box>
<Divider />
Expand All @@ -41,12 +44,20 @@ export default function TextFooter({

{/* copy to clipboard */}
<Grid2 size={{ xs: 1 }} align={"right"} display="flex" pt={1.5}>
<TextCopy text={text} index={text} />
<Tooltip title={keyword("copy_to_clipboard")}>
<div>
<TextCopy text={text} index={text} />
</div>
</Tooltip>
</Grid2>

{/* translate */}
<Grid2 size={{ xs: 1 }} align={"right"} display="flex" pt={2}>
<Translate text={text} />
<Tooltip title={keyword("translate")}>
<div>
<Translate text={text} />
</div>
</Tooltip>
</Grid2>

{/* expand/minimise text */}
Expand Down Expand Up @@ -127,7 +138,7 @@ export function ExpandMinimise({
expanded,
}) {
return (
<Tooltip title={expandMinimiseText}>
<Tooltip title={expandMinimiseText} sx={{ cursor: "pointer" }}>
{displayExpander ? (
expanded ? (
<ExpandLessOutlined
Expand Down
10 changes: 7 additions & 3 deletions src/components/NavItems/tools/Alltools/ToolsMenuItem.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import React, { useState } from "react";
import { useSelector } from "react-redux";

import { Box, Grid2, Typography } from "@mui/material/";

import FiberNewIcon from "@mui/icons-material/FiberNew";
import AuthenticationIcon from "./AdvancedTools/AuthenticationIcon";
import ImprovedIcon from "../../../NavBar/images/SVG/Improved.svg";
import ScienceIcon from "@mui/icons-material/Science";

import { i18nLoadNamespace } from "@Shared/Languages/i18nLoadNamespace";
import { useSelector } from "react-redux";

import ImprovedIcon from "../../../NavBar/images/SVG/Improved.svg";
import AuthenticationIcon from "./AdvancedTools/AuthenticationIcon";

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";

import { i18nLoadNamespace } from "../../../../Shared/Languages/i18nLoadNamespace";
import UrlArchive from "./urlArchive";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import Iframe from "react-iframe";

import Box from "@mui/material/Box";

const LocalFile = () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/Shared/MaterialUiStyles/useMyStyles.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { green } from "@mui/material/colors";

import useClasses from "./useClasses";

const drawerWidthOpen = 300;
Expand Down
5 changes: 5 additions & 0 deletions src/components/Shared/Utils/TextCopy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export const TextCopy = ({ text, index, type }) => {
</Button>
) : (
<IconButton
sx={{
"&:hover": {
backgroundColor: "inherit",
},
}}
onClick={() => {
copyText(text);
setTooltipIndex(index);
Expand Down
9 changes: 8 additions & 1 deletion src/components/Shared/Utils/Translate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ export const Translate = ({ text, type }) => {
{keyword("translate")}
</Button>
) : (
<IconButton onClick={() => googleTranslate(text)}>
<IconButton
onClick={() => googleTranslate(text)}
sx={{
"&:hover": {
backgroundColor: "inherit",
},
}}
>
<TranslateIcon color={"primary"} />
</IconButton>
);
Expand Down
47 changes: 23 additions & 24 deletions src/redux/sagas/assistantSaga.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import uniqWith from "lodash/uniqWith";
import isEqual from "lodash/isEqual";
import uniqWith from "lodash/uniqWith";
import {
all,
call,
fork,
put,
select,
take,
takeLatest,
} from "redux-saga/effects";

import assistantApiCalls from "../../components/NavItems/Assistant/AssistantApiHandlers/useAssistantApi";
import DBKFApi from "../../components/NavItems/Assistant/AssistantApiHandlers/useDBKFApi";
import {
CONTENT_TYPE,
KNOWN_LINKS,
KNOWN_LINK_PATTERNS,
NE_SUPPORTED_LANGS,
TYPE_PATTERNS,
matchPattern,
selectCorrectActions,
} from "../../components/NavItems/Assistant/AssistantRuleBook";
import {
cleanAssistantState,
setAssistantLoading,
Expand All @@ -11,41 +31,20 @@ import {
setImageVideoSelected,
setInputSourceCredDetails,
setInputUrl,
setMachineGeneratedTextDetails,
setNeDetails,
setNewsGenreDetails,
setNewsTopicDetails,
setPersuasionDetails,
setSubjectivityDetails,
setPrevFactChecksDetails,
setMachineGeneratedTextDetails,
setProcessUrl,
setProcessUrlActions,
setScrapedData,
setSingleMediaPresent,
setSubjectivityDetails,
setUrlMode,
} from "../actions/tools/assistantActions";

import {
all,
call,
fork,
put,
select,
take,
takeLatest,
} from "redux-saga/effects";
import assistantApiCalls from "../../components/NavItems/Assistant/AssistantApiHandlers/useAssistantApi";
import DBKFApi from "../../components/NavItems/Assistant/AssistantApiHandlers/useDBKFApi";
import {
CONTENT_TYPE,
KNOWN_LINK_PATTERNS,
KNOWN_LINKS,
matchPattern,
NE_SUPPORTED_LANGS,
selectCorrectActions,
TYPE_PATTERNS,
} from "../../components/NavItems/Assistant/AssistantRuleBook";

/**
* APIs
**/
Expand Down