(self.webpackChunk_studyhub_co_react_comments_django_client=self.webpackChunk_studyhub_co_react_comments_django_client||[]).push([[5344],{45344:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HomePage:()=>N,default:()=>O,mapDispatchToProps:()=>k});var o=n(67294),r=n(49656),a=(n(45697),n(15482)),c=n(99095),i=n(37424),m=n(35281),s=n(22222),l=n(3500),u=n(41293),d=n(92148),f=(n(29473),n(71893));const g=f.ZP.section.withConfig({displayName:"Section",componentId:"sc-1hn1bn5-0"})(["margin:3em auto;&:first-child{margin-top:0;}"]);const h=(0,f.ZP)(g).withConfig({displayName:"CenteredSection",componentId:"sc-1lglnfg-0"})(["text-align:center;"]);var v="boilerplate.containers.HomePage";const p=(0,c.vU)({reactDjangoCommentsWelcome:{id:"".concat(v,".welcome.header"),defaultMessage:"Welcome to the react-comments-django!"},trymeHeader:{id:"".concat(v,".tryme.header"),defaultMessage:"Try me!"},trymeMessage:{id:"".concat(v,".tryme.message"),defaultMessage:"Show Github repositories by"},trymeAtPrefix:{id:"".concat(v,".tryme.atPrefix"),defaultMessage:"@"}});var y="boilerplate/Home/CHANGE_USERNAME";var _=n(18172),b={username:""};const C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments.length>1?arguments[1]:void 0;return(0,_.ZP)(e,(function(e){switch(t.type){case y:e.username=t.username.replace(/@/gi,"")}}))};var w,E,P,M=function(e){return e.home||b};function D(e,t,n,o){P||(P="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var r=e&&e.defaultProps,a=arguments.length-3;if(t||0===a||(t={children:void 0}),1===a)t.children=o;else if(a>1){for(var c=new Array(a),i=0;i<a;i++)c[i]=arguments[i+3];t.children=c}if(t&&r)for(var m in r)void 0===t[m]&&(t[m]=r[m]);else t||(t=r||{});return{$$typeof:P,type:e,key:void 0===n?null:""+n,ref:null,props:t,_owner:null}}var S=window.REACT_COMMENTS_DJANGO_CONFIG,H=!1;function N(e){var t=e.username,n=e.onSubmitForm;e.onChangeUsername;return(0,d.v)({key:"home",reducer:C}),(0,o.useEffect)((function(){t&&t.trim().length>0&&n()}),[]),H?w||(w=D(r.l_,{to:"topics"})):D("article",{},void 0,E||(E=D(a.ql,{},void 0,D("title",{},void 0,"Home Page"),D("meta",{name:"description",content:"React comments django homepage"}))),D("div",{},void 0,D(h,{},void 0,D(u.Z,{},void 0,o.createElement(c._H,p.reactDjangoCommentsWelcome)),D("p",{})),D(g,{})))}S&&(H=S.EMBEDDED_MODE);var j=(0,s.zB)({username:(0,s.P1)(M,(function(e){return e.username})),loading:(0,l.DO)(),error:(0,l.hz)()});function k(e){return{onChangeUsername:function(t){return e((n=t.target.value,{type:y,username:n}));var n}}}var A=(0,i.connect)(j,k);const O=(0,m.compose)(A,o.memo)(N)}}]);