Skip to content

Commit 812b858

Browse files
committed
Updated to reusable components
Signed-off-by: Hemashree M S <hemashree21.msh@gmail.com>
1 parent 7c83616 commit 812b858

File tree

2 files changed

+137
-95
lines changed

2 files changed

+137
-95
lines changed

src/pages/code-of-conduct/index.tsx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,32 +55,14 @@ const Section = ({ title, children }) => (
5555
</section>
5656
);
5757

58+
// Reusable Components
5859
const ListItem = ({ title, description }) => (
5960
<StyledLi>
6061
<strong>{title}</strong>
6162
<p>{description}</p>
6263
</StyledLi>
6364
);
6465

65-
// Code of Conduct Component
66-
const CodeOfConduct = () => (
67-
<Layout>
68-
<CodeOfConductContainer>
69-
<Title>Code Of Conduct</Title>
70-
<Content>
71-
<LastUpdated />
72-
<OurPledge />
73-
<OurStandards />
74-
<EnforcementResponsibilities />
75-
<Scope />
76-
<Enforcement />
77-
<EnforcementGuidelines />
78-
<Attribution />
79-
</Content>
80-
</CodeOfConductContainer>
81-
</Layout>
82-
);
83-
8466
// Separate Sections as Components
8567
const LastUpdated = () => (
8668
<p><strong>Last Updated:</strong> 23rd May 2024</p>
@@ -110,7 +92,7 @@ const OurStandards = () => (
11092
<StyledLi>The use of sexualized language or imagery, and sexual attention or advances of any kind</StyledLi>
11193
<StyledLi>Trolling, insulting or derogatory comments, and personal or political attacks</StyledLi>
11294
<StyledLi>Public or private harassment</StyledLi>
113-
<StyledLi>Publishing others' private information, such as a physical or email address, without their explicit permission</StyledLi>
95+
<StyledLi>Publishing others&apos; private information, such as a physical or email address, without their explicit permission</StyledLi>
11496
<StyledLi>Other conduct which could reasonably be considered inappropriate in a professional setting</StyledLi>
11597
</StyledUl>
11698
</Section>
@@ -191,9 +173,28 @@ const EnforcementGuidelines = () => (
191173
const Attribution = () => (
192174
<Section title="Attribution">
193175
<p>This Code of Conduct is adapted from the <a href="https://www.contributor-covenant.org/" target="_blank" rel="noopener noreferrer">Contributor Covenant</a>, version 2.0, available at <a href="https://www.contributor-covenant.org/version/2/0/code_of_conduct/" target="_blank" rel="noopener noreferrer">https://www.contributor-covenant.org/version/2/0/code_of_conduct.html</a>.</p>
194-
<p>Community Impact Guidelines were inspired by <a href="https://github.com/mozilla/inclusion" target="_blank" rel="noopener noreferrer">Mozilla's code of conduct enforcement ladder</a>.</p>
176+
<p>Community Impact Guidelines were inspired by <a href="https://github.com/mozilla/inclusion" target="_blank" rel="noopener noreferrer">Mozilla&apos;s code of conduct enforcement ladder</a>.</p>
195177
<p>For answers to common questions about this code of conduct, see the FAQ at <a href="https://www.contributor-covenant.org/faq/" target="_blank" rel="noopener noreferrer">https://www.contributor-covenant.org/faq/</a>. Translations are available at <a href="https://www.contributor-covenant.org/translations" target="_blank" rel="noopener noreferrer">https://www.contributor-covenant.org/translations</a>.</p>
196178
</Section>
197179
);
198180

181+
// Code of Conduct Component
182+
const CodeOfConduct = () => (
183+
<Layout>
184+
<CodeOfConductContainer>
185+
<Title>Code Of Conduct</Title>
186+
<Content>
187+
<LastUpdated />
188+
<OurPledge />
189+
<OurStandards />
190+
<EnforcementResponsibilities />
191+
<Scope />
192+
<Enforcement />
193+
<EnforcementGuidelines />
194+
<Attribution />
195+
</Content>
196+
</CodeOfConductContainer>
197+
</Layout>
198+
);
199+
199200
export default CodeOfConduct;

src/pages/cookie-policy/index.tsx

Lines changed: 115 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,11 @@ import React from 'react';
22
import Layout from '@theme/Layout';
33
import styled from 'styled-components';
44

5-
/**
6-
* Cookie Section
7-
**/
8-
9-
interface CookieSectionProps {
10-
title: string;
11-
children: React.ReactNode;
12-
}
13-
14-
/**
15-
* Styled Components
16-
**/
17-
5+
// Styled Components
186
const CookiePolicyContainer = styled.div`
7+
width: 50%;
198
display: block;
209
margin: auto;
21-
width: 50%;
2210
padding: 20px;
2311
border-radius: 5px;
2412
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
@@ -59,71 +47,124 @@ const Content = styled.div`
5947
margin-bottom: 20px;
6048
`;
6149

62-
/**
63-
* Functional Components
64-
**/
65-
66-
const CookieSection: React.FC<CookieSectionProps> = ({ title, children }) => (
50+
// Reusable Components
51+
const Section = ({ title, children }) => (
6752
<section>
6853
<SubTitle>{title}</SubTitle>
6954
{children}
7055
</section>
7156
);
7257

73-
/**
74-
* Cookie Policy
75-
**/
76-
77-
const CookiePolicy: React.FC = () => {
78-
return (
79-
<Layout>
80-
<CookiePolicyContainer>
81-
<Title>Cookie Policy</Title>
82-
<Content>
83-
<p><strong>Last Updated:</strong> 23rd May 2024</p>
84-
<CookieSection title="Our Mission">
85-
<p>Welcome to CodeHarborHub. Our mission is to provide accessible and comprehensive educational resources to learners of all levels. This Cookie Policy explains how we use cookies on our website.</p>
86-
</CookieSection>
87-
<CookieSection title="What Are Cookies?">
88-
<p>Cookies are small text files stored on your device when you visit a website. They help the site to remember your preferences and activities over time.</p>
89-
</CookieSection>
90-
<CookieSection title="How We Use Cookies">
91-
<p>We use cookies to:</p>
92-
<StyledUl>
93-
<StyledLi>Enhance your user experience</StyledLi>
94-
<StyledLi>Analyze our website traffic</StyledLi>
95-
<StyledLi>Provide personalized content and advertisements</StyledLi>
96-
</StyledUl>
97-
</CookieSection>
98-
<CookieSection title="Types of Cookies We Use">
99-
<StyledOl>
100-
<StyledLi><strong>Essential Cookies</strong></StyledLi>
101-
<p>These cookies are necessary for our website to function properly and cannot be switched off in our systems.</p>
102-
<StyledLi><strong>Performance Cookies</strong></StyledLi>
103-
<p>These cookies help us understand how visitors interact with our website by collecting and reporting information anonymously.</p>
104-
<StyledLi><strong>Functionality Cookies</strong></StyledLi>
105-
<p>These cookies enable the website to provide enhanced functionality and personalization based on your interactions.</p>
106-
<StyledLi><strong>Targeting/Advertising Cookies</strong></StyledLi>
107-
<p>These cookies are used to deliver ads more relevant to you and your interests. They may be set by us or by third-party providers.</p>
108-
</StyledOl>
109-
</CookieSection>
110-
<CookieSection title="Managing Cookies">
111-
<p>You can manage or disable cookies through your browser settings. For more information on how to do this, visit your browser’s help section.</p>
112-
</CookieSection>
113-
<CookieSection title="Third-Party Cookies">
114-
<p>We may use third-party cookies for various purposes such as analytics and advertising. These cookies are governed by the privacy policies of the respective third parties.</p>
115-
</CookieSection>
116-
<CookieSection title="Cookie Policy Updates">
117-
<p>We may update this Cookie Policy from time to time. We will notify you of any significant changes by posting the new policy on our website and updating the date at the top of this page.</p>
118-
</CookieSection>
119-
<CookieSection title="Contact Us">
120-
<p>If you have any questions or concerns about our Cookie Policy, please contact us at:</p>
121-
<p><a href="mailto:ajaydhangar49@gmail.com" target="_blank" rel="noopener noreferrer">ajaydhangar49@gmail.com</a></p>
122-
</CookieSection>
123-
</Content>
124-
</CookiePolicyContainer>
125-
</Layout>
126-
);
127-
};
58+
// Reusable Components
59+
const ListItem = ({ title, description }) => (
60+
<StyledLi>
61+
<strong>{title}</strong>
62+
<p>{description}</p>
63+
</StyledLi>
64+
);
65+
66+
// Separate Sections as Components
67+
const LastUpdated = () => (
68+
<p><strong>Last Updated:</strong> 23rd May 2024</p>
69+
);
70+
71+
// Separate Sections as Components
72+
const Mission = () => (
73+
<Section title="Our Mission">
74+
<p>Welcome to CodeHarborHub. Our mission is to provide accessible and comprehensive educational resources to learners of all levels. This Cookie Policy explains how we use cookies on our website.</p>
75+
</Section>
76+
);
77+
78+
// Separate Sections as Components
79+
const WhatAreCookies = () => (
80+
<Section title="What Are Cookies?">
81+
<p>Cookies are small text files stored on your device when you visit a website. They help the site to remember your preferences and activities over time.</p>
82+
</Section>
83+
);
84+
85+
// Separate Sections as Components
86+
const HowWeUseCookies = () => (
87+
<Section title="How We Use Cookies">
88+
<p>We use cookies to:</p>
89+
<StyledUl>
90+
<StyledLi>Enhance your user experience</StyledLi>
91+
<StyledLi>Analyze our website traffic</StyledLi>
92+
<StyledLi>Provide personalized content and advertisements</StyledLi>
93+
</StyledUl>
94+
</Section>
95+
);
96+
97+
// Separate Sections as Components
98+
const TypesOfCookies = () => (
99+
<Section title="Types of Cookies We Use">
100+
<StyledOl>
101+
<ListItem
102+
title="Essential Cookies"
103+
description="These cookies are necessary for our website to function properly and cannot be switched off in our systems."
104+
/>
105+
<ListItem
106+
title="Performance Cookies"
107+
description="These cookies help us understand how visitors interact with our website by collecting and reporting information anonymously."
108+
/>
109+
<ListItem
110+
title="Functionality Cookies"
111+
description="These cookies enable the website to provide enhanced functionality and personalization based on your interactions."
112+
/>
113+
<ListItem
114+
title="Targeting/Advertising Cookies"
115+
description="These cookies are used to deliver ads more relevant to you and your interests. They may be set by us or by third-party providers."
116+
/>
117+
</StyledOl>
118+
</Section>
119+
);
120+
121+
// Separate Sections as Components
122+
const ManagingCookies = () => (
123+
<Section title="Managing Cookies">
124+
<p>You can manage or disable cookies through your browser settings. For more information on how to do this, visit your browser’s help section.</p>
125+
</Section>
126+
);
127+
128+
// Separate Sections as Components
129+
const ThirdPartyCookies = () => (
130+
<Section title="Third-Party Cookies">
131+
<p>We may use third-party cookies for various purposes such as analytics and advertising. These cookies are governed by the privacy policies of the respective third parties.</p>
132+
</Section>
133+
);
134+
135+
// Separate Sections as Components
136+
const CookiePolicyUpdates = () => (
137+
<Section title="Cookie Policy Updates">
138+
<p>We may update this Cookie Policy from time to time. We will notify you of any significant changes by posting the new policy on our website and updating the date at the top of this page.</p>
139+
</Section>
140+
);
141+
142+
// Separate Sections as Components
143+
const ContactUs = () => (
144+
<Section title="Contact Us">
145+
<p>If you have any questions or concerns about our Cookie Policy, please contact us at:</p>
146+
<p><a href="mailto:ajaydhangar49@gmail.com" target="_blank" rel="noopener noreferrer">ajaydhangar49@gmail.com</a></p>
147+
</Section>
148+
);
149+
150+
// Cookie Policy Component
151+
const CookiePolicy = () => (
152+
<Layout>
153+
<CookiePolicyContainer>
154+
<Title>Cookie Policy</Title>
155+
<Content>
156+
<LastUpdated />
157+
<Mission />
158+
<WhatAreCookies />
159+
<HowWeUseCookies />
160+
<TypesOfCookies />
161+
<ManagingCookies />
162+
<ThirdPartyCookies />
163+
<CookiePolicyUpdates />
164+
<ContactUs />
165+
</Content>
166+
</CookiePolicyContainer>
167+
</Layout>
168+
);
128169

129170
export default CookiePolicy;

0 commit comments

Comments
 (0)