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

chore: merge to production #2493

Merged
merged 8 commits into from
Nov 22, 2024
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.format": "never"
}
},
}
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const zestyConfig = require('./zesty.config.json');
const { docsRedirects } = require('./src/config/redirects');

module.exports = {
trailingSlash: true,
Expand All @@ -14,4 +15,8 @@ module.exports = {
],
},
swcMinify: true,

async redirects() {
return [...docsRedirects];
},
};
6 changes: 2 additions & 4 deletions src/components/accounts/dashboard/ui/ZInstancesContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ const ZInstancesContainer = ({
}) => {
const dayTime = () => {
const hour = new Date().getHours();
if (hour >= 5 && hour <= 12) return 'Good Morning, ';
if (hour >= 0 && hour <= 12) return 'Good Morning, ';
else if (hour > 12 && hour <= 17) return 'Good Afternoon, ';
else if (hour > 17 && hour <= 21) return 'Good Evening, ';
else if ((hour > 21 && hour <= 23) || (hour >= 0 && hour <= 4))
return 'Good Night, ';
else if (hour > 17 && hour <= 23) return 'Good Evening, ';
};
return (
<>
Expand Down
49 changes: 49 additions & 0 deletions src/config/redirects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const docsRedirects = [
{
source: '/docs/instances/api-reference/:path*',
destination: 'https://docs.zesty.io/reference/instances-api-reference',
permanent: true,
},
{
source: '/docs/authentication/api-reference/:path*',
destination: 'https://docs.zesty.io/reference/authentication-api-reference',
permanent: true,
},
{
source: '/docs/accounts/api-reference/:path*',
destination: 'https://docs.zesty.io/reference/accounts-api-reference',
permanent: true,
},
{
source: '/docs/parsley/api-reference/:path*',
destination: 'https://docs.zesty.io/docs/parsley',
permanent: true,
},
{
source: '/docs/media/api-reference/manager/:path*',
destination: 'https://docs.zesty.io/reference/media-manager-api-reference',
permanent: true,
},
{
source: '/docs/media/api-reference/storage/:path*',
destination: 'https://docs.zesty.io/reference/media-storage-api-reference',
permanent: true,
},
{
source: '/docs/media/api-reference/modify/:path*',
destination: 'https://docs.zesty.io/reference/media-modify-api-reference',
permanent: true,
},
{
source: '/docs/media/api-reference/resolver/:path*',
destination: 'https://docs.zesty.io/reference/media-resolver-api-reference',
permanent: true,
},
{
source: '/docs/media/api-reference/:path*',
destination: 'https://docs.zesty.io/reference/media-api-reference',
permanent: true,
},
];

module.exports = { docsRedirects };
1 change: 1 addition & 0 deletions src/layouts/Main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const Main = ({
isAuthenticated={isLoggedIn}
userInfo={userInfo?.data}
loading={loading}
cta={'Contact Sales'}
/>
</Stack>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ZestyView.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function ZestyView(props) {
props.content.meta.layout?.json['layout:root:column:0']?.children,
) === '{}'
) {
return true;
return false;
}

// return only true if the layout is active and has components
Expand Down
6 changes: 3 additions & 3 deletions src/pages/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,19 @@ const cardData = [
title: 'Instances API',
description:
'A collection of available REST endpoints scoped to your unique instance.',
link: '/docs/instances/api-reference/',
link: 'https://docs.zesty.io/reference/instances-api-reference',
},
{
title: 'Authentication API',
description:
'Auth API is used to authenticate users with Zesty.io, which returns a token that grants to access services like Instances API, Accounts API, and Media API. Auth was setup as a stand alone service so it can connect to many services in our infrastructure.',
link: '/docs/authentication/api-reference/',
link: 'https://docs.zesty.io/reference/authentication-api-reference',
},
{
title: 'Accounts API',
description:
'API used to control management of users, roles, instances, and teams.',
link: '/docs/accounts/api-reference/',
link: 'https://docs.zesty.io/reference/accounts-api-reference',
},
{
title: 'Guides',
Expand Down
10 changes: 9 additions & 1 deletion src/pages/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ const site = 'https://www.zesty.io';

const Login = (props) => {
const router = useRouter();
const content = props.data.data[0].content;
const content =
props.data.data
.sort(
(a, b) =>
new Date(b.content.start_date_and_time) -
new Date(a.content.start_date_and_time),
)
.map((item) => item.content)[0] || null;

const loginContent = props.loginData.data[0].content;
const ogimage = content?.feature_image?.data[0]?.url;

Expand Down
44 changes: 8 additions & 36 deletions src/revamp/ui/GetDemoSection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import useGetDynamicData from './useGetDynamicData';
import { useRouter } from 'next/router';
import ZestyImage from 'blocks/Image/ZestyImage';

const acorns =
'https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Acorns%20Logo.svg',
bjs = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/BJ's%20Logo.svg`,
rocketLeague = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Horizontal_Text.svg`,
cornershop = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Logo_de_Cornershop%201.svg`,
const rocketLeague = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Horizontal_Text.svg`,
phoenixSuns = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Phoenix%20Suns.svg`,
singlife = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Singlife%20Logo.svg`,
sony = `https://storage.googleapis.com/assets.zesty.io/website/images/assets/demo/Sony%20Logo.svg`,
Expand Down Expand Up @@ -118,7 +114,7 @@ const GetDemoSection = ({
})}
>
<Stack
spacing={4}
spacing={10}
mb={{ xs: 8, lg: 0 }}
width={{ lg: '456px', desktopWide: '548px' }}
>
Expand All @@ -138,13 +134,13 @@ const GetDemoSection = ({
p: {
component: Typography,
props: {
mt: 1,
mt: 2,
component: 'p',
variant: 'h6',
whiteSpace: 'pre-line',
color: 'grey.300',
fontSize: '18px',
lineHeight: '28px',
lineHeight: '24px',
},
},
},
Expand Down Expand Up @@ -282,6 +278,9 @@ const GetDemoSection = ({
)}
</Formik>
</Stack>
<Box sx={{ mt: 4 }}>
<G2Awards alignLeft />
</Box>
</Stack>
</Stack>
</Stack>
Expand All @@ -294,7 +293,7 @@ export default GetDemoSection;
function Testimonial({ review }) {
return (
<Stack gap={2}>
<Typography color={'white'} fontStyle={'italic'}>
<Typography color={'white'} fontStyle={'italic'} fontSize={18}>
{review?.review}
</Typography>
<Stack direction={'row'} gap={2} sx={{ alignItems: 'center' }}>
Expand All @@ -320,9 +319,6 @@ function TrustLogos() {
return (
<Stack>
<Logos alignLeft />
<Box sx={{ mt: 4 }}>
<G2Awards alignLeft />
</Box>
</Stack>
);
}
Expand Down Expand Up @@ -369,14 +365,6 @@ export function Logos({ invert = false, alignLeft }) {
height="32px"
alt={generateAlt('Singlife')}
/>
<img
style={{ filter: invert ? 'invert(0.5)' : 'none' }}
loading="lazy"
src={acorns}
width="94px"
height="32px"
alt={generateAlt('Acorns')}
/>
<img
style={{ filter: invert ? 'invert(0.5)' : 'none' }}
loading="lazy"
Expand All @@ -393,22 +381,6 @@ export function Logos({ invert = false, alignLeft }) {
height="32px"
alt={generateAlt('Wattpad')}
/>
<img
style={{ filter: invert ? 'invert(0.5)' : 'none' }}
loading="lazy"
src={cornershop}
width="96.69px"
height="32px"
alt={generateAlt('Corner Shop')}
/>
<img
style={{ filter: invert ? 'invert(0.5)' : 'none' }}
loading="lazy"
src={bjs}
width="36.48px"
height="32px"
alt={generateAlt('Bjs')}
/>
</Stack>
</Stack>
);
Expand Down
16 changes: 0 additions & 16 deletions src/revamp/ui/HeroV2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import Logos from './Logos';

const media =
'https://kfg6bckb.media.zestyio.com/Zesty-io-2023-Homepage-Graphic.webp',
acorns = 'https://kfg6bckb.media.zestyio.com/acornsHero.svg',
bjs = 'https://kfg6bckb.media.zestyio.com/bjsHero.svg',
phoenixSuns = 'https://kfg6bckb.media.zestyio.com/phoenixSunsHero.svg',
rocketLeague = 'https://kfg6bckb.media.zestyio.com/rocketLeagueHero.svg',
singlife = 'https://kfg6bckb.media.zestyio.com/singlifeHero.svg',
Expand Down Expand Up @@ -38,20 +36,6 @@ const logos = [
title: 'Singlife',
alt: generateAlt('Singlife'),
},
{
src: acorns,
width: 94,
height: 32,
title: 'Acorns',
alt: generateAlt('Acorns'),
},
{
src: bjs,
width: 36.48,
height: 32,
title: 'Bjs',
alt: generateAlt('Bjs'),
},
{
src: phoenixSuns,
width: 31.59,
Expand Down
25 changes: 24 additions & 1 deletion src/views/zesty/Article.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@ function Article({ content }) {
// Define a regular expression pattern to match [_CTA_]
let regexPattern = /\[CALL TO ACTION (\d+)\]/g;

useEffect(() => {
const removeSpansInHeadings = (html) => {
let tempDiv = document.createElement('div');
tempDiv.innerHTML = html;

let headings = tempDiv.querySelectorAll('h1, h2, h3, h4, h5, h6');

headings.forEach((heading) => {
let spans = heading.querySelectorAll('span');
spans.forEach((span) => {
span.replaceWith(...span.childNodes);
});
});

return tempDiv.innerHTML;
};

setNewContent(removeSpansInHeadings(newContent));
}, [newContent]);

useEffect(() => {
const validateWysiwyg = () => {
if (newContent?.includes('Error hydrating')) {
Expand Down Expand Up @@ -209,7 +229,10 @@ function Article({ content }) {
? `:is(span, p, h1, h2, h3, h4, h5, h6) :is(img) {
width: auto;
max-width: 100%;
}`
}
:h1 span, :h2 span {
color: black;
}`
: ``;

// Match CTA component sort order id from array to return its props
Expand Down
4 changes: 2 additions & 2 deletions src/views/zesty/Homepage/EnterpriseGrowth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ const Child = dynamic(() => import('revamp/ui/EnterpriseGrowth'), {
loading: Placeholder,
});

const Index = () => {
const Index = (props) => {
const { ref, inView } = useInView({
triggerOnce: true,
threshold: 0,
});
return <div ref={ref}>{inView && <Child />}</div>;
return <div ref={ref}>{inView && <Child {...props} />}</div>;
};

export default Index;
Loading
Loading