From 39b819241f973e6f913667f3bda59083eaf4d142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 15:24:11 +0200 Subject: [PATCH 1/9] Dashboard styles, typescript, add useAppDispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../admin/components/latest_accounts_panel.js | Bin 2568 -> 0 bytes .../components/latest_accounts_panel.tsx | 63 ++++++++++++++++++ app/soapbox/features/admin/index.js | Bin 6120 -> 5922 bytes app/soapbox/features/admin/user_index.js | Bin 3558 -> 3595 bytes app/soapbox/hooks/useAppDispatch.ts | 5 ++ app/styles/components/admin.scss | 60 +---------------- app/styles/components/wtf-panel.scss | 2 +- 7 files changed, 71 insertions(+), 59 deletions(-) delete mode 100644 app/soapbox/features/admin/components/latest_accounts_panel.js create mode 100644 app/soapbox/features/admin/components/latest_accounts_panel.tsx create mode 100644 app/soapbox/hooks/useAppDispatch.ts diff --git a/app/soapbox/features/admin/components/latest_accounts_panel.js b/app/soapbox/features/admin/components/latest_accounts_panel.js deleted file mode 100644 index 6377b6810682dd4ea0b1d9a212ce4048cfcfe7f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2568 zcma)8O>f&q5WVYHOfDe>$W(jiMJWRdPJtRt0K;}qMIfxnk+luUWp|ghRfhjPGyB1n zmA0s1Smtu(?VGo6W+mHRX$vDr0~74EY9W(tJ6Q41VD@ey{relO`uk&#CWQ3#d|`PZ z#oVH(Y|X72noltoRSZf5sJ`w`tn77X zn-$c!mmPjWW5gqs6zdLTDC9J;Qe8)xXHgpK;f2DYKqKtYR)^mW>I7(%=pWR}nzWFr zGiy<|vP;;^Q)s-dgJ>~4tnXxhyo3oTX3QMJ%^&r=C`Lvp71pQ$@x?8_O@x^vK5rfR(nv4f~?rK<0=Sjj%{K0n~WF!bN6IR53I*s7gs6T{r~h zCWC23!1zKu2=jj+`_Nq=`cGS2HM05wR)Il;(J3@Rt8{!=LEj8o(2SOX;(euVNpusUAB0C!!_?~6wyi{*cK!H99@HFLJeJ~KYR zdJVsBuYTLWmhG^;xh8VW5j0lhYx;+F(iUql)R?k+gbtr!aJ~{2h&a{T7ar$cA3;DZ zwLL<0z@&xTyU376dN3Gaa(|(2jwFbNT6LKPb5PGN*!d#>Q`HYN0gmvj^cO>tl3|p` zw6aBx@)~$tFG13y;N^Vw_p;FVM2&$tDG)Oc!hB$d0Ev5&$$`gQ)-1KtJZb99Y)DpF zle87}E7i0UmXtjKmgdeEOThCcZ{N~{%hNuqpa?Pdr=pP>sB@V z`dyGYX%}uCc0F8%F_E{gowHnArpdFY8et6h#@L2(d^_Wd#g2^hFVk*hReaLDG{it&y#?8(@?B*luVaP=`9xo}tXx4BP_% zA^9g49SKs81XfmA(QM#{`Sm=QKFInLPqTa(LcNzpaIay3}yrK&oskT%s8i7csTG3p_iJu-DP9TbHx_`CXf zLa`UpeXM zaQKYj;uO)yzcKI#NO_R#=k3`g7S^fXsHk$(-kN!K>ArpFH7}d+*Nw8mJUwR1Y0h(Z zPdT!r#a`)F#Oo)Ix0}D7PEu0sWxNk)1|&%5m2z|+Y1P$Pj_xC^dM(0@_un*p=!&jA zXQWNI2fdEd2|pirs|Jf@=D#tlUG3Ri^|Q1G9-XfiZjr7U{+4l&eL3z$V=xgNqod-| M`n^kzW}Oz_04D`mlmGw# diff --git a/app/soapbox/features/admin/components/latest_accounts_panel.tsx b/app/soapbox/features/admin/components/latest_accounts_panel.tsx new file mode 100644 index 0000000000..ae32a40f56 --- /dev/null +++ b/app/soapbox/features/admin/components/latest_accounts_panel.tsx @@ -0,0 +1,63 @@ +import { OrderedSet as ImmutableOrderedSet, is } from 'immutable'; +import React, { useState } from 'react'; +import { useEffect } from 'react'; +import { defineMessages, useIntl } from 'react-intl'; +import { Link } from 'react-router-dom'; + +import { fetchUsers } from 'soapbox/actions/admin'; +import compareId from 'soapbox/compare_id'; +import { Text, Widget } from 'soapbox/components/ui'; +import AccountContainer from 'soapbox/containers/account_container'; +import { useAppSelector } from 'soapbox/hooks'; +import { useAppDispatch } from 'soapbox/hooks/useAppDispatch'; + +const messages = defineMessages({ + title: { id: 'admin.latest_accounts_panel.title', defaultMessage: 'Latest Accounts' }, + expand: { id: 'admin.latest_accounts_panel.expand_message', defaultMessage: 'Click to see {count} more {count, plural, one {account} other {accounts}}' }, +}); + +interface ILatestAccountsPanel { + limit?: number, +} + +const LatestAccountsPanel: React.FC = ({ limit = 5 }) => { + const dispatch = useAppDispatch(); + const intl = useIntl(); + + const accountIds = useAppSelector>((state) => state.admin.get('latestUsers')); + const hasDates = useAppSelector((state) => accountIds.every(id => !!state.accounts.getIn([id, 'created_at']))); + + const [total, setTotal] = useState(0); + + useEffect(() => { + dispatch(fetchUsers(['local', 'active'], 1, null, limit)) + .then((value) => { + setTotal((value as { count: number }).count); + }) + .catch(() => {}); + }, []); + + const sortedIds = accountIds.sort(compareId).reverse(); + const isSorted = hasDates && is(accountIds, sortedIds); + + if (!isSorted || !accountIds || accountIds.isEmpty()) { + return null; + } + + const expandCount = total - accountIds.size; + + return ( + + {accountIds.take(limit).map((account) => ( + + ))} + {!!expandCount && ( + + {intl.formatMessage(messages.expand, { count: expandCount })} + + )} + + ); +}; + +export default LatestAccountsPanel; diff --git a/app/soapbox/features/admin/index.js b/app/soapbox/features/admin/index.js index 09f626f0e3ff8f83b9b67ebdf51be3ad2d0ba4ed..93a38c53fa0d067c3c1a30ad9f3071567233ba09 100644 GIT binary patch delta 708 zcmaE%zesPxO-7Y!g^<*W5`|iYw4(f61@+?m#Db*!3jO5#+=BeP)Vz{n{nE_M=NZ>> z8i3U$=47Vl*{UZ4Wm1dO6^b*fQf<|ZDst2n%2PAbGfHgLb5m0?OLNujxF!eks!hJd zEuv+k57KJKrGNx%u$TtcA~9J&SblOcj{_S-+vL4G@+>}?dD)W#`NbL4Cv)*C7-G{* z$SDrwID?JPjsxcU$^LvYlWX{bNe>53er-*dDMWMc8iDb?*t2i0$_+} z3Gg8YLz;jxS;3$-xj{&3@&^G0a)P5(&u03f^9VE_OC delta 437 zcmZ3a_dl!xDfuoOs=Jw84sF)1|%C~Y&jl*a)qcT`At@@p}n$HGS#f`#~Z}Z85b=V5apgB-@@?Ku;$+7%S zVEMyBqLYCRWl>PjtetEnERX8acl^p&UCK8(L%<5BYncThaxm8-1puLN1)3{0`H!Fi SPP1!;AZ7#Iy!p6LGz$Rpnu?GB diff --git a/app/soapbox/features/admin/user_index.js b/app/soapbox/features/admin/user_index.js index d93f99d2861f20f28190e9548805e15acdd3a29a..dc7691f69bb9b1cf0b93ff2aeaae9d22cc85d507 100644 GIT binary patch delta 40 vcmaDR-7T}hnO8w?x-Op|~J1IaRk(*F=4?74I4V67~%u delta 11 ScmeB{c_zKVnRjvq?_vNN?gUf- diff --git a/app/soapbox/hooks/useAppDispatch.ts b/app/soapbox/hooks/useAppDispatch.ts new file mode 100644 index 0000000000..11e7226d55 --- /dev/null +++ b/app/soapbox/hooks/useAppDispatch.ts @@ -0,0 +1,5 @@ +import { useDispatch } from 'react-redux'; + +import { AppDispatch } from 'soapbox/store'; + +export const useAppDispatch = () => useDispatch(); \ No newline at end of file diff --git a/app/styles/components/admin.scss b/app/styles/components/admin.scss index 88a34b05cf..56e7e90228 100644 --- a/app/styles/components/admin.scss +++ b/app/styles/components/admin.scss @@ -1,65 +1,9 @@ .dashcounters { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); - margin: 0 -5px 0; - padding: 20px; + @apply grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2 mb-4; } .dashcounter { - box-sizing: border-box; - flex: 0 0 33.333%; - padding: 0 5px; - margin-bottom: 10px; - - > a, - > div { - box-sizing: border-box; - text-decoration: none; - color: inherit; - display: block; - padding: 20px; - background: var(--accent-color--faint); - border-radius: 4px; - transition: 0.2s; - height: 100%; - } - - > a:hover { - background: var(--accent-color--med); - transform: translateY(-2px); - } - - &__num, - &__icon, - &__text { - text-align: center; - font-weight: 500; - font-size: 24px; - line-height: 30px; - color: var(--primary-text-color); - margin-bottom: 10px; - } - - &__icon { - display: flex; - justify-content: center; - - .svg-icon { - width: 48px; - height: 48px; - - svg { - stroke-width: 1px; - } - } - } - - &__label { - font-size: 14px; - color: hsla(var(--primary-text-color_hsl), 0.6); - text-align: center; - font-weight: 500; - } + @apply bg-gray-200 dark:bg-gray-600 p-4 rounded flex flex-col items-center space-y-2 hover:-translate-y-1 transition-transform cursor-pointer; } .dashwidgets { diff --git a/app/styles/components/wtf-panel.scss b/app/styles/components/wtf-panel.scss index 120abe3382..113e33e1f1 100644 --- a/app/styles/components/wtf-panel.scss +++ b/app/styles/components/wtf-panel.scss @@ -139,13 +139,13 @@ } &__expand-btn { + @apply border-gray-300 dark:border-gray-600; display: block; width: 100%; height: 100%; max-height: 46px; position: relative; border-top: 1px solid; - border-color: var(--brand-color--faint); transition: max-height 150ms ease; overflow: hidden; opacity: 1; From 580633c91549893059c4487168c4396031b43dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 15:26:27 +0200 Subject: [PATCH 2/9] AccountContainer: use withDate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/account.tsx | 4 ++++ .../features/admin/components/latest_accounts_panel.tsx | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index 3288127a16..132b9dfa20 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -35,6 +35,7 @@ interface IAccount { showProfileHoverCard?: boolean, timestamp?: string | Date, timestampUrl?: string, + withDate?: boolean, withRelationship?: boolean, } @@ -51,6 +52,7 @@ const Account = ({ showProfileHoverCard = true, timestamp, timestampUrl, + withDate = false, withRelationship = true, }: IAccount) => { const overflowRef = React.useRef(null); @@ -122,6 +124,8 @@ const Account = ({ ); } + if (withDate) timestamp = account.created_at; + const LinkEl: any = showProfileHoverCard ? Link : 'div'; return ( diff --git a/app/soapbox/features/admin/components/latest_accounts_panel.tsx b/app/soapbox/features/admin/components/latest_accounts_panel.tsx index ae32a40f56..7f53abd463 100644 --- a/app/soapbox/features/admin/components/latest_accounts_panel.tsx +++ b/app/soapbox/features/admin/components/latest_accounts_panel.tsx @@ -24,10 +24,10 @@ const LatestAccountsPanel: React.FC = ({ limit = 5 }) => { const dispatch = useAppDispatch(); const intl = useIntl(); - const accountIds = useAppSelector>((state) => state.admin.get('latestUsers')); + const accountIds = useAppSelector>((state) => state.admin.get('latestUsers').take(limit)); const hasDates = useAppSelector((state) => accountIds.every(id => !!state.accounts.getIn([id, 'created_at']))); - const [total, setTotal] = useState(0); + const [total, setTotal] = useState(accountIds.size); useEffect(() => { dispatch(fetchUsers(['local', 'active'], 1, null, limit)) @@ -49,7 +49,7 @@ const LatestAccountsPanel: React.FC = ({ limit = 5 }) => { return ( {accountIds.take(limit).map((account) => ( - + ))} {!!expandCount && ( From bd1e6d364a189e7619fb3ceed64393f69cf94f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 15:36:07 +0200 Subject: [PATCH 3/9] AutosuggestInput dark styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/autosuggest_input.js | Bin 8754 -> 8897 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/app/soapbox/components/autosuggest_input.js b/app/soapbox/components/autosuggest_input.js index 1bb2e2edf862705b9ed4fc431de9dbbf32a5bdb4..d13873c808ffcaa2426fdf99644f5c0dd6df55b0 100644 GIT binary patch delta 171 zcmdnwa?o|dWO0F%#G-7glGKV4-SncwN?nu56U0?Sz=9e1WvNA0N$C&?^T`{J$E`Lm%JZ((4t`Km%JBLJcHJWc=r delta 50 zcmX@;y2)k3Wbw)8r4%RM6IbQW$S+GRvPw$VO)pBU)HU2}Ez!sXlvLQvChg0%IaM)+ F5ditQ5%&N9 From 211a1fc88b67c840ca58e8eb8693a15f706aae79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 15:37:20 +0200 Subject: [PATCH 4/9] dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/styles/components/reply-mentions.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/styles/components/reply-mentions.scss b/app/styles/components/reply-mentions.scss index f94ba5181f..5312d08593 100644 --- a/app/styles/components/reply-mentions.scss +++ b/app/styles/components/reply-mentions.scss @@ -1,5 +1,5 @@ .reply-mentions { - @apply text-gray-500 mb-1 text-sm; + @apply text-gray-500 dark:text-gray-400 mb-1 text-sm; &__account { @apply text-primary-600 no-underline; From 23943ccdee732e10a72e955cba8c79f042d68227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 15:51:23 +0200 Subject: [PATCH 5/9] Remote interaction modal styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../ui/components/unauthorized_modal.js | Bin 7611 -> 7076 bytes app/styles/components/modal.scss | 11 +++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/soapbox/features/ui/components/unauthorized_modal.js b/app/soapbox/features/ui/components/unauthorized_modal.js index 2e5a1a2f66aa20bd615b6fa596bd22b2af2dc65d..cf2c4d79e60763351c526c8799e8ecb56f6ba5f5 100644 GIT binary patch delta 228 zcmdmOy~KRN|H-V3cjc-ToJvbd^7C{QeDhNhb95AfOA?c_breEUD@qhIFra zxrs%UlfQ~;F*;3F5K9pT8=07snVx5>o}8Ljl3JubxkD^{vX(60IwaI5>L?-{13T5U}P?#(yD!t=smW5>lTZcm&rM=BnKr{_XX?zP6qlu6 zq2>Jm?V)Ecdl3YWUOagAqKKcstB2}jlWwyr1q~tO9o~87H_!7P-hF#-_ve{4%DSz+ zqtCPVBhFSbr8t8hwdMt?%b-)#=G4*>?QL?QP#-xJXHofhze!FA1VKW=n21V0LSC{^W%%ocAW&4L1h@Nzz`%2ph4GUm!DVGGJkr=$VeD%?2;r0MY5&3;VUS?E~TXC;k9ML7o#0;6j4=y%J9ILuXW&^5zolYkin686Fy$512dgs z;lNz>$M-w7_Fs&G{pLI@T2FT-oH|y@=L;$BV;5K9{><0b4k$e`K{<7(;K!%AFu@Jy ztt;@nZr>PBNWtK_Im1LN@?1EutYGX XZSLA!g{x%J5jLjv7!N;KpQe8SeoHZn diff --git a/app/styles/components/modal.scss b/app/styles/components/modal.scss index c040893182..e1a5061879 100644 --- a/app/styles/components/modal.scss +++ b/app/styles/components/modal.scss @@ -817,9 +817,7 @@ &__content { display: flex; flex-direction: column; - // align-items: center; row-gap: 10px; - padding: 10px; .unauthorized-modal-content__button { margin: 0 auto; @@ -832,11 +830,8 @@ gap: 10px; width: 100%; - .button { - width: auto; - margin: 0; - text-transform: none; - overflow: unset; + button { + align-self: flex-end; } } @@ -848,9 +843,9 @@ &::before, &::after { + @apply border-b border-gray-300 dark:border-gray-600; content: ""; flex: 1; - border-bottom: 1px solid hsla(var(--primary-text-color_hsl), 0.2); } } From 92a6058f26a082dd5cce12e8b309d815bd741914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 17:50:47 +0200 Subject: [PATCH 6/9] typescript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../{account_notes.js => account_notes.ts} | Bin 1081 -> 1224 bytes 1 file changed, 0 insertions(+), 0 deletions(-) rename app/soapbox/reducers/{account_notes.js => account_notes.ts} (68%) diff --git a/app/soapbox/reducers/account_notes.js b/app/soapbox/reducers/account_notes.ts similarity index 68% rename from app/soapbox/reducers/account_notes.js rename to app/soapbox/reducers/account_notes.ts index 67cd83e1d4fd37d8c0ca4f0b5aba7989b13419c2..b7f6f2eab7bbd2704e4c75afae5cebbd019c229a 100644 GIT binary patch delta 331 zcmaKnJqiLb5QSMQ%>e`}U$+V(*6R;!VPUI+b<9Rs*d&sjfFfe!1;nF>g*Onqlu`UI zY`>ZL-n>)sT$-e6ZY*Jip%lg@;5i0LIpWhyKF}I7YZSut$-_2#oyB??3rdZ~bIr=c zEq2XIwV$N)P;`H#wH4d9g35*qVVtH2+GSaT0m3LH-(X#DGbW7A$v>DlA?+U{Abn(n zcW|xVV0Q&A=Mp30B+>OIa#oK$DtB%JGy9hJ_AY3K(Z~KrvR8uN8%Ma6KOBQ?;R Date: Thu, 14 Apr 2022 18:10:46 +0200 Subject: [PATCH 7/9] typescript, FC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/ui/input/input.tsx | 2 +- .../components/latest_accounts_panel.tsx | 2 +- .../delete_account/{index.js => index.tsx} | Bin 3038 -> 3083 bytes .../developers/developers_challenge.js | Bin 2829 -> 0 bytes .../developers/developers_challenge.tsx | 80 ++++++++++++++++++ ...developers_menu.js => developers_menu.tsx} | Bin 3028 -> 3065 bytes app/soapbox/features/developers/index.js | Bin 696 -> 0 bytes app/soapbox/features/developers/index.tsx | 15 ++++ app/soapbox/hooks/index.ts | 1 + 9 files changed, 98 insertions(+), 2 deletions(-) rename app/soapbox/features/delete_account/{index.js => index.tsx} (94%) delete mode 100644 app/soapbox/features/developers/developers_challenge.js create mode 100644 app/soapbox/features/developers/developers_challenge.tsx rename app/soapbox/features/developers/{developers_menu.js => developers_menu.tsx} (97%) delete mode 100644 app/soapbox/features/developers/index.js create mode 100644 app/soapbox/features/developers/index.tsx diff --git a/app/soapbox/components/ui/input/input.tsx b/app/soapbox/components/ui/input/input.tsx index 343a9d0dd7..5314ee583c 100644 --- a/app/soapbox/components/ui/input/input.tsx +++ b/app/soapbox/components/ui/input/input.tsx @@ -19,7 +19,7 @@ interface IInput extends Pick, 'onCh name?: string, placeholder?: string, value?: string, - onChange?: () => void, + onChange?: (event: React.ChangeEvent) => void, type: 'text' | 'email' | 'tel' | 'password' } diff --git a/app/soapbox/features/admin/components/latest_accounts_panel.tsx b/app/soapbox/features/admin/components/latest_accounts_panel.tsx index 7f53abd463..b1e9a441b7 100644 --- a/app/soapbox/features/admin/components/latest_accounts_panel.tsx +++ b/app/soapbox/features/admin/components/latest_accounts_panel.tsx @@ -9,7 +9,7 @@ import compareId from 'soapbox/compare_id'; import { Text, Widget } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import { useAppSelector } from 'soapbox/hooks'; -import { useAppDispatch } from 'soapbox/hooks/useAppDispatch'; +import { useAppDispatch } from 'soapbox/hooks'; const messages = defineMessages({ title: { id: 'admin.latest_accounts_panel.title', defaultMessage: 'Latest Accounts' }, diff --git a/app/soapbox/features/delete_account/index.js b/app/soapbox/features/delete_account/index.tsx similarity index 94% rename from app/soapbox/features/delete_account/index.js rename to app/soapbox/features/delete_account/index.tsx index f0d902e4a65936ec8746ce5980a31601ae424642..733b9554cfaacbace4ade60959ab30110768cb22 100644 GIT binary patch delta 111 zcmca7-YqeqYU0utx|z8J`9&oP)e5D>sg4B&E}6vzi6zMy3bhJpMftf3>c#nq1xfi8 z`WgB8*~Oc?71C>p7W!wm|UXgoROH9p6Xhbnpa}u5#sCPnO9I+;+m71 N3ly;1{EhVmD*$;%DxUxV delta 64 zcmeB{xF&=rGcQ8-(W!<=0ne7ED04GEl4FCWD diff --git a/app/soapbox/features/developers/developers_challenge.js b/app/soapbox/features/developers/developers_challenge.js deleted file mode 100644 index b62191227ada6458ffc69fc34ffbb84bfd99548e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2829 zcma)8+m72d5PkPo%o}CEE5Eyzo6QC(7HEqg8z3l(qM@a+%~T>)l1g@==-)fM$fCT? zHv3?#$ip);XD*~@TBR+#)2jXO)S`idRt>P0zHh8sU_UKHz`RFZ+PJUX|I=0vZ&{vwS3cbEdmHG( z$1hrS?F#N?+u0R-z{e?yk-b!;rbKDYx)Uy*F`zqDca4m`rG6Kv^s9iHSd7MdWl zf#O2ktX}|}kXIzi26_zM}q>@3B5J zO%yrlU)M+}$OG{2+99to-+CgJvc9W%i6>Q8sDFsNo$%Kz{GmD>{f%Z!SC*vF%j6OC z9Y)|9L8`C7N#m$oWIu56KbkniHQtX}$z$s3u%x8oqi;j%6PFWs6?-6CE?!N2v?yzC z3`}{t8#4e@X(%fLzDM)BvBscZP#%rtR+Qj+I`nu!>p*|5^EOlO=W6d-HW%hS{@V%a zI9CM#l`t*0NQ3eB{FsQbeWAXrM+NwtKoC+t@1)=H0E*`NbVRGu# z2XY#-J}R{V%q`bPwD}iachu#i+Klm`+c(0_xk9T@4}>8U!=MRKfH&h5F^&gdga(f% zh|>-!K@KAhkj4F?D1gy)ab3-p(e+8G?D}lV{$#?O)5rc=fz=%@eJIYrD0DVXraTsC z<|4=se#XXz&Bh5ZVwNM%09YG*?$enRwO0B?N>{uS-zc=E5<{Jh;f|6y-zLGLrirNM zIYF|2a&_b8F~oTo*)-ZtOJHvG8|lh&)7HXf>>FF=nwn1=%$E6QC1l1J2{wF+Nr@*j zZxCP`$Ecr0MgNj+aY!zQT|7&t-8BYEhGHsuUnQYp!%~7Jv>Wi#VV6Nqklur5YPU-z zR2A$zOH49CV>a0ZJ`RMK^MZXmaSOsw`66gEZdRxRlr)HG+(SRAJN$e}{9~GuPH>+}rh~5?&gx{8-Ra0vQ~5BkHGu z1@akFf3AGgy2t9KR(Sy>0)QtR8b W3-DPaVR-~@*I`P8@9`!X7XJY^&4$ { + const dispatch = useDispatch(); + const intl = useIntl(); + + const [answer, setAnswer] = useState(''); + + const handleChangeAnswer = (e: React.ChangeEvent) => { + setAnswer(e.target.value); + }; + + const handleSubmit = () => { + if (answer === 'boxsoap') { + dispatch(changeSettingImmediate(['isDeveloper'], true)); + dispatch(snackbar.success(intl.formatMessage(messages.success))); + } else { + dispatch(snackbar.error(intl.formatMessage(messages.fail))); + } + }; + + const challenge = `function soapbox() { + return 'soap|box'.split('|').reverse().join(''); +}`; + + return ( + +
+ + soapbox() }} + /> + + + {challenge} + + + + + + + + + +
+
+ ); +}; + +export default DevelopersChallenge; diff --git a/app/soapbox/features/developers/developers_menu.js b/app/soapbox/features/developers/developers_menu.tsx similarity index 97% rename from app/soapbox/features/developers/developers_menu.js rename to app/soapbox/features/developers/developers_menu.tsx index 832c0bd609bfa4bf2aae877464a922448aa38609..6cabd36a029a9a34b9634ea0fdfec452890e5474 100644 GIT binary patch delta 50 zcmca2{!@H|GPA0cLQraAa*3XAera*4YguYuiH%2yua8q{NlAX5Yffq|P{eMtGV?|b E0Lv487+od;_En?(OI%b=OH#+xwJ)+eU(f#bIJX{QDfB5KWahBzf=I&wi-7 zG1kGSHO=X_L4u1lHAD^HpPhe*wn9yu1Ioh9xb^21>Y*@NBf~>Tc(z!!9nlo2)9-SDYKAS-D_e#T{I&t;!G7?ITgm z@4gj}Kn`lz9G!G{GJYonIgr0XzJp$XpOZ; { + const isDeveloper = useAppSelector((state) => getSettings(state).get('isDeveloper')); + + return isDeveloper ? : ; +}; + +export default Developers; diff --git a/app/soapbox/hooks/index.ts b/app/soapbox/hooks/index.ts index d3c5f47008..6ec919a94e 100644 --- a/app/soapbox/hooks/index.ts +++ b/app/soapbox/hooks/index.ts @@ -1,3 +1,4 @@ +export { useAppDispatch } from './useAppDispatch'; export { useAppSelector } from './useAppSelector'; export { useFeatures } from './useFeatures'; export { useOnScreen } from './useOnScreen'; From 19aa4b254e4341d0c1cbce08c1db26ea0cdf0520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 14 Apr 2022 22:14:54 +0200 Subject: [PATCH 8/9] Support 'status' notification type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/actions/notifications.js | Bin 10575 -> 10603 bytes .../notifications/components/filter_bar.js | Bin 3429 -> 3749 bytes .../notifications/components/notification.js | Bin 6651 -> 6821 bytes app/soapbox/locales/pl.json | 2 ++ app/soapbox/reducers/notifications.js | Bin 7177 -> 7187 bytes 5 files changed, 2 insertions(+) diff --git a/app/soapbox/actions/notifications.js b/app/soapbox/actions/notifications.js index ce7e5eca0112ff4309637e5ed95c5619c64aac0a..66918c6987d94dcfa20d3c2086b5fffc19c510a0 100644 GIT binary patch delta 74 zcmX>f^g3vR44+}NdTwf7NoIbYx{iW+aYba?TC7Jno>YIJ}O1Ux?(1Mi2lGI{_w4(f6g@V-lf}B)^ z%KTD=wEUc${PN9d%uXCE8Tq-XlQ(jkv%}1I$E_p}VXJHEa4A4RUSe*lm4Z6d@J0@i O$s5?6Hm~5`%Lo9Ivo4GP delta 17 ZcmZ1~`&4Q}HuL67%(fhxU-0Z@1OP(Q2ND1P diff --git a/app/soapbox/features/notifications/components/notification.js b/app/soapbox/features/notifications/components/notification.js index 77fa5762e1fece60fb7d38838916e69e907c3869..00911e68ee8932d20d063a7f41b1b82cdbb609f1 100644 GIT binary patch delta 106 zcmexuywr5VY*tPk1@+>R#FEnD$+K8rb0{c4IUiW%Su*l-Q#aSLEo6iXPhyv1gDPlc mm*>tZEiO?g$S*EQP1!8Qv7dt{Ik7kuZr%lc>CG<%gg5~mawaqY delta 26 icmZ2#`rCNJY}Uz3Szm2F#5R+0^Hz@S9GmL})i?pEMhi9o diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json index d4feae8684..ca01e879b1 100644 --- a/app/soapbox/locales/pl.json +++ b/app/soapbox/locales/pl.json @@ -694,6 +694,7 @@ "notification.pleroma:emoji_reaction": "{name} zareagował(a) na Twój wpis", "notification.poll": "Głosowanie w którym brałeś(-aś) udział zakończyła się", "notification.reblog": "{name} podbił(a) Twój wpis", + "notification.status": "{name} właśnie opublikował(a) wpis", "notifications.clear": "Wyczyść powiadomienia", "notifications.clear_confirmation": "Czy na pewno chcesz bezpowrotnie usunąć wszystkie powiadomienia?", "notifications.clear_heading": "Wyczyść powiadomienia", @@ -725,6 +726,7 @@ "notifications.filter.mentions": "Wspomienia", "notifications.filter.moves": "Przenoszone konta", "notifications.filter.polls": "Wyniki głosowania", + "notifications.filter.statuses": "Nowe wpisy osób, które subskrybujesz", "notifications.group": "{count, number} {count, plural, one {powiadomienie} few {powiadomienia} many {powiadomień} more {powiadomień}}", "notifications.queue_label": "Naciśnij aby zobaczyć {count} {count, plural, one {nowe powiadomienie} few {nowe powiadomienia} many {nowych powiadomień} other {nowe powiadomienia}}", "password_reset.confirmation": "Sprawdź swoją pocztę e-mail, aby potwierdzić.", diff --git a/app/soapbox/reducers/notifications.js b/app/soapbox/reducers/notifications.js index fad2563c3648725d2de1a423e635009f871af9c4..faade6a821767ec0e726fede8f952a88a6b69b60 100644 GIT binary patch delta 22 dcmeCQm~62@gM(8?LA|&nv81$kvpUBkVE|He2V?*M delta 12 TcmbPi(P^ Date: Thu, 14 Apr 2022 22:20:53 +0200 Subject: [PATCH 9/9] dark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../features/ui/components/actions_modal.js | Bin 2728 -> 2767 bytes app/styles/components/modal.scss | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/soapbox/features/ui/components/actions_modal.js b/app/soapbox/features/ui/components/actions_modal.js index bcac0c67c9ec3146deeef84b51f36a1c3b1b9004..aa0201ca91a8d5764d24c21e64851cae9357b630 100644 GIT binary patch delta 53 zcmZ1>dR}zHFE)Xc#G-7gq;%cloWzn;T?>QBKiJfT6(FMdMJcI8y6HuUmAdAeW!bx# E0T-td&;S4c delta 16 XcmX>vx