a tool for shared writing and social publishing

grab bag of little fixes to make things smoother

+67 -45
+1 -1
app/lish/[did]/[publication]/theme-settings/PostPreview.tsx
··· 136 136 ], 137 137 }} 138 138 > 139 - <div className="w-fit pointer-events-none h-full py-2 sm:py-6"> 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
··· 71 71 } 72 72 asChild 73 73 > 74 - <form 75 - className="flex flex-col overflow-y-auto max-h-(--radix-popover-content-available-height)" 76 - onSubmit={async (e) => { 77 - e.preventDefault(); 78 - let result = await submitTheme(setLoading); 79 - if (result?.success) { 80 - toaster({ content: "Theme updated!", type: "success" }); 81 - } 82 - }} 74 + <BaseThemeProvider 75 + local 76 + {...localPubTheme} 77 + headingFontId={headingFont} 78 + bodyFontId={bodyFont} 79 + hasBackgroundImage={!!image} 80 + pageWidth={pageWidth} 83 81 > 84 - {/* Toggle + Save Header */} 85 - <div className="flex items-center justify-between px-3 pt-3 pb-2"> 86 - <div className="font-bold text-[#272727]">Preview Mode</div> 87 - <ToggleGroup 88 - value={previewMode} 89 - optionClassName="text-base!" 90 - onChange={setPreviewMode} 91 - options={[ 92 - { value: "post", label: "Post" }, 93 - { value: "pub", label: "Pub" }, 94 - ]} 95 - /> 96 - </div> 82 + <div className="flex flex-col overflow-y-auto max-h-(--radix-popover-content-available-height) py-3"> 83 + <div className="p-3 pt-0 "> 84 + <ButtonPrimary 85 + fullWidth 86 + type="button" 87 + disabled={loading} 88 + onClick={async () => { 89 + let result = await submitTheme(setLoading); 90 + if (result?.success) { 91 + toaster({ 92 + content: "Theme updated!", 93 + type: "success", 94 + }); 95 + } 96 + }} 97 + > 98 + {loading ? <DotLoader /> : "Update"} 99 + </ButtonPrimary> 100 + </div> 97 101 98 - <div className="px-3 pb-3 gap-2 flex flex-col"> 99 - <PubThemePickerPanel state={state} /> 100 - </div> 101 - <div className="p-3 pt-0!"> 102 - <ButtonPrimary fullWidth type="submit" disabled={loading}> 103 - {loading ? <DotLoader /> : "Update"} 104 - </ButtonPrimary> 102 + {/* Toggle + Save Header */} 103 + <div className="flex items-center justify-between px-3"> 104 + <div className="font-bold text-[#595959]">Preview Mode</div> 105 + <ToggleGroup 106 + value={previewMode} 107 + optionClassName="text-base!" 108 + onChange={setPreviewMode} 109 + options={[ 110 + { value: "post", label: "Post" }, 111 + { value: "pub", label: "Pub" }, 112 + ]} 113 + /> 114 + </div> 115 + <div className="p-3 gap-2 flex flex-col"> 116 + <PubThemePickerPanel state={state} /> 117 + </div> 105 118 </div> 106 - </form> 119 + </BaseThemeProvider> 107 120 </Popover> 108 121 </div> 109 122 ··· 114 127 localBgImage={pubBGImage} 115 128 localBgImageRepeat={leafletBGRepeat} 116 129 > 117 - <div className="mx-auto h-full w-fit"> 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
··· 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 + 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
··· 114 114 } 115 115 }} 116 116 trigger={ 117 - <button className="w-[72px] text-left bg-transparent outline-hidden truncate"> 117 + <div className="w-[72px] text-left bg-transparent outline-hidden truncate"> 118 118 {hexString} 119 - </button> 119 + </div> 120 120 } 121 121 > 122 122 <div className="flex flex-col gap-2">
+2 -1
components/ThemeManager/PubPickers/PubBackgroundPickers.tsx
··· 145 145 <> 146 146 <div className="bgPickerColorLabel flex gap-2 items-center"> 147 147 <button 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 - <button onClick={() => props.setBgImage(null)}> 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
··· 173 173 <div 174 174 className={`themeBgPicker flex flex-col gap-0 -mb-[6px] z-10 w-full `} 175 175 > 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 + <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 - <form 295 - className="flex-shrink-0" 296 - onSubmit={async (e) => { 297 - e.preventDefault(); 298 - await submitTheme(props.setLoading); 299 - }} 300 - > 301 - <button onClick={props.backToMenu}> 294 + <div className="flex-shrink-0"> 295 + <button type="button" onClick={props.backToMenu}> 302 296 <GoToArrow /> 303 297 </button> 304 - </form> 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 + 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 + 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 + </div> 322 + <div className="pt-2"> 323 + <ButtonPrimary 324 + fullWidth 325 + disabled={props.loading} 326 + onClick={async () => { 327 + await submitTheme(props.setLoading); 328 + }} 329 + > 330 + {props.loading ? "Saving..." : "Save Theme"} 331 + </ButtonPrimary> 325 332 </div> 326 333 </div> 327 334 </div>