Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix(client): fix issues raised through lgtm alerts

Amruth Pillaidfccb3130f88
diff --git a/client/components/build/RightSidebar/sections/Theme.tsx b/client/components/build/RightSidebar/sections/Theme.tsx
index 7833c7bdf..af1883865 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<Theme>((state) => get(state.resume, 'metadata.theme'));
+ const { background, text, primary } = useAppSelector<ThemeType>((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 46ca2b36b..674c762a6 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<Props> = ({ name, message }) => {
return (
diff --git a/client/constants/index.ts b/client/constants/index.ts
index 8cadbca41..de1bc3877 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 ed2b19649..3f7a195ec 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<SectionProps> = ({
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 6cd127000..8a825bfa0 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<SectionProps> = ({
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 f1803e1b4..396c06d52 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<SectionProps> = ({
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 b432de368..98d5869a6 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<SectionProps> = ({
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 e06824f83..830bd57a6 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<SectionProps> = ({
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 4a2c53fc7..3eb9df014 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<SectionProps> = ({
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'));