Skip to content

Commit

Permalink
fix: cleanup files
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin.apolinario committed Oct 27, 2023
1 parent 8bc97d7 commit 3e1d117
Show file tree
Hide file tree
Showing 21 changed files with 15 additions and 1,662 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"typescript": "^5.2.2"
},
"engines": {
"node": ">=20.9.0"
"node": ">=18.18.0"
},
"config": {
"commitizen": {
Expand Down
28 changes: 0 additions & 28 deletions src/components/console/DocsAppbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,9 @@ const allowedSections = [
'docs/accounts',
];

const tabs = [
{ label: 'API Reference', value: '/docs/parsley/api-reference/' },
{ label: 'Tour', value: '/docs/parsley/tour/' },
{ label: 'Guides', value: '/docs/parsley/guides/' },
];

export const DocsAppbar = React.memo(() => {
const router = useRouter();

// setting of active tabs
const getInitialTab = () => {
if (router.asPath.includes(tabs[0].value)) {
return tabs[0].value;
} else if (router.asPath.includes(tabs[1].value)) {
return tabs[1].value;
} else if (router.asPath.includes(tabs[2].value)) {
return tabs[2].value;
} else {
return '';
}
};

const currentPath = router?.asPath?.split('/')?.filter((e) => e)[1] || '';

const {
Expand Down Expand Up @@ -78,19 +59,11 @@ export const DocsAppbar = React.memo(() => {
setSelectedDocsCategory: e.setSelectedDocsCategory,
}));

const {
algoliaApiKey: apiKey,
algoliaAppId: appId,
algoliaIndex: index,
} = useZestyStore((e) => e);

const isLoggedIn = useIsLoggedIn();
const instanceZUID = getCookie('ZESTY_WORKING_INSTANCE') || workingInstance;
// const [currentTab, setcurrentTab] = React.useState(getInitialTab());
const theme = useTheme();
const isDarkMode = theme.palette.mode === 'dark';
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
const isXl = useMediaQuery(theme.breakpoints.up('xl'));

const onChangeDropdown = (data) => {
let category = data.label;
Expand Down Expand Up @@ -147,7 +120,6 @@ export const DocsAppbar = React.memo(() => {
}
}, [workingInstance]);

const isDocs = router.asPath.includes('/docs');
const isApiReference = router.asPath.includes('api-reference');
const showApiReferenceBtn = allowedSections.some((path) =>
router.asPath.includes(path),
Expand Down
4 changes: 2 additions & 2 deletions src/components/console/DocsPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '@mui/material/Button';
import { Stack } from '@mui/material';
import LanguageIcon from '@mui/icons-material/Language';

export function DocsPopover({ name, options, onSelect }) {
export function DocsPopover({ name, options }) {
const [anchorEl, setAnchorEl] = React.useState(null);

const handleClick = (event) => {
Expand All @@ -16,7 +16,7 @@ export function DocsPopover({ name, options, onSelect }) {
setAnchorEl(null);
};

const handleSelect = (e) => {
const handleSelect = () => {
handleClose();
};
const open = Boolean(anchorEl);
Expand Down
7 changes: 0 additions & 7 deletions src/components/cta/StandardFormWithSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ const postToZOHO = async (payloadJSON) => {
throw new Error(`HTTP error: ${error}`);
});
};
const phoneRegExp =
/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im;

const subscribeToZoho = async (payload) => {
const { Email, First_Name, Last_Name } = payload;
Expand All @@ -115,13 +113,8 @@ const subscribeToZoho = async (payload) => {
};

function StandardFormWithSelect({
leadDetail = 'Contact Us',
leadSource = 'Website',
businessType = 'Direct',
modalTitle = 'Thank you',
modalMessage = 'Have a great day.',
downloadLink = '',
capterraTracking = null,
cmsModel,
}) {
const [open, setOpen] = useState(false);
Expand Down
14 changes: 0 additions & 14 deletions src/components/cta/standardFormWithSelectOld.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import MenuItem from '@mui/material/MenuItem';
import FormControl from '@mui/material/FormControl';
import Select from '@mui/material/Select';
import TransitionsModal from './TransitionModal';
import { inputLabelClasses } from '@mui/material/InputLabel';
import { styled } from '@mui/material/styles';
import { getCookie } from 'cookies-next';

/**
Expand All @@ -26,13 +24,6 @@ import { getCookie } from 'cookies-next';
* For testing new changes, please work with [email protected]
*/

// for hiding of ellipis in message in mobile
const StyledTextField = styled(TextField)({
[`& .${inputLabelClasses.outlined}`]: {
whiteSpace: 'normal',
},
});

/* validation for form component */

const getLeadObjectZOHO = (
Expand Down Expand Up @@ -200,18 +191,13 @@ function StandardFormWithSelectOld({
businessType = 'Direct',
modalTitle = 'Thank you',
modalMessage = 'Have a great day.',
displayMsgUnderButton = `We'll get back to you in 1-2 business days.`,
additionalTextfield = {},
buttonFullWidth = false,
hidePrivacySection = false,
messageLabel = 'Message',
customButtonStyle = { display: 'flex', justifyContent: 'initial' },
bottomCheckbox = false,
bottomCheckboxLabel = '',
validationType = '',
ctaButton = 'Submit',
downloadLink = '',
// onClickBtn = null,
phoneNumber = false,
capterraTracking = null,
cmsModel,
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs/AiSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const AiSearch = () => {
sx={{ mt: 4, maxHeight: 500, overflow: 'auto', pb: 2 }}
>
<Box>
{chatHistory.map((item, idx) => {
{chatHistory.map((item, _idx) => {
const message = item.type === 'bot' ? item.message : '';

return (
Expand Down
2 changes: 0 additions & 2 deletions src/layouts/Main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ const Main = ({
const isLoggedIn = useIsLoggedIn();
const pageNavColorRegex = new RegExp(/\bmindshare\b|article\b|category/gi);
const isBlogPage = model?.match(pageNavColorRegex) !== null ? true : false;
const headerColorInvert =
model?.match(pageNavColorRegex) !== null ? true : false;
const blogMain = new RegExp(/\bmindshare\b/gi);
const isBlogHome = model?.match(blogMain) !== null ? true : false;

Expand Down
9 changes: 2 additions & 7 deletions src/layouts/Main/MarketingMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const MarketingMain = ({
children,
customRouting,
nav = [],
colorInvert = false,
bgcolor = 'transparent',
model = '',
flyoutNavigation,
Expand Down Expand Up @@ -75,11 +74,7 @@ const MarketingMain = ({
isPpcShortPage || isCapterraPage || isDxpTemplatePage || isDiscover;
const isLoggedIn = useIsLoggedIn();
const pageNavColorRegex = new RegExp(/\bmindshare\b|article\b|category/gi);
const blogMain = new RegExp(/\bmindshare\b/gi);
const isBlogPage = model?.match(pageNavColorRegex) !== null ? true : false;
const isBlogHome = model?.match(blogMain) !== null ? true : false;
const headerColorInvert =
model?.match(pageNavColorRegex) !== null ? true : false;

const bgColorSwitch = () => {
if (isExplorePage) {
Expand Down Expand Up @@ -115,7 +110,7 @@ const MarketingMain = ({
display={router?.query?.slug?.[0] === 'login' && 'none'}
>
<Container
sx={(theme) => ({
sx={() => ({
paddingTop:
hideNav || isExplorePage ? '0px !important' : '8px !important',
paddingBottom: '0 !important',
Expand Down Expand Up @@ -149,7 +144,7 @@ const MarketingMain = ({
elevation={trigger ? 1 : 0}
>
<Container
sx={(theme) => ({
sx={() => ({
maxWidth: '1440px !important',
mx: 'auto',
paddingY: isExplorePage ? 2 : 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const SingleNavItem = ({ title, url, colorInvert = false }) => {
color={linkColor}
href={url}
underline="none"
sx={(theme) => ({
sx={() => ({
fontWeight: 600,
})}
title={title}
Expand Down
1 change: 1 addition & 0 deletions src/lib/api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unused-imports/no-unused-vars */
import axios from 'axios';
import FillerContent from 'components/globals/FillerContent';
import zestyConfig from '../../zesty.config.json';
Expand Down
16 changes: 0 additions & 16 deletions src/pages/docs/media/api-reference/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ import { ZestyAccountsHead } from 'components/globals/ZestyAccountsHead';

export { default as getServerSideProps } from 'lib/accounts/protectedRouteGetServerSideProps';

const VALID_URLS = ['/accounts', '/instances', '/authentication', '/media'];

const initialTreeData = (url, data) => {
const url1 = '/' + url.split('/').filter((e) => e)[0];
if (VALID_URLS.includes(url1)) {
return data.find((e) => e.url === url);
}
};

export default function Index(props) {
const router = useRouter();
const { setalgoliaApiKey, setalgoliaAppId, setalgoliaIndex, setmainData } =
Expand All @@ -25,13 +16,6 @@ export default function Index(props) {
const mainCollection = props.docs.data;
const mainData = transFormMainDataMedia(mainCollection);
const [treeData, settreeData] = React.useState(mainData[2]);
const parentUrl =
'/' +
url
?.split('/')
.filter((e) => e)
.slice(0, 2)
.join('/');

// main logic that will populate the data in the page
let item = [];
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/parsley/tour/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ const Slug = (props) => {
const [glossaryData, setglossaryData] = useState([]);
const [exampleData, setexampleData] = useState([]);
const [contentTab, setcontentTab] = useState('glossary');
const [currentTab, setcurrentTab] = React.useState('response');
const [_currentTab, setcurrentTab] = React.useState('response');
const [search, setsearch] = useState('');
const [loading, setloading] = useState(false);
const [textContent, settextContent] = useState('');
Expand Down
18 changes: 0 additions & 18 deletions src/pages/product/auth-success.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,6 @@ const getGlossary = async () => {
}
};

const cache = {};

// Function to fetch the page data
async function fetchPageData(url) {
// Check if the data is already cached
if (cache[url]) {
return cache[url];
}

// Fetch the page data
const data = await fetchPage(url);

// Cache the data
cache[url] = data;

return data;
}

export async function getServerSideProps({ res, req }) {
const isAuthenticated = getIsAuthenticated(res);
const isProd = process.env.PRODUCTION === 'true' ? true : false;
Expand Down
2 changes: 1 addition & 1 deletion src/revamp/ui/EnterpriseGrowth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const EnterpriseGrowth = ({
mb={{ xs: 6, tablet: 8, lg: 10 }}
>
<Stack direction="row" spacing={6}>
{[...Array(5)].map((c) =>
{[...Array(5)].map(() =>
logos.map((logo, index) => (
<Box
key={index}
Expand Down
1 change: 0 additions & 1 deletion src/revamp/ui/GetDemoSection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const GetDemoSection = ({
redirect = '/meet',
isContact = false,
formTitle = 'Enter your details to connect with a Content Expert',
formCtaText = 'Submit',
}) => {
const { lastVisitedPath, lastVisitedURL } = getLastVisitedPathAndUrl();
let inquiryReasons = [
Expand Down
3 changes: 0 additions & 3 deletions src/revamp/ui/Grid3Testimonials/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Avatar, Grid, Stack, Typography } from '@mui/material';
import React from 'react';

const image =
'https://storage.googleapis.com/assets.zesty.io/website/images/assets/zosh.svg';

const sampleTestimonails = [
{
text: `Quis neque, eu et ipsum amet, vel et. Varius integer enim
Expand Down
2 changes: 1 addition & 1 deletion src/revamp/ui/HeroTextImageWithStatsBelow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const HeroTextImageWithStatsBelow = ({
justifyContent={{ tablet: 'space-between' }}
divider={
<Divider
sx={(theme) => ({
sx={() => ({
borderRightWidth: 4,
display: { xs: 'none', tablet: 'block' },
})}
Expand Down
2 changes: 1 addition & 1 deletion src/revamp/ui/HeroV2/Logos.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Logos = ({ logos }) => {
rowGap="24px"
columnGap="20px"
>
{logos.map((image, index) => (
{logos.map((image) => (
<img
src={image.src}
alt={generateAlt()}
Expand Down
3 changes: 1 addition & 2 deletions src/revamp/ui/HeroV2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const media =
phoenixSuns = 'https://kfg6bckb.media.zestyio.com/phoenixSunsHero.svg',
rocketLeague = 'https://kfg6bckb.media.zestyio.com/rocketLeagueHero.svg',
singlife = 'https://kfg6bckb.media.zestyio.com/singlifeHero.svg',
sony = 'https://kfg6bckb.media.zestyio.com/sonyHero.svg',
circle = 'https://kfg6bckb.media.zestyio.com/Ellipse.svg';
sony = 'https://kfg6bckb.media.zestyio.com/sonyHero.svg';

const logos = [
{
Expand Down
1 change: 0 additions & 1 deletion src/views/Docs/helper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const langTransformer = ({
instanceZUID = '',
token = '',
isLoggedIn = false,
body = {},
}) => {
const hasFormData = data?.request?.body?.mode === 'formdata' ? true : false;
const hasToken = data?.request?.auth?.type === 'bearer' ? true : false;
Expand Down
Loading

0 comments on commit 3e1d117

Please sign in to comment.