feat: update social media links in Footer component to use environment variables and refactor Contact component to utilize backend URL from environment variable
This commit is contained in:
@@ -8,6 +8,7 @@ export default function Contact() {
|
||||
const t = useTranslations('contact');
|
||||
const [formData, setFormData] = useState<{ name: string; email: string; message: string }>({ name: '', email: '', message: '' });
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:3001';
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||
setFormData({...formData, [e.target.name]: e.target.value });
|
||||
@@ -29,9 +30,8 @@ export default function Contact() {
|
||||
}
|
||||
|
||||
const submissionPromise = async () => {
|
||||
//const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL;
|
||||
try {
|
||||
const response = await fetch(`http://localhost:3001/api/email/send`, {
|
||||
const response = await fetch(`${backendUrl}/api/email/send`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(formData),
|
||||
|
||||
Reference in New Issue
Block a user