From dfccb3130f889934d31196226be3d33e772f323b Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Sat, 12 Mar 2022 18:56:00 +0100 Subject: [PATCH] fix(client): fix issues raised through lgtm alerts --- client/components/build/RightSidebar/sections/Theme.tsx | 4 ++-- client/components/landing/Testimony.tsx | 4 ++-- client/constants/index.ts | 2 +- client/templates/Castform/widgets/Section.tsx | 4 ++-- client/templates/Gengar/widgets/Section.tsx | 4 ++-- client/templates/Glalie/widgets/Section.tsx | 4 ++-- client/templates/Kakuna/widgets/Section.tsx | 4 ++-- client/templates/Onyx/widgets/Section.tsx | 4 ++-- client/templates/Pikachu/widgets/Section.tsx | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/components/build/RightSidebar/sections/Theme.tsx b/client/components/build/RightSidebar/sections/Theme.tsx index 7833c7bd..af188386 100644 --- a/client/components/build/RightSidebar/sections/Theme.tsx +++ b/client/components/build/RightSidebar/sections/Theme.tsx @@ -1,4 +1,4 @@ -import { Theme } from '@reactive-resume/schema'; +import { Theme as ThemeType } from '@reactive-resume/schema'; import get from 'lodash/get'; import { useTranslation } from 'next-i18next'; @@ -16,7 +16,7 @@ const Theme = () => { const dispatch = useAppDispatch(); - const { background, text, primary } = useAppSelector((state) => get(state.resume, 'metadata.theme')); + const { background, text, primary } = useAppSelector((state) => get(state.resume, 'metadata.theme')); const handleChange = (property: string, color: string) => { dispatch(setResumeState({ path: `metadata.theme.${property}`, value: color })); diff --git a/client/components/landing/Testimony.tsx b/client/components/landing/Testimony.tsx index 46ca2b36..674c762a 100644 --- a/client/components/landing/Testimony.tsx +++ b/client/components/landing/Testimony.tsx @@ -1,8 +1,8 @@ -import { Testimony } from '@/data/testimonials'; +import { Testimony as TestimonyType } from '@/data/testimonials'; import styles from './Testimony.module.scss'; -type Props = Testimony; +type Props = TestimonyType; const Testimony: React.FC = ({ name, message }) => { return ( diff --git a/client/constants/index.ts b/client/constants/index.ts index 8cadbca4..de1bc387 100644 --- a/client/constants/index.ts +++ b/client/constants/index.ts @@ -3,7 +3,7 @@ export const FONTS_QUERY = 'fonts'; export const RESUMES_QUERY = 'resumes'; // Regular Expressions -export const VALID_URL_REGEX = /[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/; +export const VALID_URL_REGEX = /[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/; // Date Formats export const FILENAME_TIMESTAMP = 'DDMMYYYYHHmmss'; diff --git a/client/templates/Castform/widgets/Section.tsx b/client/templates/Castform/widgets/Section.tsx index ed2b1964..3f7a195e 100644 --- a/client/templates/Castform/widgets/Section.tsx +++ b/client/templates/Castform/widgets/Section.tsx @@ -1,5 +1,5 @@ import { Email, Link, Phone } from '@mui/icons-material'; -import { ListItem, Section } from '@reactive-resume/schema'; +import { ListItem, Section as SectionType } from '@reactive-resume/schema'; import get from 'lodash/get'; import isArray from 'lodash/isArray'; import isEmpty from 'lodash/isEmpty'; @@ -20,7 +20,7 @@ const Section: React.FC = ({ headlinePath = 'headline', keywordsPath = 'keywords', }) => { - const section: Section = useAppSelector((state) => get(state.resume, path, {})); + const section: SectionType = useAppSelector((state) => get(state.resume, path, {})); const dateFormat: string = useAppSelector((state) => get(state.resume, 'metadata.date.format')); if (!section.visible) return null; diff --git a/client/templates/Gengar/widgets/Section.tsx b/client/templates/Gengar/widgets/Section.tsx index 6cd12700..8a825bfa 100644 --- a/client/templates/Gengar/widgets/Section.tsx +++ b/client/templates/Gengar/widgets/Section.tsx @@ -1,5 +1,5 @@ import { Email, Link, Phone } from '@mui/icons-material'; -import { ListItem, Section } from '@reactive-resume/schema'; +import { ListItem, Section as SectionType } from '@reactive-resume/schema'; import get from 'lodash/get'; import isArray from 'lodash/isArray'; import isEmpty from 'lodash/isEmpty'; @@ -20,7 +20,7 @@ const Section: React.FC = ({ headlinePath = 'headline', keywordsPath = 'keywords', }) => { - const section: Section = useAppSelector((state) => get(state.resume, path, {})); + const section: SectionType = useAppSelector((state) => get(state.resume, path, {})); const dateFormat: string = useAppSelector((state) => get(state.resume, 'metadata.date.format')); const primaryColor: string = useAppSelector((state) => get(state.resume, 'metadata.theme.primary')); diff --git a/client/templates/Glalie/widgets/Section.tsx b/client/templates/Glalie/widgets/Section.tsx index f1803e1b..396c06d5 100644 --- a/client/templates/Glalie/widgets/Section.tsx +++ b/client/templates/Glalie/widgets/Section.tsx @@ -1,5 +1,5 @@ import { Email, Link, Phone } from '@mui/icons-material'; -import { ListItem, Section } from '@reactive-resume/schema'; +import { ListItem, Section as SectionType } from '@reactive-resume/schema'; import get from 'lodash/get'; import isArray from 'lodash/isArray'; import isEmpty from 'lodash/isEmpty'; @@ -21,7 +21,7 @@ const Section: React.FC = ({ headlinePath = 'headline', keywordsPath = 'keywords', }) => { - const section: Section = useAppSelector((state) => get(state.resume, path, {})); + const section: SectionType = useAppSelector((state) => get(state.resume, path, {})); const dateFormat: string = useAppSelector((state) => get(state.resume, 'metadata.date.format')); const primaryColor: string = useAppSelector((state) => get(state.resume, 'metadata.theme.primary')); diff --git a/client/templates/Kakuna/widgets/Section.tsx b/client/templates/Kakuna/widgets/Section.tsx index b432de36..98d5869a 100644 --- a/client/templates/Kakuna/widgets/Section.tsx +++ b/client/templates/Kakuna/widgets/Section.tsx @@ -1,5 +1,5 @@ import { Email, Phone } from '@mui/icons-material'; -import { ListItem, Section } from '@reactive-resume/schema'; +import { ListItem, Section as SectionType } from '@reactive-resume/schema'; import get from 'lodash/get'; import isArray from 'lodash/isArray'; import isEmpty from 'lodash/isEmpty'; @@ -20,7 +20,7 @@ const Section: React.FC = ({ headlinePath = 'headline', keywordsPath = 'keywords', }) => { - const section: Section = useAppSelector((state) => get(state.resume, path, {})); + const section: SectionType = useAppSelector((state) => get(state.resume, path, {})); const dateFormat: string = useAppSelector((state) => get(state.resume, 'metadata.date.format')); const primaryColor: string = useAppSelector((state) => get(state.resume, 'metadata.theme.primary')); diff --git a/client/templates/Onyx/widgets/Section.tsx b/client/templates/Onyx/widgets/Section.tsx index e06824f8..830bd57a 100644 --- a/client/templates/Onyx/widgets/Section.tsx +++ b/client/templates/Onyx/widgets/Section.tsx @@ -1,5 +1,5 @@ import { Email, Link, Phone } from '@mui/icons-material'; -import { ListItem, Section } from '@reactive-resume/schema'; +import { ListItem, Section as SectionType } from '@reactive-resume/schema'; import get from 'lodash/get'; import isArray from 'lodash/isArray'; import isEmpty from 'lodash/isEmpty'; @@ -20,7 +20,7 @@ const Section: React.FC = ({ headlinePath = 'headline', keywordsPath = 'keywords', }) => { - const section: Section = useAppSelector((state) => get(state.resume, path, {})); + const section: SectionType = useAppSelector((state) => get(state.resume, path, {})); const dateFormat: string = useAppSelector((state) => get(state.resume, 'metadata.date.format')); const primaryColor: string = useAppSelector((state) => get(state.resume, 'metadata.theme.primary')); diff --git a/client/templates/Pikachu/widgets/Section.tsx b/client/templates/Pikachu/widgets/Section.tsx index 4a2c53fc..3eb9df01 100644 --- a/client/templates/Pikachu/widgets/Section.tsx +++ b/client/templates/Pikachu/widgets/Section.tsx @@ -1,5 +1,5 @@ import { Email, Link, Phone } from '@mui/icons-material'; -import { ListItem, Section } from '@reactive-resume/schema'; +import { ListItem, Section as SectionType } from '@reactive-resume/schema'; import get from 'lodash/get'; import isArray from 'lodash/isArray'; import isEmpty from 'lodash/isEmpty'; @@ -20,7 +20,7 @@ const Section: React.FC = ({ headlinePath = 'headline', keywordsPath = 'keywords', }) => { - const section: Section = useAppSelector((state) => get(state.resume, path, {})); + const section: SectionType = useAppSelector((state) => get(state.resume, path, {})); const dateFormat: string = useAppSelector((state) => get(state.resume, 'metadata.date.format')); const primaryColor: string = useAppSelector((state) => get(state.resume, 'metadata.theme.primary'));