UI updates

This commit is contained in:
Min Zeya Phyo
2026-02-26 15:07:05 +06:30
parent f0146c311c
commit 964afce761
12 changed files with 601 additions and 272 deletions

View File

@@ -1,69 +1,66 @@
import Link from 'next/link'
const categories = [
{ href: '/category/ai-news', label: 'AI သတင်းများ' },
{ href: '/category/tutorials', label: 'သင်ခန်းစာများ' },
{ href: '/category/tips-tricks', label: 'အကြံပြုချက်များ' },
{ href: '/category/upcoming', label: 'လာမည့်အရာများ' },
]
export default function Footer() {
return (
<footer className="bg-gray-900 text-white mt-16">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div className="grid grid-cols-1 md:grid-cols-3 gap-8">
{/* About */}
{/* Brand */}
<div>
<h3 className="text-lg font-bold mb-4 font-burmese">Burmddit က</h3>
<p className="text-gray-400 text-sm font-burmese">
<Link href="/" className="flex items-center space-x-2 mb-4">
<span className="w-8 h-8 bg-primary rounded-lg flex items-center justify-center text-white font-bold text-lg">B</span>
<span className="text-xl font-bold font-burmese">Burmddit</span>
</Link>
<p className="text-gray-400 text-sm font-burmese leading-relaxed">
AI က က
</p>
</div>
{/* Links */}
{/* Categories */}
<div>
<h3 className="text-lg font-bold mb-4 font-burmese"></h3>
<h3 className="text-base font-bold mb-4 font-burmese"></h3>
<ul className="space-y-2 text-sm">
<li>
<a href="/category/ai-news" className="text-gray-400 hover:text-white font-burmese">
AI
</a>
</li>
<li>
<a href="/category/tutorials" className="text-gray-400 hover:text-white font-burmese">
</a>
</li>
<li>
<a href="/category/tips-tricks" className="text-gray-400 hover:text-white font-burmese">
ကက
</a>
</li>
<li>
<a href="/category/upcoming" className="text-gray-400 hover:text-white font-burmese">
</a>
</li>
{categories.map((c) => (
<li key={c.href}>
<Link href={c.href} className="text-gray-400 hover:text-white font-burmese transition-colors">
{c.label}
</Link>
</li>
))}
</ul>
</div>
{/* Contact */}
{/* Quick Links */}
<div>
<h3 className="text-lg font-bold mb-4">Contact</h3>
<p className="text-gray-400 text-sm">
<h3 className="text-base font-bold mb-4 font-burmese"></h3>
<ul className="space-y-2 text-sm">
<li>
<Link href="/search" className="text-gray-400 hover:text-white font-burmese transition-colors">
🔍
</Link>
</li>
<li>
<Link href="/" className="text-gray-400 hover:text-white font-burmese transition-colors">
📰 က
</Link>
</li>
</ul>
<p className="text-gray-500 text-xs mt-6 font-burmese leading-relaxed">
Built with for Myanmar tech community
</p>
<div className="mt-4 flex space-x-4">
<a href="#" className="text-gray-400 hover:text-white">
<span className="sr-only">Twitter</span>
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<path d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84" />
</svg>
</a>
<a href="#" className="text-gray-400 hover:text-white">
<span className="sr-only">GitHub</span>
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<path fillRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clipRule="evenodd" />
</svg>
</a>
</div>
</div>
</div>
<div className="mt-8 pt-8 border-t border-gray-800 text-center">
<p className="text-gray-400 text-sm">
© {new Date().getFullYear()} Burmddit. All rights reserved.
<p className="text-gray-500 text-sm font-burmese">
© {new Date().getFullYear()} Burmddit.
</p>
</div>
</div>

View File

@@ -1,53 +1,104 @@
'use client'
import { useState } from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
const navLinks = [
{ href: '/', label: 'ပင်မစာမျက်နှာ' },
{ href: '/category/ai-news', label: 'AI သတင်းများ' },
{ href: '/category/tutorials', label: 'သင်ခန်းစာများ' },
{ href: '/category/tips-tricks', label: 'အကြံပြုချက်များ' },
{ href: '/category/upcoming', label: 'လာမည့်အရာများ' },
]
export default function Header() {
const [mobileOpen, setMobileOpen] = useState(false)
const pathname = usePathname()
return (
<header className="bg-white shadow-sm sticky top-0 z-50">
<nav className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between items-center h-16">
{/* Logo */}
<Link href="/" className="flex items-center space-x-2">
<span className="text-2xl font-bold text-primary-600">B</span>
<span className="text-xl font-bold text-gray-900 font-burmese">
Burmddit
</span>
<Link href="/" className="flex items-center space-x-2 flex-shrink-0">
<span className="w-8 h-8 bg-primary rounded-lg flex items-center justify-center text-white font-bold text-lg">B</span>
<span className="text-xl font-bold text-gray-900 font-burmese">Burmddit</span>
</Link>
{/* Navigation */}
<div className="hidden md:flex space-x-8">
<Link
href="/"
className="text-gray-700 hover:text-primary-600 font-medium font-burmese"
>
က
</Link>
<Link
href="/category/ai-news"
className="text-gray-700 hover:text-primary-600 font-medium font-burmese"
>
AI
</Link>
<Link
href="/category/tutorials"
className="text-gray-700 hover:text-primary-600 font-medium font-burmese"
>
</Link>
<Link
href="/category/tips-tricks"
className="text-gray-700 hover:text-primary-600 font-medium font-burmese"
>
ကက
</Link>
{/* Desktop Nav */}
<div className="hidden md:flex items-center space-x-1">
{navLinks.map((link) => (
<Link
key={link.href}
href={link.href}
className={`px-3 py-2 rounded-lg text-sm font-medium font-burmese transition-colors ${
pathname === link.href
? 'bg-primary/10 text-primary'
: 'text-gray-700 hover:text-primary hover:bg-gray-100'
}`}
>
{link.label}
</Link>
))}
</div>
{/* Search Icon */}
<button className="p-2 text-gray-600 hover:text-primary-600">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
{/* Right: Search + Mobile Hamburger */}
<div className="flex items-center space-x-1">
<Link
href="/search"
className="p-2 text-gray-600 hover:text-primary hover:bg-gray-100 rounded-lg transition-colors"
aria-label="ရှာဖွေရန်"
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</Link>
{/* Hamburger */}
<button
className="md:hidden p-2 text-gray-600 hover:text-primary hover:bg-gray-100 rounded-lg transition-colors"
onClick={() => setMobileOpen(!mobileOpen)}
aria-label="Menu"
>
{mobileOpen ? (
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
</svg>
) : (
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
</svg>
)}
</button>
</div>
</div>
{/* Mobile Menu */}
{mobileOpen && (
<div className="md:hidden pb-4 pt-2 border-t border-gray-100 space-y-1">
{navLinks.map((link) => (
<Link
key={link.href}
href={link.href}
onClick={() => setMobileOpen(false)}
className={`block px-4 py-3 rounded-lg text-sm font-medium font-burmese transition-colors ${
pathname === link.href
? 'bg-primary/10 text-primary'
: 'text-gray-700 hover:text-primary hover:bg-gray-50'
}`}
>
{link.label}
</Link>
))}
<Link
href="/search"
onClick={() => setMobileOpen(false)}
className="block px-4 py-3 rounded-lg text-sm font-medium font-burmese text-gray-700 hover:text-primary hover:bg-gray-50 transition-colors"
>
🔍
</Link>
</div>
)}
</nav>
</header>
)

View File

@@ -0,0 +1,51 @@
'use client'
import { useEffect, useState } from 'react'
export default function ShareButtons({ title }: { title: string }) {
const [url, setUrl] = useState('')
useEffect(() => {
setUrl(window.location.href)
}, [])
const encodedUrl = encodeURIComponent(url)
const encodedTitle = encodeURIComponent(title)
return (
<div className="flex flex-wrap gap-3">
<a
href={`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-2 px-5 py-2.5 bg-blue-600 text-white rounded-full text-sm font-semibold hover:bg-blue-700 transition-colors"
>
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
</svg>
Facebook
</a>
<a
href={`https://twitter.com/intent/tweet?url=${encodedUrl}&text=${encodedTitle}`}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-2 px-5 py-2.5 bg-black text-white rounded-full text-sm font-semibold hover:bg-gray-800 transition-colors"
>
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
</svg>
X (Twitter)
</a>
<a
href={`https://wa.me/?text=${encodedTitle}%20${encodedUrl}`}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 text-white rounded-full text-sm font-semibold hover:bg-green-700 transition-colors"
>
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
<path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/>
</svg>
WhatsApp
</a>
</div>
)
}