refact: new logo and look
This commit is contained in:
@@ -16,6 +16,7 @@ export default function PostDetail({ postId, user, onBack }) {
|
||||
const [volume, setVolume] = useState(1)
|
||||
const [downloading, setDownloading] = useState(false)
|
||||
const audioRef = useRef(null)
|
||||
const [audioSrc, setAudioSrc] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (postId) {
|
||||
@@ -34,6 +35,8 @@ export default function PostDetail({ postId, user, onBack }) {
|
||||
|
||||
// Load audio URL if available
|
||||
if (postData.audio_url && audioRef.current) {
|
||||
setPost(postData)
|
||||
setAudioSrc(postData.audio_url)
|
||||
audioRef.current.src = postData.audio_url
|
||||
audioRef.current.load()
|
||||
}
|
||||
@@ -290,12 +293,14 @@ export default function PostDetail({ postId, user, onBack }) {
|
||||
|
||||
<audio
|
||||
ref={audioRef}
|
||||
src={audioSrc}
|
||||
onTimeUpdate={handleTimeUpdate}
|
||||
onLoadedMetadata={handleLoadedMetadata}
|
||||
onEnded={handleEnded}
|
||||
preload="metadata"
|
||||
/>
|
||||
|
||||
|
||||
<div className="flex items-center gap-4 mb-4">
|
||||
<button
|
||||
onClick={togglePlay}
|
||||
|
||||
Reference in New Issue
Block a user