@@ -6,13 +6,12 @@ import { useParams } from 'react-router-dom';
66import { fetchSinglePost } from '@/service/ghostAPI' ;
77import { renderHTMLContent } from '@/util/renderHTMLContent' ;
88import { MONTHS } from '@/types/constant' ;
9- import BaseLayout from '@/layout/BaseLayout' ;
109import VistockBackground from '@/components/VistockBackground' ;
1110import DefaultImage from '@/assets/images/logo-sementara.jpeg' ;
1211import { DetailPost , DetailpageProps } from '@/types/interface' ;
1312import useFetch from '@/hooks/useFetch' ;
1413import RelatedPosts from './RelatedPosts' ;
15- import Loading from '../Loading' ;
14+ import { LoadingSpecific } from '../Loading' ;
1615import ErrorPage from '../ErrorPage' ;
1716
1817const Detailpage : React . FC < DetailpageProps > = ( ) => {
@@ -25,11 +24,7 @@ const Detailpage: React.FC<DetailpageProps> = () => {
2524 let published_at : string ;
2625
2726 if ( isLoading ) {
28- return (
29- < BaseLayout >
30- < Loading />
31- </ BaseLayout >
32- ) ;
27+ return < LoadingSpecific /> ;
3328 }
3429
3530 if ( error ) {
@@ -45,92 +40,90 @@ const Detailpage: React.FC<DetailpageProps> = () => {
4540 }
4641
4742 return (
48- < BaseLayout >
43+ < Flex
44+ background = "linear-gradient(180deg, #FF9165 -21.55%, #F9DCB0 100%)"
45+ className = "min-h-screen justify-center relative"
46+ >
47+ < VistockBackground />
48+ < Flex width = "15%" >
49+ < Box width = "100%" height = "100%" />
50+ </ Flex >
4951 < Flex
50- background = "linear-gradient(180deg, #FF9165 -21.55%, #F9DCB0 100%)"
51- className = "min-h-screen justify-center relative"
52+ className = "my-12 md:my-20 max-w-screen-lg"
53+ flexDirection = "column"
54+ width = "70%"
5255 >
53- < VistockBackground />
54- < Flex width = "15%" >
55- < Box width = "100%" height = "100%" />
56- </ Flex >
57- < Flex
58- className = "my-12 md:my-20 max-w-screen-lg"
59- flexDirection = "column"
60- width = "70%"
56+ < div className = "font-Body text-overline md:text-body cursor-pointer" >
57+ < a className = "hover:underline" href = "/" >
58+ Home
59+ </ a >
60+ { post ! . primary_tag && (
61+ < span >
62+ { ' ' }
63+ { '>' } { ' ' }
64+ < a
65+ className = "hover:underline"
66+ href = { `/search?${ post ! . primary_tag . name } ` }
67+ >
68+ { post ! . primary_tag . name }
69+ </ a >
70+ </ span >
71+ ) }
72+ </ div >
73+ < Box
74+ fontFamily = "Magilio"
75+ fontSize = { {
76+ base : '20px' ,
77+ md : '35px' ,
78+ } }
6179 >
62- < div className = "font-Body text-overline md:text-body cursor-pointer" >
63- < a className = "hover:underline" href = "/" >
64- Home
65- </ a >
66- { post ! . primary_tag && (
67- < span >
68- { ' ' }
69- { '>' } { ' ' }
70- < a
71- className = "hover:underline"
72- href = { `/search?${ post ! . primary_tag . name } ` }
73- >
74- { post ! . primary_tag . name }
75- </ a >
76- </ span >
77- ) }
78- </ div >
79- < Box
80- fontFamily = "Magilio"
81- fontSize = { {
82- base : '20px' ,
83- md : '35px' ,
84- } }
85- >
86- { post ! . title }
87- </ Box >
80+ { post ! . title }
81+ </ Box >
8882
89- { post ! . primary_author && (
90- < Box > Author: { post ! . primary_author . name } </ Box >
91- ) }
83+ { post ! . primary_author && (
84+ < Box > Author: { post ! . primary_author . name } </ Box >
85+ ) }
9286
93- < Box
94- fontFamily = "Alegreya"
95- fontSize = { {
96- base : '12px' ,
97- md : '18px' ,
98- } }
99- >
100- { published_at ! }
101- </ Box >
102- < VStack
103- spacing = { {
104- base : '12px' ,
105- md : '24px' ,
106- } }
107- className = "bg-[#D9D9D9] z-30 p-5 bg-opacity-[0.65]"
108- >
109- { post ! . feature_image ? (
110- < Box maxWidth = "w-full grid place-items-center" >
111- < img
112- className = "w-5/12 md:w-4/12 lg:w-3/12"
113- src = { post ! . feature_image }
114- alt = "featured"
115- />
116- </ Box >
117- ) : (
118- < Box className = "w-full grid place-items-center" >
119- < img
120- className = "w-5/12 md:w-4/12 lg:w-3/12"
121- src = { DefaultImage }
122- alt = "default-img"
123- />
124- </ Box >
125- ) }
87+ < Box
88+ fontFamily = "Alegreya"
89+ fontSize = { {
90+ base : '12px' ,
91+ md : '18px' ,
92+ } }
93+ >
94+ { published_at ! }
95+ </ Box >
96+ < VStack
97+ spacing = { {
98+ base : '12px' ,
99+ md : '24px' ,
100+ } }
101+ className = "bg-[#D9D9D9] z-30 p-5 bg-opacity-[0.65]"
102+ >
103+ { post ! . feature_image ? (
104+ < Box maxWidth = "w-full grid place-items-center" >
105+ < img
106+ className = "w-5/12 md:w-4/12 lg:w-3/12"
107+ src = { post ! . feature_image }
108+ alt = "featured"
109+ />
110+ </ Box >
111+ ) : (
112+ < Box className = "w-full grid place-items-center" >
113+ < img
114+ className = "w-5/12 md:w-4/12 lg:w-3/12"
115+ src = { DefaultImage }
116+ alt = "default-img"
117+ />
118+ </ Box >
119+ ) }
126120
127- { renderHTMLContent ( post ! ) }
128- </ VStack >
129- < RelatedPosts posts = { data . relatedPosts } />
130- </ Flex >
131- < Flex width = "15%" />
121+ { renderHTMLContent ( post ! ) }
122+ </ VStack >
123+ < RelatedPosts posts = { data . relatedPosts } />
132124 </ Flex >
133- </ BaseLayout >
125+ < Flex width = "15%" />
126+ </ Flex >
134127 ) ;
135128} ;
136129
0 commit comments