Skip to content

Commit

Permalink
fix(marketingmain.js): dynamic demo cta text
Browse files Browse the repository at this point in the history
  • Loading branch information
arzljames committed Mar 25, 2024
1 parent 07ab04e commit fa71d4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/cta/TryFreeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Icon from '@mui/material/Icon';
import CodeBlock from './CodeBlock';

export default function TryFreeButton({
text = 'Request Demo',
text = '',
target = 'blank',
fullWidth = false,
component = 'button',
Expand Down
4 changes: 4 additions & 0 deletions src/layouts/Main/MarketingMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Topbar } from './components';

import dynamic from 'next/dynamic';
import revampTheme from 'theme/revampTheme';
import useFetch from 'components/hooks/useFetch';

const Footer = dynamic(() => import('./components/Footer/FooterDynamic'));
const Sidebar = dynamic(() => import('./components').then((e) => e.Sidebar));
Expand Down Expand Up @@ -99,6 +100,8 @@ const MarketingMain = ({
}
}, [userInfo]);

const data = useFetch('/-/demo-cta.json');

return (
<>
{isLoggedIn === false && !isLoginPage && <SiteBanner />}
Expand Down Expand Up @@ -163,6 +166,7 @@ const MarketingMain = ({
isAuthenticated={isLoggedIn}
userInfo={userInfo?.data}
loading={loading}
cta={data?.data?.demo_cta}
/>
</Stack>
</Container>
Expand Down
3 changes: 2 additions & 1 deletion src/layouts/Main/components/Topbar/Topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Topbar = ({
userInfo = {},
loading = false,
flyoutNavigation: data = [],
cta,
}) => {
const theme = useTheme();
const { mode } = theme.palette;
Expand Down Expand Up @@ -167,7 +168,7 @@ const Topbar = ({
</Box>
<Box>
<TryFreeButton
text="Contact Sales"
text={cta}
variant="contained"
component="a"
size="large"
Expand Down

0 comments on commit fa71d4c

Please sign in to comment.