diff --git a/btw.sql b/btw.sql index 7dc9269d..75ffedad 100644 --- a/btw.sql +++ b/btw.sql @@ -96,5 +96,6 @@ CREATE TABLE "btw"."users" ( "pro" bool, "umami_site_id" uuid, "share_id" text, + "settings" json, PRIMARY KEY ("processed_email") ); diff --git a/publisher/routes/index.js b/publisher/routes/index.js index 0a0b77a1..0fdb9563 100644 --- a/publisher/routes/index.js +++ b/publisher/routes/index.js @@ -66,6 +66,7 @@ const getCommonDeets = ( instagram: user.instagram, umami_site_id: user.umami_site_id, umami_src: process.env.UMAMI_SOURCE, + settings: user.settings, }; }; diff --git a/publisher/views/index.hbs b/publisher/views/index.hbs index ca67147a..320c5e19 100644 --- a/publisher/views/index.hbs +++ b/publisher/views/index.hbs @@ -11,10 +11,10 @@
{{#each notes}} - + {{#not ../../settings.removeImagesInMainPage}}{{/not}}

{{title}}

-
{{readableDate}}
+
{{readableDate}}
{{{excerpt}}}
diff --git a/tasks/logic/user.js b/tasks/logic/user.js index 08426106..caf29f37 100644 --- a/tasks/logic/user.js +++ b/tasks/logic/user.js @@ -528,6 +528,7 @@ async function setUserDetails({ instagram, linkedin, user_id, + settings, }) { const tasksDB = await db.getTasksDB(); @@ -540,7 +541,8 @@ async function setUserDetails({ pic, twitter, instagram, - linkedin + linkedin, + settings ); if (!slug) { @@ -577,8 +579,18 @@ async function setUserDetails({ try { await tasksDB.query( - `UPDATE btw.users SET name = $1, slug = $2, bio = $3, pic = $4, twitter = $5, linkedin = $6, instagram = $7 WHERE id = $8`, - [name, slug, bio, pic, twitter, linkedin, instagram, user_id] + `UPDATE btw.users SET name = $1, slug = $2, bio = $3, pic = $4, twitter = $5, linkedin = $6, instagram = $7, settings = $8 WHERE id = $9`, + [ + name, + slug, + bio, + pic, + twitter, + linkedin, + instagram, + settings, + user_id, + ] ); userCacheHelper(user_id); diff --git a/tasks/routes/otp.js b/tasks/routes/otp.js index 8f6ba8af..7c576a16 100644 --- a/tasks/routes/otp.js +++ b/tasks/routes/otp.js @@ -20,7 +20,26 @@ router.post( origin: process.env.CORS_DOMAINS.split(","), }), async (req, res) => { - const { email } = req.body; + let { email } = req.body; + + if ( + !Number(process.env.TURN_OFF_SINGLE_USER_MODE) && + process.env.ADMIN_EMAIL + ) { + // Single user mode is on + email = process.env.ADMIN_EMAIL; + } + + if ( + !Number(process.env.TURN_OFF_SINGLE_USER_MODE) && + process.env.ADMIN_OTP + ) { + // admin otp is set. no need to email it. + res.json({ + success: true, + }); + return; + } // check that otp is in right format if (!email || !email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) { diff --git a/tasks/routes/user.js b/tasks/routes/user.js index 18635ec2..c46fb678 100644 --- a/tasks/routes/user.js +++ b/tasks/routes/user.js @@ -67,11 +67,9 @@ router.post( : {}), }); } else if ( - !Number( - process.env.TURN_OFF_SINGLE_USER_MODE && - !process.env.ADMIN_OTP && - loginToken - ) + !Number(process.env.TURN_OFF_SINGLE_USER_MODE) && + !process.env.ADMIN_OTP && + loginToken ) { // single user mode. otp is not set. loginToken exists. // check that this logintoken exists. if it doesn't exist, then delete the cookie so that user state will be forced to be reset @@ -182,6 +180,7 @@ router.post( twitter, linkedin, instagram, + settings, } = req.body || {}; // get loginToken as btw_uuid cookie @@ -203,6 +202,7 @@ router.post( twitter, linkedin, instagram, + settings, }) ); } catch (e) { diff --git a/writer/assets/media/styles.css b/writer/assets/media/styles.css index 3f32a059..5220db6c 100644 --- a/writer/assets/media/styles.css +++ b/writer/assets/media/styles.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com */ /* @@ -32,9 +32,11 @@ 4. Use the user's configured `sans` font-family by default. 5. Use the user's configured `sans` font-feature-settings by default. 6. Use the user's configured `sans` font-variation-settings by default. +7. Disable tap highlights on iOS */ -html { +html, +:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; @@ -42,12 +44,14 @@ html { /* 3 */ tab-size: 4; /* 3 */ - font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ font-feature-settings: normal; /* 5 */ font-variation-settings: normal; /* 6 */ + -webkit-tap-highlight-color: transparent; + /* 7 */ } /* @@ -119,8 +123,10 @@ strong { } /* -1. Use the user's configured `mono` font family by default. -2. Correct the odd `em` font sizing in all browsers. +1. Use the user's configured `mono` font-family by default. +2. Use the user's configured `mono` font-feature-settings by default. +3. Use the user's configured `mono` font-variation-settings by default. +4. Correct the odd `em` font sizing in all browsers. */ code, @@ -129,8 +135,12 @@ samp, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */ - font-size: 1em; + font-feature-settings: normal; /* 2 */ + font-variation-settings: normal; + /* 3 */ + font-size: 1em; + /* 4 */ } /* @@ -199,6 +209,8 @@ textarea { /* 1 */ line-height: inherit; /* 1 */ + letter-spacing: inherit; + /* 1 */ color: inherit; /* 1 */ margin: 0; @@ -222,9 +234,9 @@ select { */ button, -[type='button'], -[type='reset'], -[type='submit'] { +input:where([type='button']), +input:where([type='reset']), +input:where([type='submit']) { -webkit-appearance: button; /* 1 */ background-color: transparent; @@ -548,10 +560,22 @@ select { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e"); } +@media (forced-colors: active) { + [type='checkbox']:checked { + appearance: auto; + } +} + [type='radio']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); } +@media (forced-colors: active) { + [type='radio']:checked { + appearance: auto; + } +} + [type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus { border-color: transparent; background-color: currentColor; @@ -566,6 +590,12 @@ select { background-repeat: no-repeat; } +@media (forced-colors: active) { + [type='checkbox']:indeterminate { + appearance: auto; + } +} + [type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus { border-color: transparent; background-color: currentColor; @@ -640,6 +670,10 @@ input[type="number"]::-webkit-inner-spin-button, --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } ::backdrop { @@ -690,6 +724,10 @@ input[type="number"]::-webkit-inner-spin-button, --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } .container { @@ -771,7 +809,7 @@ input[type="number"]::-webkit-inner-spin-button, list-style-type: decimal; margin-top: 1.25em; margin-bottom: 1.25em; - padding-left: 1.625em; + padding-inline-start: 1.625em; } .prose :where(ol[type="A"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -814,7 +852,7 @@ input[type="number"]::-webkit-inner-spin-button, list-style-type: disc; margin-top: 1.25em; margin-bottom: 1.25em; - padding-left: 1.625em; + padding-inline-start: 1.625em; } .prose :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *))::marker { @@ -843,12 +881,12 @@ input[type="number"]::-webkit-inner-spin-button, font-weight: 500; font-style: italic; color: var(--tw-prose-quotes); - border-left-width: 0.25rem; - border-left-color: var(--tw-prose-quote-borders); + border-inline-start-width: 0.25rem; + border-inline-start-color: var(--tw-prose-quote-borders); quotes: "\201C""\201D""\2018""\2019"; margin-top: 1.6em; margin-bottom: 1.6em; - padding-left: 1em; + padding-inline-start: 1em; } .prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"],[class~="not-prose"] *))::before { @@ -925,6 +963,11 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 2em; } +.prose :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + margin-top: 2em; + margin-bottom: 2em; +} + .prose :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { font-weight: 500; font-family: inherit; @@ -933,9 +976,9 @@ input[type="number"]::-webkit-inner-spin-button, font-size: 0.875em; border-radius: 0.3125rem; padding-top: 0.1875em; - padding-right: 0.375em; + padding-inline-end: 0.375em; padding-bottom: 0.1875em; - padding-left: 0.375em; + padding-inline-start: 0.375em; } .prose :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -993,9 +1036,9 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 1.7142857em; border-radius: 0.375rem; padding-top: 0.8571429em; - padding-right: 1.1428571em; + padding-inline-end: 1.1428571em; padding-bottom: 0.8571429em; - padding-left: 1.1428571em; + padding-inline-start: 1.1428571em; } .prose :where(pre code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1021,7 +1064,7 @@ input[type="number"]::-webkit-inner-spin-button, .prose :where(table):not(:where([class~="not-prose"],[class~="not-prose"] *)) { width: 100%; table-layout: auto; - text-align: left; + text-align: start; margin-top: 2em; margin-bottom: 2em; font-size: 0.875em; @@ -1037,9 +1080,9 @@ input[type="number"]::-webkit-inner-spin-button, color: var(--tw-prose-headings); font-weight: 600; vertical-align: bottom; - padding-right: 0.5714286em; + padding-inline-end: 0.5714286em; padding-bottom: 0.5714286em; - padding-left: 0.5714286em; + padding-inline-start: 0.5714286em; } .prose :where(tbody tr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1122,22 +1165,17 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 0; } -.prose :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - margin-top: 2em; - margin-bottom: 2em; -} - .prose :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 0.5em; margin-bottom: 0.5em; } .prose :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0.375em; + padding-inline-start: 0.375em; } .prose :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0.375em; + padding-inline-start: 0.375em; } .prose :where(.prose > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1145,19 +1183,19 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 0.75em; } -.prose :where(.prose > ul > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose :where(.prose > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.25em; } -.prose :where(.prose > ul > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose :where(.prose > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-bottom: 1.25em; } -.prose :where(.prose > ol > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose :where(.prose > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.25em; } -.prose :where(.prose > ol > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose :where(.prose > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-bottom: 1.25em; } @@ -1173,7 +1211,7 @@ input[type="number"]::-webkit-inner-spin-button, .prose :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 0.5em; - padding-left: 1.625em; + padding-inline-start: 1.625em; } .prose :where(hr + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1193,26 +1231,26 @@ input[type="number"]::-webkit-inner-spin-button, } .prose :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0; + padding-inline-start: 0; } .prose :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0; + padding-inline-end: 0; } .prose :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { padding-top: 0.5714286em; - padding-right: 0.5714286em; + padding-inline-end: 0.5714286em; padding-bottom: 0.5714286em; - padding-left: 0.5714286em; + padding-inline-start: 0.5714286em; } .prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0; + padding-inline-start: 0; } .prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0; + padding-inline-end: 0; } .prose :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1248,7 +1286,7 @@ input[type="number"]::-webkit-inner-spin-button, .prose-sm :where(blockquote):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.3333333em; margin-bottom: 1.3333333em; - padding-left: 1.1111111em; + padding-inline-start: 1.1111111em; } .prose-sm :where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1302,9 +1340,9 @@ input[type="number"]::-webkit-inner-spin-button, font-size: 0.8571429em; border-radius: 0.3125rem; padding-top: 0.1428571em; - padding-right: 0.3571429em; + padding-inline-end: 0.3571429em; padding-bottom: 0.1428571em; - padding-left: 0.3571429em; + padding-inline-start: 0.3571429em; } .prose-sm :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1326,21 +1364,21 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 1.6666667em; border-radius: 0.25rem; padding-top: 0.6666667em; - padding-right: 1em; + padding-inline-end: 1em; padding-bottom: 0.6666667em; - padding-left: 1em; + padding-inline-start: 1em; } .prose-sm :where(ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.1428571em; margin-bottom: 1.1428571em; - padding-left: 1.5714286em; + padding-inline-start: 1.5714286em; } .prose-sm :where(ul):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.1428571em; margin-bottom: 1.1428571em; - padding-left: 1.5714286em; + padding-inline-start: 1.5714286em; } .prose-sm :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1349,11 +1387,11 @@ input[type="number"]::-webkit-inner-spin-button, } .prose-sm :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0.4285714em; + padding-inline-start: 0.4285714em; } .prose-sm :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0.4285714em; + padding-inline-start: 0.4285714em; } .prose-sm :where(.prose-sm > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1361,19 +1399,19 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 0.5714286em; } -.prose-sm :where(.prose-sm > ul > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose-sm :where(.prose-sm > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.1428571em; } -.prose-sm :where(.prose-sm > ul > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose-sm :where(.prose-sm > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-bottom: 1.1428571em; } -.prose-sm :where(.prose-sm > ol > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose-sm :where(.prose-sm > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.1428571em; } -.prose-sm :where(.prose-sm > ol > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { +.prose-sm :where(.prose-sm > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-bottom: 1.1428571em; } @@ -1393,7 +1431,7 @@ input[type="number"]::-webkit-inner-spin-button, .prose-sm :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 0.2857143em; - padding-left: 1.5714286em; + padding-inline-start: 1.5714286em; } .prose-sm :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1423,32 +1461,32 @@ input[type="number"]::-webkit-inner-spin-button, } .prose-sm :where(thead th):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 1em; + padding-inline-end: 1em; padding-bottom: 0.6666667em; - padding-left: 1em; + padding-inline-start: 1em; } .prose-sm :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0; + padding-inline-start: 0; } .prose-sm :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0; + padding-inline-end: 0; } .prose-sm :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { padding-top: 0.6666667em; - padding-right: 1em; + padding-inline-end: 1em; padding-bottom: 0.6666667em; - padding-left: 1em; + padding-inline-start: 1em; } .prose-sm :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0; + padding-inline-start: 0; } .prose-sm :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0; + padding-inline-end: 0; } .prose-sm :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -1568,10 +1606,22 @@ input[type="number"]::-webkit-inner-spin-button, margin-bottom: 2rem; } +.ml-0 { + margin-left: 0px; +} + +.ml-0\.5 { + margin-left: 0.125rem; +} + .ml-1 { margin-left: 0.25rem; } +.ml-1\.5 { + margin-left: 0.375rem; +} + .ml-2 { margin-left: 0.5rem; } @@ -1600,6 +1650,14 @@ input[type="number"]::-webkit-inner-spin-button, margin-right: 0.75rem; } +.mt-0 { + margin-top: 0px; +} + +.mt-0\.5 { + margin-top: 0.125rem; +} + .mt-1 { margin-top: 0.25rem; } @@ -1860,6 +1918,10 @@ input[type="number"]::-webkit-inner-spin-button, white-space: pre; } +.text-wrap { + text-wrap: wrap; +} + .rounded { border-radius: 0.25rem; } @@ -2753,7 +2815,7 @@ hr.ProseMirror-selectednode { .lg\:prose-lg :where(blockquote):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.6666667em; margin-bottom: 1.6666667em; - padding-left: 1em; + padding-inline-start: 1em; } .lg\:prose-lg :where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -2807,9 +2869,9 @@ hr.ProseMirror-selectednode { font-size: 0.8888889em; border-radius: 0.3125rem; padding-top: 0.2222222em; - padding-right: 0.4444444em; + padding-inline-end: 0.4444444em; padding-bottom: 0.2222222em; - padding-left: 0.4444444em; + padding-inline-start: 0.4444444em; } .lg\:prose-lg :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -2831,21 +2893,21 @@ hr.ProseMirror-selectednode { margin-bottom: 2em; border-radius: 0.375rem; padding-top: 1em; - padding-right: 1.5em; + padding-inline-end: 1.5em; padding-bottom: 1em; - padding-left: 1.5em; + padding-inline-start: 1.5em; } .lg\:prose-lg :where(ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.3333333em; margin-bottom: 1.3333333em; - padding-left: 1.5555556em; + padding-inline-start: 1.5555556em; } .lg\:prose-lg :where(ul):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.3333333em; margin-bottom: 1.3333333em; - padding-left: 1.5555556em; + padding-inline-start: 1.5555556em; } .lg\:prose-lg :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -2854,11 +2916,11 @@ hr.ProseMirror-selectednode { } .lg\:prose-lg :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0.4444444em; + padding-inline-start: 0.4444444em; } .lg\:prose-lg :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0.4444444em; + padding-inline-start: 0.4444444em; } .lg\:prose-lg :where(.lg\:prose-lg > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -2866,19 +2928,19 @@ hr.ProseMirror-selectednode { margin-bottom: 0.8888889em; } - .lg\:prose-lg :where(.lg\:prose-lg > ul > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + .lg\:prose-lg :where(.lg\:prose-lg > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.3333333em; } - .lg\:prose-lg :where(.lg\:prose-lg > ul > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + .lg\:prose-lg :where(.lg\:prose-lg > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-bottom: 1.3333333em; } - .lg\:prose-lg :where(.lg\:prose-lg > ol > li > *:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + .lg\:prose-lg :where(.lg\:prose-lg > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 1.3333333em; } - .lg\:prose-lg :where(.lg\:prose-lg > ol > li > *:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { + .lg\:prose-lg :where(.lg\:prose-lg > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-bottom: 1.3333333em; } @@ -2898,7 +2960,7 @@ hr.ProseMirror-selectednode { .lg\:prose-lg :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { margin-top: 0.6666667em; - padding-left: 1.5555556em; + padding-inline-start: 1.5555556em; } .lg\:prose-lg :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { @@ -2928,32 +2990,32 @@ hr.ProseMirror-selectednode { } .lg\:prose-lg :where(thead th):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0.75em; + padding-inline-end: 0.75em; padding-bottom: 0.75em; - padding-left: 0.75em; + padding-inline-start: 0.75em; } .lg\:prose-lg :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0; + padding-inline-start: 0; } .lg\:prose-lg :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0; + padding-inline-end: 0; } .lg\:prose-lg :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { padding-top: 0.75em; - padding-right: 0.75em; + padding-inline-end: 0.75em; padding-bottom: 0.75em; - padding-left: 0.75em; + padding-inline-start: 0.75em; } .lg\:prose-lg :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-left: 0; + padding-inline-start: 0; } .lg\:prose-lg :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { - padding-right: 0; + padding-inline-end: 0; } .lg\:prose-lg :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { diff --git a/writer/src/actions/user.js b/writer/src/actions/user.js index e70c8977..8c8a9b4d 100644 --- a/writer/src/actions/user.js +++ b/writer/src/actions/user.js @@ -57,8 +57,8 @@ export const verifyOtpFailure = createAction( export const updateUser = createAction( ActionTypes.UPDATE_USER, - ({ name, slug, bio, pic, twitter, linkedin, instagram } = {}) => ({ - payload: { name, slug, bio, pic, twitter, linkedin, instagram }, + ({ name, slug, bio, pic, twitter, linkedin, instagram, settings } = {}) => ({ + payload: { name, slug, bio, pic, twitter, linkedin, instagram, settings }, }) ); export const updateUserSuccess = createAction( diff --git a/writer/src/containers/SettingsContainer.jsx b/writer/src/containers/SettingsContainer.jsx index 98e23933..99aec8c2 100644 --- a/writer/src/containers/SettingsContainer.jsx +++ b/writer/src/containers/SettingsContainer.jsx @@ -10,6 +10,7 @@ import { selectUser, selectOtp } from "../selectors"; import { addCustomDomain, updateUser } from "../actions"; import useTreeChanges from "tree-changes-hook"; import Tiptap from "../components/Tiptap"; +import { Switch } from "@headlessui/react"; import AppWrapper from "./AppWraper"; @@ -24,10 +25,12 @@ function SettingsContainer(props) { "" ); + const isUserPro = !!(user.data || {}).pro; const currentName = (user.data || {}).name || ""; const currentSlug = (user.data || {}).slug || ""; const currentBio = (user.data || {}).bio || ""; const currentPic = (user.data || {}).pic || ""; + const currentSettings = (user.data || {}).settings || {}; const currentLinkedin = (user.data || {}).linkedin || ""; const currentTwitter = (user.data || {}).twitter || ""; const currentInstagram = (user.data || {}).instagram || ""; @@ -46,6 +49,9 @@ function SettingsContainer(props) { const [twitter, setTwitter] = useState(currentTwitter); const [instagram, setInstagram] = useState(currentInstagram); const bioRef = useRef(null); + const [settings, setSettings] = useState({ + ...currentSettings, + }); useEffect(() => { if (changed("user.data.name")) { @@ -107,7 +113,9 @@ function SettingsContainer(props) { pic !== currentPic || linkedin !== currentLinkedin || twitter !== currentTwitter || - instagram !== currentInstagram; + instagram !== currentInstagram || + settings.removeImagesInMainPage !== + currentSettings.removeImagesInMainPage; return ( @@ -267,6 +275,46 @@ function SettingsContainer(props) {
+ {isUserPro ? ( +
+ +
+ + { + setSettings({ + ...settings, + removeImagesInMainPage: + !settings.removeImagesInMainPage, + }); + }} + className={`${ + settings.removeImagesInMainPage + ? "bg-blue-600" + : "bg-gray-200" + } relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2`} + > + + + + Remove images from main page + + + +
+
+ ) : null}