Skip to content

Commit 4b4b071

Browse files
Fix : Made Responsive for the blog view, blog new and blog edit editor.
1 parent b9101da commit 4b4b071

File tree

3 files changed

+44
-42
lines changed

3 files changed

+44
-42
lines changed

frontend/src/Pages/Edit/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export const Edit = () => {
182182
value={data?.title}
183183
inputProps={{ className: "font-gara text-2xl" }}
184184
/>
185-
<div data-color-mode="light">
185+
<div data-color-mode="light" className="w-full">
186186
<MarkdownEditor
187187
value={data?.content}
188188
height="500px"

frontend/src/Pages/NewBlog/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const NewBlog = () => {
7777
return (
7878
<div className="flex flex-col justify-center items-center w-full my-4">
7979
<div className="flex flex-col flex-wrap gap-6 w-[95%] md:w-[50%]">
80-
<div className="flex flex-row justify-between items-center">
80+
<div className="flex flex-row w-full justify-between items-center">
8181
<div className="font-gara text-2xl md:text-4xl font-bold border-b-4 py-1 border-b-indigo-600 pe-6 select-none">
8282
Create New Blog
8383
</div>
@@ -131,7 +131,7 @@ export const NewBlog = () => {
131131
required
132132
inputProps={{ className: "font-gara text-2xl" }}
133133
/>
134-
<div data-color-mode="light">
134+
<div data-color-mode="light" className="w-full">
135135
<MarkdownEditor
136136
value={data?.content}
137137
height="500px"

frontend/src/components/BlogView/index.jsx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,47 +38,49 @@ export const BlogView = ({ blogdata }) => {
3838
}, [blogdata]);
3939

4040
return (
41-
<div className="flex my-5 flex-row w-full justify-center items-center">
42-
<div className="flex mx-4 flex-col justify-center gap-5 w-full items-center sm:w-[60%]">
43-
{imgsrc !== null ? (
44-
<div className="md:w-3/4">
45-
<img src={imgsrc} alt="Thumbnail" />
41+
<div className="flex my-5 flex-row justify-center items-center">
42+
<div className="flex flex-col justify-center gap-5 items-center w-full lg:w-1/2">
43+
<div className="flex flex-col justify-center items-center gap-3 w-full px-5">
44+
{imgsrc !== null ? (
45+
<div className="md:w-2/4 w-72">
46+
<img src={imgsrc} alt="Thumbnail" />
47+
</div>
48+
) : null}
49+
<div className="font-mono font-extrabold text-2xl sm:text-4xl self-start tracking-wide">
50+
{blogdata?.title}
4651
</div>
47-
) : null}
48-
<div className="font-mono font-extrabold text-2xl sm:text-4xl self-start tracking-wide">
49-
{blogdata?.title}
50-
</div>
51-
<div className="self-start font-mono italic">
52-
{readingTime(String(blogdata?.content), 50).text}
53-
</div>
54-
<div className="self-start flex flex-col gap-1 ">
55-
<Link
56-
to={`/author/${blogdata?.authorid}`}
57-
className="font-noto font-bold text-sm hover:border-b-2 border-indigo-700"
58-
>
59-
{blogdata?.name}
60-
</Link>
61-
<span className="font-raj select-none font-semibold italic text-sm">
62-
{moment(blogdata?.createdon).fromNow().toString()}
63-
</span>
64-
</div>
65-
<div
66-
className="font-noto self-start leading-relaxed tracking-wide"
67-
data-color-mode="light"
68-
>
69-
<MarkdownPreview
70-
source={blogdata?.content}
71-
rehypePlugins={[rehypeRaw, rehypeAutolinkHeadings]}
72-
remarkPlugins={[remarkGfm, remarkImages]}
73-
skipHtml
74-
/>
75-
</div>
76-
<div className="self-start">
77-
<span className="px-3 inline-block py-1 bg-neutral-100 rounded-2xl border-2 border-gray-400 font-meri text-xs">
78-
<Link to={`/tags/${blogdata?.tag}`}>
79-
<span>{blogdata?.tag}</span>
52+
<div className="self-start font-mono italic">
53+
{readingTime(String(blogdata?.content), 50).text}
54+
</div>
55+
<div className="self-start flex flex-col gap-1 ">
56+
<Link
57+
to={`/author/${blogdata?.authorid}`}
58+
className="font-noto font-bold text-sm hover:border-b-2 border-indigo-700"
59+
>
60+
{blogdata?.name}
8061
</Link>
81-
</span>
62+
<span className="font-raj select-none font-semibold italic text-sm">
63+
{moment(blogdata?.createdon).fromNow().toString()}
64+
</span>
65+
</div>
66+
<div
67+
className="w-full"
68+
data-color-mode="light"
69+
>
70+
<MarkdownPreview
71+
source={blogdata?.content}
72+
rehypePlugins={[rehypeRaw, rehypeAutolinkHeadings]}
73+
remarkPlugins={[remarkGfm, remarkImages]}
74+
skipHtml
75+
/>
76+
</div>
77+
<div className="self-start">
78+
<span className="px-3 inline-block py-1 bg-neutral-100 rounded-2xl border-2 border-gray-400 font-meri text-xs">
79+
<Link to={`/tags/${blogdata?.tag}`}>
80+
<span>{blogdata?.tag}</span>
81+
</Link>
82+
</span>
83+
</div>
8284
</div>
8385
<div className="space-y-2 font-meri text-sm">
8486
<span>Share on </span>

0 commit comments

Comments
 (0)