From 61fd48204bd71748824b82b2ebc2a2772d593d08 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 21 Mar 2022 17:28:57 -0500 Subject: [PATCH] ComposeForm: convert some buttons into TSX --- .../compose/components/markdown_button.js | Bin 988 -> 0 bytes .../compose/components/markdown_button.tsx | 30 +++++++++++++++ .../compose/components/poll_button.js | Bin 1121 -> 0 bytes .../compose/components/poll_button.tsx | 36 ++++++++++++++++++ .../compose/components/spoiler_button.js | Bin 995 -> 0 bytes .../compose/components/spoiler_button.tsx | 29 ++++++++++++++ .../containers/markdown_button_container.js | Bin 542 -> 667 bytes 7 files changed, 95 insertions(+) delete mode 100644 app/soapbox/features/compose/components/markdown_button.js create mode 100644 app/soapbox/features/compose/components/markdown_button.tsx delete mode 100644 app/soapbox/features/compose/components/poll_button.js create mode 100644 app/soapbox/features/compose/components/poll_button.tsx delete mode 100644 app/soapbox/features/compose/components/spoiler_button.js create mode 100644 app/soapbox/features/compose/components/spoiler_button.tsx diff --git a/app/soapbox/features/compose/components/markdown_button.js b/app/soapbox/features/compose/components/markdown_button.js deleted file mode 100644 index 0d4b294a787f9bb5e0760d4f676abab15f91a425..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 988 zcma)4O>f&U488kT@MZ@{m3umO#R?4Ap+HdVUMM!xsA7f7H8fODRpBq8_p>s7B z0KN9l*zREj!_RWfq$Jn6R~uijEw@6ThmP{>j6XQ(ka2)kA3FxZv}NkSeu;dBeNNw+ zu<%bC-VooSBzY{jUQSswoelwR^Jw{C_(o{k08t-x7(B+KTC@aX!7~TaWEv1nlg2g2 zfq$%_dBOdnzB)SB$(jJp-gKsUUMEk3ZIlUj_-8O4+k_K6*C2Nk;XlA8UJKw++qT0< z%eqw?sIT%M^k{;T`GU%QE4~E4BxRnrL(lLubTR--%Z;~r1@>4C3rXxIg*12zRon;Q z+kalm2>`>S_2|=LRe4P!iQh>$AYw i_Df{;$%-(Q)noc!8s)>(W88Cf%Neq}ibKtZn~Hz^g-c2R diff --git a/app/soapbox/features/compose/components/markdown_button.tsx b/app/soapbox/features/compose/components/markdown_button.tsx new file mode 100644 index 0000000000..01b0620a01 --- /dev/null +++ b/app/soapbox/features/compose/components/markdown_button.tsx @@ -0,0 +1,30 @@ +import React from 'react'; +import { defineMessages, useIntl } from 'react-intl'; + +import ComposeFormButton from './compose_form_button'; + +const messages = defineMessages({ + marked: { id: 'compose_form.markdown.marked', defaultMessage: 'Post markdown enabled' }, + unmarked: { id: 'compose_form.markdown.unmarked', defaultMessage: 'Post markdown disabled' }, +}); + +interface IMarkdownButton { + active?: boolean, + onClick: () => void, +} + +const MarkdownButton: React.FC = ({ active, onClick }) => { + const intl = useIntl(); + + return ( + + ); + +}; + +export default MarkdownButton; diff --git a/app/soapbox/features/compose/components/poll_button.js b/app/soapbox/features/compose/components/poll_button.js deleted file mode 100644 index bc0f25a06632e08864fae59a63c847d1c6033106..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1121 zcmZ`&$&Q>b5WVvib%T~@_q`J)lZ+H8he)kf?kxkwv=d_!+q5P^{Cmm^4Vr}mOD*rY z-YY~uXyf2y^ziH7fEGHVd&md+-a8-2KV>4;oRK#!<&A$|Qxmk<357q=TKNG%<7OD0Qhr&i6H1SqFV0g6b7>F=YU} zZ7+kC@(2@%_DJKsLXfOz-P&t?~I-qsji3Yr1(Z7n~Kvyd) zuO-s-cW+s(we(W~jEdj5kiO#m0 void, +} + +const PollButton: React.FC = ({ active, unavailable, disabled, onClick }) => { + const intl = useIntl(); + + if (unavailable) { + return null; + } + + return ( + + ); +}; + +export default PollButton; diff --git a/app/soapbox/features/compose/components/spoiler_button.js b/app/soapbox/features/compose/components/spoiler_button.js deleted file mode 100644 index 13ec3083ed1caca2f6904cd918e964a1a569a303..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 995 zcma)4!ET&D488LezQIbnv-fRDqeiOKL!~IqJsQBf>jq}%j7d`={=FV%2q=}Ra)4d? z+0XWS)b-Xe+&kMp{_fGk+1U>AUj83A1o96VMa%>0np56|-)m}w2G3;h8+xxV==VV8 z2iE-6a0}D6=0FmX!lmh*mF6D5Sl4|Xn5{`*b*y9N=`5+IYR-ka+8WQ$B_b%_F&AS7 z&}sLK%?U;zdFR_s%J-I9bSh%uD!D;_EC*nhb8&V`g=$y@&5{iF7fU7fs_~7D(L>4(F>HGz?=V z(|XoSH3U(k$fd+V9ubjV@U+UWDr?)YAb>S@E!EH48&Ne2X>^*rA6gmF8OYHYrw=U zmSdPn1;^^eP({2ke0uY2vL2k)$YPXD!&p|1@w*bG^OWPf?dGBj