Skip to content

Commit b04073b

Browse files
authored
v2.18.4 (#263)
2 parents de6ddc5 + c53ed0b commit b04073b

7 files changed

Lines changed: 27 additions & 63 deletions

File tree

app/(Layout)/splitBlockNew.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const SplitBlock = ({ children }: { children: React.ReactNode }) => {
44
const blocks = React.Children.toArray(children);
55

66
return (
7-
<div className="w-[90vw] h-full rounded-[1.8rem] mx-auto grid grid-cols-12 gap-4 overflow-hidden">
8-
<div className="col-span-8 max-w-[90vw] h-full rounded-[1.2rem] overflow-y-auto scrollbar-hide bg-transparent xl:col-span-8 lg:col-span-8 md:col-span-8">
7+
<div className="w-[90vw] h-full rounded-[1.5rem] mx-auto grid grid-cols-12 gap-4 overflow-hidden">
8+
<div className="col-span-8 max-w-[90vw] h-full rounded-[1.2rem] overflow-y-hidden scrollbar-hide bg-transparent xl:col-span-8 lg:col-span-8 md:col-span-8">
99
{blocks[0]}
1010
</div>
1111
<div className="h-full col-span-4 overflow-y-hidden xl:col-span-4 lg:col-span-4 md:col-span-4">

app/new/page.module.scss

Lines changed: 0 additions & 9 deletions
This file was deleted.

components/PostEditor/desktop/Buttons.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ export default function Buttons({
2727
className={`
2828
flex flex-row justify-center items-center text-center rounded-full gap-1 text-lg font-bold
2929
transition-colors
30-
${
31-
postButtonDisable
32-
? "bg-gray-300 text-gray-500 cursor-not-allowed"
33-
: "bg-white text-[#5fcdf5] hover:bg-gray-50"
30+
${postButtonDisable
31+
? "bg-gray-300 text-gray-500 cursor-not-allowed"
32+
: "bg-white text-[#5fcdf5] hover:bg-gray-50"
3433
}
3534
`}
3635
onClick={async () => await postFunction()}

components/PostEditor/desktop/Editor.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$editor-background: white;
44

55
.editor {
6-
height: calc(70dvh - 3rem);
6+
height: calc(70dvh - 4.5rem);
77
padding: 0.25rem 0;
88
background-color: $editor-background;
99
border-radius: variables.$border-radius;

components/PostEditor/desktop/MetaDataForm.tsx

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export default function MetaDataForm({
3535
const [tagInput, setTagInput] = useState("");
3636
const [tags, setTags] = useState<string[]>([]);
3737

38-
// 從 data 初始化 tags
3938
useEffect(() => {
4039
if (data?.hashtag) {
4140
setTags(Array.isArray(data.hashtag) ? data.hashtag : []);
@@ -55,12 +54,7 @@ export default function MetaDataForm({
5554
const handleDragOver = (e: React.DragEvent) => {
5655
e.preventDefault();
5756
e.stopPropagation();
58-
59-
// 檢查登入狀態
60-
if (status !== "authenticated") {
61-
return;
62-
}
63-
57+
if (status !== "authenticated") return;
6458
setIsDragging(true);
6559
};
6660

@@ -75,57 +69,43 @@ export default function MetaDataForm({
7569
e.stopPropagation();
7670
setIsDragging(false);
7771

78-
// 檢查登入狀態
7972
if (status !== "authenticated") {
8073
showLoginAlert();
8174
return;
8275
}
8376

8477
if (e.dataTransfer.files && e.dataTransfer.files[0] && handleFileChange) {
8578
const mockEvent = {
86-
target: {
87-
files: e.dataTransfer.files,
88-
},
79+
target: { files: e.dataTransfer.files },
8980
} as any;
9081
handleFileChange(mockEvent);
9182
}
9283
};
9384

9485
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
95-
// 檢查登入狀態
9686
if (status !== "authenticated") {
9787
showLoginAlert();
98-
e.target.value = ""; // 清空 input
88+
e.target.value = "";
9989
return;
10090
}
101-
102-
// console.log("File input changed:", e.target.files);
103-
if (handleFileChange) {
104-
handleFileChange(e);
105-
}
91+
if (handleFileChange) handleFileChange(e);
10692
};
10793

10894
const handleFileInputClick = (e: React.MouseEvent<HTMLLabelElement>) => {
109-
// 檢查登入狀態
11095
if (status !== "authenticated") {
11196
e.preventDefault();
11297
showLoginAlert();
113-
return;
11498
}
11599
};
116100

117101
const handleRemoveCover = (e: React.MouseEvent) => {
118102
e.preventDefault();
119103
e.stopPropagation();
120-
121104
if (handleFormEventFunction) {
122105
handleFormEventFunction({ target: { name: "cover", value: "" } });
123106
}
124-
125107
const fileInput = document.getElementById("file") as HTMLInputElement;
126-
if (fileInput) {
127-
fileInput.value = "";
128-
}
108+
if (fileInput) fileInput.value = "";
129109
};
130110

131111
const handleAddTag = () => {
@@ -134,8 +114,6 @@ export default function MetaDataForm({
134114
const newTags = [...tags, trimmedTag];
135115
setTags(newTags);
136116
setTagInput("");
137-
138-
// 更新父組件的 data
139117
if (handleFormEventFunction) {
140118
handleFormEventFunction({
141119
target: { name: "hashtag", value: newTags },
@@ -147,8 +125,6 @@ export default function MetaDataForm({
147125
const handleRemoveTag = (tagToRemove: string) => {
148126
const newTags = tags.filter((tag) => tag !== tagToRemove);
149127
setTags(newTags);
150-
151-
// 更新父組件的 data
152128
if (handleFormEventFunction) {
153129
handleFormEventFunction({ target: { name: "hashtag", value: newTags } });
154130
}
@@ -161,26 +137,24 @@ export default function MetaDataForm({
161137
}
162138
};
163139

164-
if (status === "loading") {
165-
return <div></div>;
166-
}
140+
if (status === "loading") return <div></div>;
167141

168142
return (
169-
<div className="flex flex-col h-full">
170-
{/* Main Content - 佔據剩餘空間 */}
171-
<div className="bg-white rounded-2xl p-4 flex flex-col gap-4 flex-1 overflow-auto">
143+
<div className="flex flex-col h-full gap-1">
144+
{/* 白色卡片 - 只有 Cover 和 Hashtag */}
145+
<div className="flex-1 min-h-0 bg-white rounded-2xl p-4 overflow-y-auto scrollbar-hide">
172146
{/* Cover Section */}
173-
<div className="flex flex-col flex-1 min-h-0 max-h-[10rem]">
174-
<label className="font-semibold text-gray-700 text-lg mb-2">
147+
<div className="mb-6">
148+
<label className="font-semibold text-gray-700 text-lg mb-2 block">
175149
Cover
176150
</label>
177151

178152
{data?.cover && data.cover !== "" ? (
179-
<div className="flex flex-col flex-1 relative group min-h-[10.5rem]">
153+
<div className="relative group h-40">
180154
<label
181155
htmlFor="file"
182156
onClick={handleFileInputClick}
183-
className="flex-1 bg-cover bg-center bg-no-repeat rounded-lg h-full cursor-pointer relative overflow-hidden"
157+
className="block w-full h-full bg-cover bg-center bg-no-repeat rounded-lg cursor-pointer relative overflow-hidden"
184158
style={{
185159
backgroundImage: (data.cover.includes("http")
186160
? `url(${data.cover})`
@@ -218,7 +192,7 @@ export default function MetaDataForm({
218192
htmlFor="file"
219193
onClick={handleFileInputClick}
220194
className={`
221-
flex-1 border-2 border-dashed rounded-lg cursor-pointer transition-all
195+
w-full h-40 border-2 border-dashed rounded-lg cursor-pointer transition-all
222196
flex flex-col justify-center items-center gap-2 p-8
223197
${isDragging
224198
? "border-[#4ab8e0] bg-blue-100 scale-[0.98]"
@@ -249,7 +223,7 @@ export default function MetaDataForm({
249223
</div>
250224

251225
{/* Hashtag Section */}
252-
<div className="flex flex-col gap-2 mt-12">
226+
<div className="flex flex-col gap-2">
253227
<label
254228
className="font-semibold text-gray-700 text-lg"
255229
htmlFor="tagInput"
@@ -281,7 +255,7 @@ export default function MetaDataForm({
281255

282256
{/* Tags Display */}
283257
{tags.length > 0 && (
284-
<div className="max-h-[12rem] small-scrollbar flex overflow-auto">
258+
<div className="max-h-48 overflow-y-auto">
285259
<div className="flex flex-wrap gap-2">
286260
{tags.map((tag, index) => (
287261
<span
@@ -304,8 +278,8 @@ export default function MetaDataForm({
304278
</div>
305279
</div>
306280

307-
{/* Buttons - 固定在底部 */}
308-
<div>
281+
{/* 按鈕區域 - 獨立在下方 */}
282+
<div className="flex-shrink-0">
309283
<Buttons
310284
discardFunction={discardFunction}
311285
postFunction={postFunction}
@@ -315,4 +289,4 @@ export default function MetaDataForm({
315289
</div>
316290
</div>
317291
);
318-
}
292+
}

components/PostEditor/desktop/TitleSigForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function TitleSigForm({ data, handleFormEventFunction }: Props) {
4141
}, []);
4242

4343
return (
44-
<div className="w-full mb-2 h-10 flex items-center">
44+
<div className="w-full mb-2 h-10 flex items-center rounded-full">
4545
<input
4646
type="text"
4747
name="title"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mdsig-frontend",
3-
"version": "2.18.3",
3+
"version": "2.18.4",
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbopack",

0 commit comments

Comments
 (0)