Skip to content

Commit

Permalink
Add module declarations for svg and png ressources
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Ziegenberg <[email protected]>
  • Loading branch information
ziegenberg committed May 24, 2024
1 parent 25b79b3 commit 2d817b7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { connect } from "react-redux";
import { Link } from "react-router-dom";
import i18n from "../i18n/i18n";
import languages from "../i18n/languages";
// @ts-expect-error TS(2307): Cannot find module '../img/opencast-white.svg' or ... Remove this comment to see the full error message
import opencastLogo from "../img/opencast-white.svg";
import { setSpecificServiceFilter } from "../thunks/tableFilterThunks";
import { loadServicesIntoTable } from "../thunks/tableThunks";
Expand Down
3 changes: 0 additions & 3 deletions src/components/shared/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ import cn from "classnames";

import EditTableViewModal from "../shared/EditTableViewModal";

// @ts-expect-error TS(2307): Cannot find module '../../img/tbl-sort.png' or its... Remove this comment to see the full error message
import sortIcon from "../../img/tbl-sort.png";
// @ts-expect-error TS(2307): Cannot find module '../../img/tbl-sort-up.png' or ... Remove this comment to see the full error message
import sortUpIcon from "../../img/tbl-sort-up.png";
// @ts-expect-error TS(2307): Cannot find module '../../img/tbl-sort-down.png' o... Remove this comment to see the full error message
import sortDownIcon from "../../img/tbl-sort-down.png";
import Notifications from "./Notifications";

Expand Down
9 changes: 9 additions & 0 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare module "*.svg" {
const content: string;
export = content;
}

declare module "*.png" {
const value: any;
export = value;
}
19 changes: 1 addition & 18 deletions src/i18n/languages.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
// flag images imports
// @ts-expect-error TS(2307): Cannot find module '../img/lang/da_DK.svg' or its ... Remove this comment to see the full error message
import DKFlag from "../img/lang/da_DK.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/de_DE.svg' or its ... Remove this comment to see the full error message
import DEFlag from "../img/lang/de_DE.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/el_GR.svg' or its ... Remove this comment to see the full error message
import GRFlag from "../img/lang/el_GR.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/en_GB.svg' or its ... Remove this comment to see the full error message
import GBFlag from "../img/lang/en_GB.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/en_US.svg' or its ... Remove this comment to see the full error message
import USFlag from "../img/lang/en_US.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/es_ES.svg' or its ... Remove this comment to see the full error message
import ESFlag from "../img/lang/es_ES.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/fr_FR.svg' or its ... Remove this comment to see the full error message
import FRFlag from "../img/lang/fr_FR.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/gl_ES.svg' or its ... Remove this comment to see the full error message
import ESFlag2 from "../img/lang/gl_ES.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/he_IL.svg' or its ... Remove this comment to see the full error message
import ILFlag from "../img/lang/he_IL.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/it_IT.svg' or its ... Remove this comment to see the full error message
import ITFlag from "../img/lang/it_IT.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/nl_NL.svg' or its ... Remove this comment to see the full error message
import NLFlag from "../img/lang/nl_NL.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/pl_PL.svg' or its ... Remove this comment to see the full error message
import PLFlag from "../img/lang/pl_PL.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/sl_SI.svg' or its ... Remove this comment to see the full error message
import SIFlag from "../img/lang/sl_SI.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/sv_SE.svg' or its ... Remove this comment to see the full error message
import SEFlag from "../img/lang/sv_SE.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/tr_TR.svg' or its ... Remove this comment to see the full error message
import TRFlag from "../img/lang/tr_TR.svg";
// @ts-expect-error TS(2307): Cannot find module '../img/lang/zh_CN.svg' or its ... Remove this comment to see the full error message
import CNFlag from "../img/lang/zh_CN.svg";

// Import date-fns locales
Expand Down Expand Up @@ -59,8 +43,7 @@ import zhDate from "date-fns/locale/zh-CN";
* dateLocale: is needed for translation in datepicker
*
* !!! If a translation file of a new language was added, please insert these language here, too !!!
*
* */
*/
const languages = [
{
code: "en-GB",
Expand Down

0 comments on commit 2d817b7

Please sign in to comment.