-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5adc271
commit ca8afaf
Showing
19 changed files
with
6,259 additions
and
1,883 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
'use client'; | ||
|
||
import React, { useState, useEffect } from 'react'; | ||
import { useRouter } from 'next/navigation'; | ||
import { HiArrowLeft } from 'react-icons/hi'; | ||
|
||
import './style.css'; | ||
import Footer from '@/components/footer/footer'; | ||
|
||
|
||
function NewsDetailPage({ params }) { | ||
const { id } = params; | ||
const router = useRouter(); | ||
const [newsData, setNewsData] = useState(null); | ||
const [error, setError] = useState(null); | ||
|
||
useEffect(() => { | ||
async function getNewsDetail() { | ||
try { | ||
const res = await fetch(`https://yusufacmaci.com/yildizskylab/news/${id}`); | ||
|
||
if (!res.ok) { | ||
throw new Error('Failed to fetch data'); | ||
} | ||
|
||
const data = await res.json(); | ||
setNewsData(data); | ||
} catch (error) { | ||
setError(error); | ||
} | ||
} | ||
|
||
getNewsDetail(); | ||
}, [id]); | ||
|
||
if (error) { | ||
return ( | ||
<div className="container mx-auto p-4"> | ||
<h1 className="text-2xl font-bold">Haber Yüklenemedi</h1> | ||
<p>{error.message}</p> | ||
</div> | ||
); | ||
} | ||
|
||
if (!newsData) { | ||
return ( | ||
<div className="container mx-auto p-4"> | ||
<p>Yükleniyor...</p> | ||
</div> | ||
); | ||
} | ||
|
||
const item = newsData.data; | ||
|
||
return ( | ||
<div> | ||
{/* Navbar */} | ||
<nav className="fixed top-0 left-0 right-0 text-white p-4 flex items-center"> | ||
<button onClick={() => router.back()} className="mr-4"> | ||
<HiArrowLeft size={24} /> | ||
</button> | ||
<h1 className="text-xl font-bold">Haber Detayı</h1> | ||
</nav> | ||
|
||
{/* İçerik */} | ||
<div className="flex justify-center text-center content-center pt-16"> | ||
<div className="p-4 text-white custom-prose max-w-3xl"> | ||
<h1 className="text-3xl font-bold mb-4">{item.title}</h1> | ||
<p className="text-gray-200 mb-4"> | ||
Yayınlanma Tarihi: {new Date(item.publish_date).toLocaleDateString('tr-TR')} | ||
</p> | ||
<div className="mb-4"> | ||
<img | ||
src={`data:${item.image_type};base64,${item.image_url}`} | ||
alt={item.title} | ||
className="w-full mx-auto h-auto" | ||
/> | ||
</div> | ||
<div | ||
className="prose prose-lg text-white" | ||
dangerouslySetInnerHTML={{ __html: item.description }} | ||
/> | ||
</div> | ||
</div> | ||
<Footer/> | ||
</div> | ||
); | ||
} | ||
|
||
export default NewsDetailPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.custom-prose * { | ||
color: white !important; | ||
align-content: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
.footer-cover{ | ||
max-height: 40vh; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
margin-top: 80px; | ||
gap: 80px; | ||
} | ||
|
||
.footer-top{ | ||
display: flex; | ||
flex-direction: column; | ||
gap: 25px; | ||
} | ||
|
||
.footer-logo-container img{ | ||
width: 50px; | ||
height: auto; | ||
} | ||
|
||
.footer-logo-container{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 100px; | ||
} | ||
|
||
.fa-logo-footer{ | ||
font-size: 30px; | ||
color: white; | ||
} | ||
|
||
.footer-links-icon-container{ | ||
display: flex; | ||
justify-content: center; | ||
gap: 25px; | ||
} | ||
|
||
|
||
.footer-bottom{ | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 13px; | ||
color: white; | ||
} | ||
|
||
.footer-text a{ | ||
color: white; | ||
text-decoration: none; | ||
padding: 0; | ||
} | ||
|
||
|
||
@media only screen and (max-width: 768px){ | ||
.footer-bottom{ | ||
max-width: 50%; | ||
text-align: center; | ||
height: min-content; | ||
} | ||
|
||
.footer-cover{ | ||
gap: 40px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from "react"; | ||
import { | ||
FaDiscord, | ||
FaInstagram, | ||
FaLinkedin, | ||
FaTwitter, | ||
FaYoutube, | ||
} from "react-icons/fa"; | ||
import "./footer.css"; | ||
import { FaXTwitter } from "react-icons/fa6"; | ||
|
||
const Footer = () => { | ||
return ( | ||
<div className='footer-cover'> | ||
<div className='footer-top'> | ||
|
||
<div className='footer-links-icon-container'> | ||
<a href='https://www.instagram.com/ytuskylab'> | ||
<FaInstagram className='fa-logo-footer' /> | ||
</a> | ||
<a href='https://www.youtube.com/channel/UCF_qBKpUnM3X_C3L-gLEO4A'> | ||
<FaYoutube className='fa-logo-footer' /> | ||
</a> | ||
<a href='https://www.linkedin.com/company/ytuskylab/'> | ||
<FaLinkedin className='fa-logo-footer' /> | ||
</a> | ||
<a href='https://discord.com/invite/6jFBjH8y63'> | ||
<FaDiscord className='fa-logo-footer' /> | ||
</a> | ||
<a href='https://x.com/skylabkulubu'> | ||
<FaXTwitter className='fa-logo-footer' /> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div className='footer-bottom'> | ||
<p className='footer-year mb-6'>2024</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Footer; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.