Skip to content

Commit d92200d

Browse files
committed
adds tcs
1 parent fa4a729 commit d92200d

File tree

5 files changed

+75
-20
lines changed

5 files changed

+75
-20
lines changed

src/components/landing-page-components/parts/landing-page-link.jsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
import React from 'react';
2-
import { Link } from 'react-router-dom';
2+
import { Link} from 'react-router-dom';
33

44
const LandingPageLink = ({
55
href,
66
children,
77
className = '',
88
style = {},
99
}) => {
10+
const handleClick = (e) => {
11+
if (href.startsWith('#')) {
12+
e.preventDefault();
13+
const targetId = href.substring(1);
14+
const targetElement = document.getElementById(targetId);
15+
if (targetElement) {
16+
targetElement.scrollIntoView({ behavior: 'smooth' });
17+
} else {
18+
// If the element doesn't exist on the current page, navigate to the home page with the hash
19+
//navigate('/' + href);
20+
return
21+
}
22+
}
23+
};
24+
1025
return (
1126
<Link
1227
to={href}
1328
className={`text-[#ECECEC] ${className}`}
1429
style={style}
30+
onClick={handleClick}
1531
>
1632
{children}
1733
</Link>

src/components/landing-page-components/sections/landing-page-footer.jsx

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import LandingPageLink from '../parts/landing-page-link';
33
import icon from '/static/landing-page/icon.png';
44
import logo from '/static/landing-page/logo.png';
55
import { useIsMobile } from '../context-providers/mobile-context-provider';
6-
import { LINK_BLOG, LINK_GITHUB, LINK_LINKEDIN } from '@site/src/constants/landing-page-links-constants';
6+
import { LINK_BLOG, LINK_GITHUB, LINK_LINKEDIN, LINK_PRIVACY_POLICY, LINK_TERMS_OF_SERVICE } from '@site/src/constants/landing-page-links-constants';
77

88
const BACKER_LOGOS_SRC = [
99
"/landing-page/techstars.svg",
@@ -65,6 +65,40 @@ const LandingPageFooter = () => {
6565
6666
</div>
6767
</div>
68+
<div
69+
className="flex flex-col gap-[1rem] grow"
70+
>
71+
<div
72+
className={isMobile ?
73+
"text-[1.25rem] font-medium"
74+
:
75+
"text-[1.5rem] font-medium"
76+
}
77+
>
78+
Company
79+
</div>
80+
<a
81+
className={isMobile ?
82+
"font-light"
83+
:
84+
"text-[1.125rem] font-light"
85+
}
86+
href={LINK_TERMS_OF_SERVICE}
87+
>
88+
Terms of service
89+
</a>
90+
<a
91+
className={isMobile ?
92+
"font-light"
93+
:
94+
"text-[1.125rem] font-light"
95+
}
96+
href={LINK_PRIVACY_POLICY}
97+
>
98+
Privacy policy
99+
</a>
100+
101+
</div>
68102
<div
69103
className="flex flex-col grow gap-[0.38rem]"
70104
>

src/components/landing-page-components/sections/landing-page-header.jsx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import PrimaryButton from '../parts/landing-page-button-primary';
77
import SecondaryButton from '../parts/landing-page-button-secondary';
88
import LandingPageLink from '../parts/landing-page-link';
99
import { useIsMobile } from '../context-providers/mobile-context-provider';
10-
import { LINK_GET_STARTED, LINK_HOW_IT_WORKS, LINK_PRICING, LINK_DOCS, LINK_BLOG, LINK_SIGN_IN } from '../../../constants/landing-page-links-constants';
10+
import { LINK_GET_STARTED, LINK_HOW_IT_WORKS, LINK_PRICING, LINK_DOCS, LINK_BLOG, LINK_SIGN_IN, HOME_PAGE } from '../../../constants/landing-page-links-constants';
1111

12-
const LandingPageHeader = () => {
12+
const LandingPageHeader = ({
13+
notFromHome = false
14+
}) => {
1315
const history = useHistory();
1416
const isMobile = useIsMobile();
1517

@@ -53,9 +55,9 @@ const LandingPageHeader = () => {
5355
style={{
5456
borderBottom: "1px solid #3741AC",
5557
}}
56-
href={LINK_HOW_IT_WORKS}
58+
href={notFromHome ? HOME_PAGE : LINK_HOW_IT_WORKS}
5759
>
58-
How it works
60+
{notFromHome ? "Home" : "How it works"}
5961
</LandingPageLink>
6062

6163
<LandingPageLink
@@ -109,24 +111,24 @@ const LandingPageHeader = () => {
109111
</div>
110112
</>
111113

112-
const scrollToHeader = (headerId) => {
113-
const headerElement = document.getElementById(headerId);
114-
if (headerElement) {
115-
headerElement.scrollIntoView({ behavior: 'smooth' });
116-
}
117-
};
114+
const scrollToHeader = (headerId) => {
115+
const headerElement = document.getElementById(headerId);
116+
if (headerElement) {
117+
headerElement.scrollIntoView({ behavior: 'smooth' });
118+
}
119+
};
118120

119121

120122
const desktopLinks = <>
121123
<div
122124
className={`flex gap-[1.5rem] items-center`}
123125
>
124-
<a style={{ color: 'white' }}
125-
onClick={() => scrollToHeader('features')}
126-
>
127-
How it works
128-
</a>
129-
126+
<LandingPageLink
127+
href={notFromHome ? HOME_PAGE : LINK_HOW_IT_WORKS}
128+
>
129+
{notFromHome ? "Home" : "How it works"}
130+
</LandingPageLink>
131+
130132

131133

132134
<LandingPageLink

src/constants/landing-page-links-constants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ export const LINK_SIGN_IN = 'https://dev-docs.io';
77
export const LINK_BOOK_MEETING = 'https://dub.sh/devdocs';
88
export const LINK_CHAT_WITH_FOUNDERS = 'https://dub.sh/devdocs';
99
export const LINK_LINKEDIN = 'https://www.linkedin.com/company/dev-docs';
10-
export const LINK_GITHUB = 'https://github.com/team-dev-docs';
10+
export const LINK_GITHUB = 'https://github.com/team-dev-docs';
11+
export const HOME_PAGE = '/';
12+
export const LINK_PRIVACY_POLICY = 'https://app.termly.io/document/privacy-policy/f93b0777-1325-40b0-b83a-e8f1fc82c82c';
13+
export const LINK_TERMS_OF_SERVICE = 'https://app.termly.io/document/terms-of-use-for-saas/2089f33f-b962-4e79-b2c2-5d2832abb223';

src/pages/pricing/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const PricingPage = () => {
1818
<div
1919
className={`w-full font-sans bg-repeat-y bg-cover bg-landing-page text-[#ECECEC] flex flex-col ${isMobile ? 'gap-4' : 'gap-[15.62rem]'}`}
2020
>
21-
<LandingPageHeader />
21+
<LandingPageHeader notFromHome={true} />
2222

2323
<PricingCards />
2424

0 commit comments

Comments
 (0)