From 0cdf898b378eecc3d63af7f6541f0f92226bc047 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 26 Mar 2022 18:11:26 -0500 Subject: [PATCH] Convert Polls to TSX --- app/soapbox/components/{poll.js => poll.tsx} | Bin 6331 -> 6506 bytes app/soapbox/containers/poll_container.js | Bin 251 -> 0 bytes app/soapbox/containers/poll_container.ts | 17 +++++++++++++++++ package.json | 1 + yarn.lock | 7 +++++++ 5 files changed, 25 insertions(+) rename app/soapbox/components/{poll.js => poll.tsx} (56%) delete mode 100644 app/soapbox/containers/poll_container.js create mode 100644 app/soapbox/containers/poll_container.ts diff --git a/app/soapbox/components/poll.js b/app/soapbox/components/poll.tsx similarity index 56% rename from app/soapbox/components/poll.js rename to app/soapbox/components/poll.tsx index 22e06beb0636b9c39033c9141710185c7f579f05..b11925fff078c18f19bc756df8524d2f0e347ef4 100644 GIT binary patch delta 1633 zcmbtVJ!~UI6qX}$PS(fe$1zHBx!lVg5w^5hho1uZY+r$bFc*|4Nde*{YrOkx@3FhH z+L;ZB923z%0R>?i8cGli1u`8H^ia?s3L0uCprD~UW@fz`-$_@ojd$L@_suuo``-Aw z=l^`+6Z2w!^Wq!VFrgK2@32oov65TAF#r}uZqS1vbR+7+a}g4oZ~2tFG#I^|Gjig~ zsh97$en=w@{4_)uz&`anAWZ-61l;APrheZGRaFMXC<#0Cq^hb|6;+~(Z1mgIV(#1x zI7VG!BeXQyzyJs(?A_WVstn3Rua~%OLPJ};TSj!TD~81ar3E#Qe7WiHbg0)k()3ObJOeBmAFrU6KAK8Eu~EE!)5nVD2=Z~eP}ag)e(Z5K^splQE6d{R>0ef!$X&dD z<*O};f1u1@z0xN^4|k4b2kWmLy|LR0!kF)P=*vK}QiEgaI^u5r#ynbf97QsEM4}#Y zOWe;_)>4#vc-o;Pax_j_^+CS2X48Oia0n+Y*^Luuz$K3OH4m*jhSWPfOO|(eL;&7* znbqdB*YhwjVfixe&bWGLh=23<#nsuux%P>f8A&VWN#8aSq%fi(OUjgd(r>x|&dy*X zHJ@H6VJi?JkE0;TPd}HBDMu~5M~^)+g3b)whE+5&E=n zE1z&;V!N>VjJ#bughrz=W@_nx2nx&6pcybU<#*o4Xc9_%TloBGo!&;DK5)CP_-Scn z^xoCR)J!@xVsCzP^!K$~?lSUl?%B=3_Hb;k#G(L^ym}e~b;4}oWUZJ^==?R`7N5-( z#lgZ+agx@sGHgm9@%_RVf-K%H0o1GVmJ3uceJbLk#eed661ovO;^X43k-W1u;o^_t zc1Zy`s`YyJG_k(qi=UU8`C1YdGo^AW+^AXled-b2tII2ssBbNIZmG4p{N+taWTWMc Pth}uLMas%O(lq}8&y*=B delta 1517 zcmb_c&u`~{qp8MKUaHHxI(UB|Q$G%j^vs|G zm$!tv$!jZNYO1VQX>TptMy=R_<@{1RTp&dAP#vYA+lZu& zJWy)4Y5PISq{k94?jd zXJmI*Lu;nI58^1v`1BwIlnj3|c(2?=DSUK|@-k}LMpOP}BEqfV3w*7wkG~t9+H^CJ8`6A{*anL!kj-Xc5w3}E8sgp{FRISAlzWSx zf$+Z2?1($pJ4}U1$W$Yp`B3bM|?`18<O|IH^N(iQ5W;?tNQ8a<(}>$|9I|FBDNTFQ zug7-y%=q1?%hYL$qd2)Be>VP-FHBq@luhGwy)K~$;^Xe`jihLzJ%^yxF{LR!{S0wdM aQ=bFNEh;~L$AMI?!tcfs4pOw0=CWxHgJ3)H%{I~R#B9@eyB1zi$6*Viz2mGm97>zZ&^C* R^)&J~k^K9Ik~u_r@CJZFRE+=t diff --git a/app/soapbox/containers/poll_container.ts b/app/soapbox/containers/poll_container.ts new file mode 100644 index 0000000000..8d83977afe --- /dev/null +++ b/app/soapbox/containers/poll_container.ts @@ -0,0 +1,17 @@ +import { connect } from 'react-redux'; + +import Poll from 'soapbox/components/poll'; + +import type { RootState } from 'soapbox/store'; + +interface IPollContainer { + pollId: string, +} + +const mapStateToProps = (state: RootState, { pollId }: IPollContainer) => ({ + poll: state.polls.get(pollId), + me: state.me, +}); + + +export default connect(mapStateToProps)(Poll); diff --git a/package.json b/package.json index 4b8b7f358d..a638677434 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@types/lodash": "^4.14.180", "@types/qrcode.react": "^1.0.2", "@types/react-helmet": "^6.1.5", + "@types/react-motion": "^0.0.32", "@types/react-router-dom": "^5.3.3", "@types/react-toggle": "^4.0.3", "@types/semver": "^7.3.9", diff --git a/yarn.lock b/yarn.lock index 15eb690b99..275ca81c67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2109,6 +2109,13 @@ dependencies: "@types/react" "*" +"@types/react-motion@^0.0.32": + version "0.0.32" + resolved "https://registry.yarnpkg.com/@types/react-motion/-/react-motion-0.0.32.tgz#c7355cca054664f1aeadd7388f6890e9355e1783" + integrity sha512-xePjDdhy6/6AX3CUQCeQ2GSF0RwF+lXSpUSrm8tmdUXRf5Ps/dULwouTJ8YHhDvX7WlwYRKZjHXatadz/x3HXA== + dependencies: + "@types/react" "*" + "@types/react-redux@^7.1.16": version "7.1.18" resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.18.tgz#2bf8fd56ebaae679a90ebffe48ff73717c438e04"