tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
298
fork
atom
a tool for shared writing and social publishing
298
fork
atom
overview
issues
31
pulls
3
pipelines
grab bag of little fixes to make things smoother
cozylittle.house
1 week ago
45ed95d0
32ffd27c
+67
-45
6 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
theme-settings
PostPreview.tsx
ThemeSettingsContent.tsx
components
ThemeManager
Pickers
ColorPicker.tsx
HexKeyboard.tsx
PubPickers
PubBackgroundPickers.tsx
PubThemeSetter.tsx
+1
-1
app/lish/[did]/[publication]/theme-settings/PostPreview.tsx
reviewed
···
136
136
],
137
137
}}
138
138
>
139
139
-
<div className="w-fit pointer-events-none h-full py-2 sm:py-6">
139
139
+
<div className="w-fit h-full py-2 sm:py-6">
140
140
<LinearDocumentPage
141
141
document={fakeDocument}
142
142
did={profile.did || FAKE_DID}
+44
-31
app/lish/[did]/[publication]/theme-settings/ThemeSettingsContent.tsx
reviewed
···
71
71
}
72
72
asChild
73
73
>
74
74
-
<form
75
75
-
className="flex flex-col overflow-y-auto max-h-(--radix-popover-content-available-height)"
76
76
-
onSubmit={async (e) => {
77
77
-
e.preventDefault();
78
78
-
let result = await submitTheme(setLoading);
79
79
-
if (result?.success) {
80
80
-
toaster({ content: "Theme updated!", type: "success" });
81
81
-
}
82
82
-
}}
74
74
+
<BaseThemeProvider
75
75
+
local
76
76
+
{...localPubTheme}
77
77
+
headingFontId={headingFont}
78
78
+
bodyFontId={bodyFont}
79
79
+
hasBackgroundImage={!!image}
80
80
+
pageWidth={pageWidth}
83
81
>
84
84
-
{/* Toggle + Save Header */}
85
85
-
<div className="flex items-center justify-between px-3 pt-3 pb-2">
86
86
-
<div className="font-bold text-[#272727]">Preview Mode</div>
87
87
-
<ToggleGroup
88
88
-
value={previewMode}
89
89
-
optionClassName="text-base!"
90
90
-
onChange={setPreviewMode}
91
91
-
options={[
92
92
-
{ value: "post", label: "Post" },
93
93
-
{ value: "pub", label: "Pub" },
94
94
-
]}
95
95
-
/>
96
96
-
</div>
82
82
+
<div className="flex flex-col overflow-y-auto max-h-(--radix-popover-content-available-height) py-3">
83
83
+
<div className="p-3 pt-0 ">
84
84
+
<ButtonPrimary
85
85
+
fullWidth
86
86
+
type="button"
87
87
+
disabled={loading}
88
88
+
onClick={async () => {
89
89
+
let result = await submitTheme(setLoading);
90
90
+
if (result?.success) {
91
91
+
toaster({
92
92
+
content: "Theme updated!",
93
93
+
type: "success",
94
94
+
});
95
95
+
}
96
96
+
}}
97
97
+
>
98
98
+
{loading ? <DotLoader /> : "Update"}
99
99
+
</ButtonPrimary>
100
100
+
</div>
97
101
98
98
-
<div className="px-3 pb-3 gap-2 flex flex-col">
99
99
-
<PubThemePickerPanel state={state} />
100
100
-
</div>
101
101
-
<div className="p-3 pt-0!">
102
102
-
<ButtonPrimary fullWidth type="submit" disabled={loading}>
103
103
-
{loading ? <DotLoader /> : "Update"}
104
104
-
</ButtonPrimary>
102
102
+
{/* Toggle + Save Header */}
103
103
+
<div className="flex items-center justify-between px-3">
104
104
+
<div className="font-bold text-[#595959]">Preview Mode</div>
105
105
+
<ToggleGroup
106
106
+
value={previewMode}
107
107
+
optionClassName="text-base!"
108
108
+
onChange={setPreviewMode}
109
109
+
options={[
110
110
+
{ value: "post", label: "Post" },
111
111
+
{ value: "pub", label: "Pub" },
112
112
+
]}
113
113
+
/>
114
114
+
</div>
115
115
+
<div className="p-3 gap-2 flex flex-col">
116
116
+
<PubThemePickerPanel state={state} />
117
117
+
</div>
105
118
</div>
106
106
-
</form>
119
119
+
</BaseThemeProvider>
107
120
</Popover>
108
121
</div>
109
122
···
114
127
localBgImage={pubBGImage}
115
128
localBgImageRepeat={leafletBGRepeat}
116
129
>
117
117
-
<div className="mx-auto h-full w-fit">
130
130
+
<div className="mx-auto h-full w-fit pointer-events-none">
118
131
{previewMode === "pub" ? (
119
132
<PubPreview
120
133
showPageBackground={showPageBackground}
+1
components/ThemeManager/Pickers/ColorPicker.tsx
reviewed
···
43
43
<div className="flex flex-col w-full gap-2">
44
44
<div className="colorPickerLabel flex gap-2 items-center ">
45
45
<button
46
46
+
type="button"
46
47
disabled={props.disabled}
47
48
className="flex gap-2 items-center disabled:text-tertiary"
48
49
onClick={() => {
+2
-2
components/ThemeManager/Pickers/HexKeyboard.tsx
reviewed
···
114
114
}
115
115
}}
116
116
trigger={
117
117
-
<button className="w-[72px] text-left bg-transparent outline-hidden truncate">
117
117
+
<div className="w-[72px] text-left bg-transparent outline-hidden truncate">
118
118
{hexString}
119
119
-
</button>
119
119
+
</div>
120
120
}
121
121
>
122
122
<div className="flex flex-col gap-2">
+2
-1
components/ThemeManager/PubPickers/PubBackgroundPickers.tsx
reviewed
···
145
145
<>
146
146
<div className="bgPickerColorLabel flex gap-2 items-center">
147
147
<button
148
148
+
type="button"
148
149
disabled={props.disabled}
149
150
onClick={() => {
150
151
if (props.openPicker === props.thisPicker) {
···
170
171
<div className="italic text-[#8C8C8C]">image</div>
171
172
</button>
172
173
<div className="flex gap-1 text-[#8C8C8C]">
173
173
-
<button onClick={() => props.setBgImage(null)}>
174
174
+
<button type="button" onClick={() => props.setBgImage(null)}>
174
175
<DeleteSmall />
175
176
</button>
176
177
<label className="hover:cursor-pointer ">
+17
-10
components/ThemeManager/PubThemeSetter.tsx
reviewed
···
173
173
<div
174
174
className={`themeBgPicker flex flex-col gap-0 -mb-[6px] z-10 w-full `}
175
175
>
176
176
-
<div className="bgPickerBody w-full flex flex-col gap-2 p-2 mt-1 border border-[#CCCCCC] rounded-md text-[#595959] bg-white">
176
176
+
<div className="bgPickerBody w-full flex flex-col gap-2 p-2 border border-[#CCCCCC] rounded-md text-[#595959] bg-white">
177
177
<PubPageWidthSetter
178
178
pageWidth={pageWidth}
179
179
setPageWidth={setPageWidth}
···
291
291
className="min-h-0!"
292
292
>
293
293
<div className="min-h-0 flex-1 flex flex-col pb-0.5">
294
294
-
<form
295
295
-
className="flex-shrink-0"
296
296
-
onSubmit={async (e) => {
297
297
-
e.preventDefault();
298
298
-
await submitTheme(props.setLoading);
299
299
-
}}
300
300
-
>
301
301
-
<button onClick={props.backToMenu}>
294
294
+
<div className="flex-shrink-0">
295
295
+
<button type="button" onClick={props.backToMenu}>
302
296
<GoToArrow />
303
297
</button>
304
304
-
</form>
298
298
+
</div>
305
299
306
300
<div className="themeSetterContent flex flex-col w-full overflow-y-scroll min-h-0 -mb-2 pt-2 ">
307
301
<PubThemePickerPanel state={state} />
···
310
304
<div className="text-sm">Preview</div>
311
305
<Separator classname="h-4!" />{" "}
312
306
<button
307
307
+
type="button"
313
308
className={`${sample === "pub" ? "font-bold text-[#595959]" : ""}`}
314
309
onClick={() => setSample("pub")}
315
310
>
316
311
Pub
317
312
</button>
318
313
<button
314
314
+
type="button"
319
315
className={`${sample === "post" ? "font-bold text-[#595959]" : ""}`}
320
316
onClick={() => setSample("post")}
321
317
>
322
318
Post
323
319
</button>
324
320
</div>
321
321
+
</div>
322
322
+
<div className="pt-2">
323
323
+
<ButtonPrimary
324
324
+
fullWidth
325
325
+
disabled={props.loading}
326
326
+
onClick={async () => {
327
327
+
await submitTheme(props.setLoading);
328
328
+
}}
329
329
+
>
330
330
+
{props.loading ? "Saving..." : "Save Theme"}
331
331
+
</ButtonPrimary>
325
332
</div>
326
333
</div>
327
334
</div>