Skip to content

Commit 6eaedde

Browse files
authored
Merge pull request #107 from MozzamShahid/feature-terms-page
[Task] Implement Terms of Service Page #96
2 parents 3222913 + d62bc24 commit 6eaedde

File tree

3 files changed

+192
-0
lines changed

3 files changed

+192
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"terms_of_service": {
3+
"01": {
4+
"title": "Introduction",
5+
"content": [
6+
"Welcome to React ChatBotify Gallery, a platform designed to facilitate the browsing, rating, sharing, and downloading of themes & plugins created by various authors.",
7+
"We serve as a platform only and do not own or endorse any themes & plugins uploaded by users.",
8+
"By using our service, you agree to comply with and be bound by the following Terms of Service. If you do not agree with these terms, please do not use our service."
9+
]
10+
},
11+
"02": {
12+
"title": "Ownership of Themes & Plugins",
13+
"content": [
14+
"All themes & plugins available on React ChatBotify Gallery are the intellectual property of their respective authors.",
15+
"By uploading content, you represent and warrant that you have the necessary rights to grant us a license to host, distribute, and make available your content to others.",
16+
"We do not claim ownership of any themes & plugins provided through our platform.",
17+
"The rights to these themes & plugins, including any copyrights or trademarks, remain with the original authors."
18+
]
19+
},
20+
"03": {
21+
"title": "User Responsibilities",
22+
"content": [
23+
{ "point": "3.1", "text": "Users are responsible for ensuring that the themes & plugins they choose to use are appropriate for their needs and that they understand their functionality and limitations." },
24+
{ "point": "3.2", "text": "Users must comply with any licensing terms provided by the authors of the themes & plugins." },
25+
{ "point": "3.3", "text": "Users may not redistribute, sell, or claim ownership of any themes & plugins downloaded from our platform unless explicitly permitted by the author." },
26+
{ "point": "3.4", "text": "Users agree to respect the intellectual property rights of others and acknowledge that any violations could result in account suspension or termination." }
27+
]
28+
},
29+
"04": {
30+
"title": "Disclaimer of Warranties",
31+
"content": [
32+
{ "point": "4.1", "text": "React ChatBotify Gallery provides themes & plugins on an 'as is' basis without warranties of any kind, either express or implied." },
33+
{ "point": "4.2", "text": "We do not guarantee that the themes & plugins will meet your requirements, be error-free, or be compatible with your specific environment." },
34+
{ "point": "4.3", "text": "React ChatBotify Gallery does not vet or endorse any themes & plugins available on the platform, and users download and use them at their own risk." },
35+
{ "point": "4.4", "text": "We do not make any warranties regarding the security, reliability, or performance of the themes & plugins." }
36+
]
37+
},
38+
"05": {
39+
"title": "Limitation of Liability",
40+
"content": [
41+
{ "point": "5.1", "text": "To the fullest extent permitted by law, React ChatBotify Gallery shall not be held liable for any direct, indirect, incidental, special, or consequential damages arising out of the use or inability to use the themes & plugins, even if we have been advised of the possibility of such damages." },
42+
{ "point": "5.2", "text": "This includes but is not limited to damages related to loss of data, profits, or business interruption." }
43+
]
44+
},
45+
"06": {
46+
"title": "Indemnification",
47+
"content": [
48+
"You agree to indemnify and hold harmless React ChatBotify Gallery, its affiliates, and its members from any claims, damages, losses, or legal fees arising from your use of the themes & plugins, your violation of these Terms of Service, or your violation of any rights of another."
49+
]
50+
},
51+
"07": {
52+
"title": "Changes to the Terms of Service",
53+
"content": [
54+
"We reserve the right to modify these Terms of Service at any time.",
55+
"Any changes will be effective immediately upon posting on our platform.",
56+
"Continued use of the platform following any changes constitutes your acceptance of the new terms."
57+
]
58+
},
59+
"08": {
60+
"title": "Governing Law",
61+
"content": [
62+
"These Terms of Service are governed by and construed in accordance with the laws of Singapore.",
63+
"Any disputes arising out of or related to these terms shall be resolved in the courts of Singapore."
64+
]
65+
},
66+
"09": {
67+
"title": "Contact Information",
68+
"content": [
69+
"If you have any questions or concerns about these Terms of Service, please contact the core team on Discord. For information on how we handle your personal data, please refer to our Privacy Policy."
70+
]
71+
},
72+
"10": {
73+
"title": "User Accounts",
74+
"content": [
75+
"Users are responsible for maintaining the confidentiality of their account information and are fully responsible for all activities that occur under their account."
76+
]
77+
},
78+
"11": {
79+
"title": "Content Removal",
80+
"content": [
81+
"React ChatBotify Gallery reserves the right to remove any content that violates these terms or is deemed inappropriate at our discretion, without notice."
82+
]
83+
},
84+
"12": {
85+
"title": "Third-Party Links and Integrations",
86+
"content": [
87+
"Our platform may contain links to third-party websites or integrate with third-party services.",
88+
"We are not responsible for the content, policies, or practices of these third-party sites or services."
89+
]
90+
},
91+
"13": {
92+
"title": "Termination",
93+
"content": [
94+
"We reserve the right to terminate or suspend your account at any time, with or without cause, and with or without notice, especially if you violate these terms."
95+
]
96+
},
97+
"14": {
98+
"title": "Age Requirement",
99+
"content": [
100+
"By using React ChatBotify Gallery, you affirm that you are at least 13 years of age or older, or have parental consent if younger, in compliance with applicable laws."
101+
]
102+
}
103+
}
104+
}

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import HomePage from './pages/Home';
1515
import LoginProcessPage from './pages/LoginProcess';
1616
import PluginsPage from './pages/Plugins';
1717
import TeamsPage from './pages/Teams';
18+
import TermsOfService from "./pages/TermofService";
1819
import ThemesPage from './pages/Themes';
1920
import UserProfilePage from './pages/UserProfile';
2021
import ProtectedRoute from './routes/ProtectedRoute';
@@ -77,6 +78,7 @@ const App: React.FC = () => {
7778
{ element: <PluginsPage />, path: '/plugins' },
7879
{ element: <ThemesPage />, path: '/themes' },
7980
{ element: <TeamsPage />, path: '/teams' },
81+
{ element: <TermsOfService/>, path: '/terms-of-services' },
8082
{
8183
element: <ProtectedRoute element={<UserProfilePage />} />,
8284
path: '/profile',

src/pages/TermofService.tsx

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import { Box, Container, Typography } from '@mui/material';
2+
import React from 'react';
3+
import { useTranslation } from 'react-i18next';
4+
5+
// Define types for the translation structure
6+
interface ContentItem {
7+
point?: string;
8+
text: string;
9+
}
10+
11+
interface Section {
12+
title: string;
13+
content: (string | ContentItem)[];
14+
}
15+
16+
interface TermsOfServiceTranslation {
17+
[sectionKey: string]: Section; // Dynamic section keys with a Section value
18+
}
19+
20+
/**
21+
* Terms of Service component that displays platform policies and guidelines.
22+
*/
23+
const TermsOfService: React.FC = () => {
24+
// Use i18next to fetch translations dynamically
25+
const { t } = useTranslation("/pages/termofservice");
26+
27+
// Type assertion for the translation data
28+
const termsOfService = t("terms_of_service", { returnObjects: true }) as TermsOfServiceTranslation;
29+
30+
// Sorting the section keys numerically
31+
const sortedKeys = Object.keys(termsOfService).sort((a, b) => parseInt(a) - parseInt(b));
32+
33+
return (
34+
<Container maxWidth="md" sx={{ py: 10 }}>
35+
<Box sx={{ textAlign: 'left' }}>
36+
<Typography variant="h3" color="text.primary" fontWeight="bold" gutterBottom>
37+
{t("Terms of Service")}
38+
</Typography>
39+
<Typography variant="h6" color="text.secondary" fontWeight="light" gutterBottom>
40+
{t("While open source libraries encourage collaboration and accessibility, it's essential to ensure that users and contributors understand their rights and responsibilities. Our Terms of Service provide clear guidelines on usage, modification and distribution.")}
41+
</Typography>
42+
</Box>
43+
44+
{/* Loop through the sections in the sorted order */}
45+
{sortedKeys.map((sectionKey) => {
46+
const section = termsOfService[sectionKey];
47+
const { title, content } = section;
48+
const sectionNumber = sectionKey.padStart(2, '0'); // Adding leading zero to the section number if needed
49+
50+
return (
51+
<Box key={sectionKey} sx={{ mt: 5 }}>
52+
<Typography variant="h5" color="text.primary" fontWeight="bold">
53+
<Typography variant="h5" color="text.secondary" component="span">
54+
{sectionNumber} {/* Section number in a lighter, secondary font */}
55+
</Typography>
56+
{title} {/* Title in bold */}
57+
</Typography>
58+
59+
{/* Handle content rendering */}
60+
<Typography variant="body1" color="text.primary" sx={{ mt: 1 }}>
61+
{content
62+
.filter((item) => typeof item === "string") // Only get simple paragraphs
63+
.join(" ")} {/* Join them into a single paragraph */}
64+
</Typography>
65+
66+
{content
67+
.filter((item) => typeof item !== "string") // Handle points separately
68+
.map((item, index) => (
69+
<Typography key={index} variant="body1" color="text.primary" sx={{ mt: 1 }}>
70+
<strong>{item.point}</strong> {item.text}
71+
</Typography>
72+
))}
73+
</Box>
74+
);
75+
})}
76+
77+
<Box sx={{ mt: 5, opacity: 0.5 }}>
78+
<Typography variant="body2" color="text.primary">
79+
{t("Effective date for this policy: 2nd of March 2025")}
80+
</Typography>
81+
</Box>
82+
</Container>
83+
);
84+
};
85+
86+
export default TermsOfService;

0 commit comments

Comments
 (0)