Skip to content

Commit

Permalink
Merge pull request #506 from AKSHITHA-CHILUKA/patch-12
Browse files Browse the repository at this point in the history
Create TermsOfService.jsx
  • Loading branch information
hustlerZzZ authored Aug 8, 2024
2 parents d9b3414 + c0cf109 commit f066e27
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/pages/TermsOfService.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import './TermsOfService.css';
const TermsOfService = () => {
const [terms, setTerms] = useState('');
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
const fetchTermsOfService = async () => {
try {
const response = await axios.get('/api/terms-of-service'); // Replace with your API endpoint or file path
setTerms(response.data);
setLoading(false);
} catch (error) {
setError('Error fetching terms of service');
setLoading(false);
}
};
fetchTermsOfService();
}, []);
if (loading) return <p>Loading...</p>;
if (error) return <p>{error}</p>;
return (
<div className="terms-of-service">
<h2>Terms of Service</h2>
<div className="terms-content">
{terms ? (
<div dangerouslySetInnerHTML={{ __html: terms }} />
) : (
<p>No terms of service available.</p>
)}
</div>
</div>
);
};
export default TermsOfService;

0 comments on commit f066e27

Please sign in to comment.