Repository navigation
Expand file tree
/
Copy pathcreatepostlog.diff
More file actions
147 lines (136 loc) · 16.3 KB
/
Copy pathcreatepostlog.diff
File metadata and controls
147 lines (136 loc) · 16.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
commit 089ecbc5bb8c8c4648ef7c552bd45113b02e99fc
Author: zebragum <zthammond@gmail.com>
Date: Fri Mar 13 10:38:46 2026 -0700
style: refine CreatePost UI layout
diff --git a/src/components/CreatePost.tsx b/src/components/CreatePost.tsx
index a50975e..605cede 100644
--- a/src/components/CreatePost.tsx
+++ b/src/components/CreatePost.tsx
@@ -125,7 +125,7 @@ export default function CreatePost() {
const isCropping = cropIndex >= 0;
return (
- <div className="create-post-view" style={{ display: 'flex', flexDirection: 'column', height: '100%', padding: '20px 20px 100px 20px', overflowY: 'auto' }}>
+ <div className="create-post-view" style={{ display: 'flex', flexDirection: 'column', height: '100%', padding: '12px 16px 80px 16px', overflowY: 'auto' }}>
{/* 1. Dynamic Image Area / Preview */}
{isCropping ? (
@@ -141,12 +141,27 @@ export default function CreatePost() {
/>
</div>
) : hasImages ? (
- <div style={{ position: 'relative', width: '100%', aspectRatio: '1', borderRadius: '12px', overflow: 'hidden', border: `3px solid var(--color-${bgColor})`, marginBottom: '16px' }}>
+ <div style={{ position: 'relative', width: '100%', aspectRatio: '1', borderRadius: '12px', overflow: 'hidden', border: `3px solid var(--color-${bgColor})`, marginBottom: '12px' }}>
<img src={images[0]} alt="Preview" style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
<button
onClick={() => removeImage(0)}
style={{ position: 'absolute', top: 8, right: 8, background: 'rgba(0,0,0,0.6)', color: 'white', border: 'none', borderRadius: '50%', width: 32, height: 32, cursor: 'pointer', fontSize: '1rem', zIndex: 10 }}
>Γ£ò</button>
+
+ {/* Add Image (+) button moved here */}
+ <button
+ onClick={() => galleryRef.current?.click()}
+ style={{
+ position: 'absolute', bottom: 12, right: 12,
+ background: 'var(--color-lavender)', color: 'white', border: 'none', borderRadius: '50%', width: 44, height: 44, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.4)', zIndex: 20
+ }}
+ >
+ <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
+ <path d="M12 5v14M5 12h14" />
+ </svg>
+ </button>
+
{images.length > 1 && (
<div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, display: 'flex', gap: '4px', padding: '4px', flexWrap: 'nowrap', background: 'rgba(0,0,0,0.6)', overflowX: 'auto' }}>
{images.slice(1).map((src, i) => (
@@ -246,7 +261,7 @@ export default function CreatePost() {
<div style={{ flex: 1 }} />
{/* 3. BUNDLED CONTROLS AT BOTTOM */}
- <div style={{ display: 'flex', flexDirection: 'column', gap: '16px', background: 'rgba(255,255,255,0.05)', padding: '16px', borderRadius: '16px' }}>
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '12px', background: 'rgba(255,255,255,0.05)', padding: '12px', borderRadius: '16px' }}>
<textarea
className="caption-input"
@@ -262,36 +277,38 @@ export default function CreatePost() {
/>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '12px', alignItems: 'center', justifyContent: 'center' }}>
- {/* Color Palette */}
- <div style={{ display: 'flex', gap: '10px' }}>
- {colors.map(color => (
- <button
- key={color}
- style={{
- backgroundColor: `var(--color-${color})`,
- width: bgColor === color ? '32px' : '26px',
- height: bgColor === color ? '32px' : '26px',
- borderRadius: '50%', flexShrink: 0,
- border: color === 'transparent' ? '1px solid rgba(255,255,255,0.5)' : 'none',
- boxShadow: bgColor === color ? '0 0 0 2px white inset' : 'none',
- cursor: 'pointer'
- }}
- onClick={() => setBgColor(color)}
- />
- ))}
- </div>
+ {/* Color Palette - ONLY if no images */}
+ {!hasImages && (
+ <div style={{ display: 'flex', gap: '10px' }}>
+ {colors.map(color => (
+ <button
+ key={color}
+ style={{
+ backgroundColor: `var(--color-${color})`,
+ width: bgColor === color ? '32px' : '26px',
+ height: bgColor === color ? '32px' : '26px',
+ borderRadius: '50%', flexShrink: 0,
+ border: color === 'transparent' ? '1px solid rgba(255,255,255,0.5)' : 'none',
+ boxShadow: bgColor === color ? '0 0 0 2px white inset' : 'none',
+ cursor: 'pointer'
+ }}
+ onClick={() => setBgColor(color)}
+ />
+ ))}
+ </div>
+ )}
- {/* Scope Toggle */}
- <div style={{ display: 'flex', background: 'rgba(0,0,0,0.3)', borderRadius: '16px', padding: '3px' }}>
+ {/* Scope Toggle - CENTERED */}
+ <div style={{ display: 'flex', background: 'rgba(0,0,0,0.3)', borderRadius: '16px', padding: '3px', margin: '0 auto' }}>
{(['everyone', 'private'] as const).map(s => (
<button
key={s}
type="button"
onClick={() => setScope(s)}
style={{
- padding: '4px 12px', borderRadius: '14px', border: 'none',
+ padding: '4px 16px', borderRadius: '14px', border: 'none',
background: scope === s ? 'var(--color-orange)' : 'transparent',
- color: 'white', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'inherit', fontSize: '0.8rem'
+ color: 'white', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'inherit', fontSize: '0.85rem'
}}
>
{s.charAt(0).toUpperCase() + s.slice(1)}
@@ -302,7 +319,7 @@ export default function CreatePost() {
{/* Multi-Topic Selection (only if scope is groups) */}
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', position: 'relative' }}>
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<input
type="datetime-local"
value={customDate}
@@ -312,19 +329,6 @@ export default function CreatePost() {
borderRadius: '8px', padding: '6px 10px', color: 'white', fontFamily: 'inherit', fontSize: '0.8rem'
}}
/>
- {hasImages && (
- <button
- onClick={() => galleryRef.current?.click()}
- style={{
- position: 'absolute', right: 0,
- background: 'var(--color-lavender)', color: 'white', border: 'none', borderRadius: '50%', width: 40, height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer'
- }}
- >
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M12 5v14M5 12h14" />
- </svg>
- </button>
- )}
</div>
</div>