(self.webpackChunk_studyhub_co_react_comments_django_client=self.webpackChunk_studyhub_co_react_comments_django_client||[]).push([[22],{30022:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HomePage:()=>F,default:()=>T,mapDispatchToProps:()=>L});var n=r(67294),a=(r(45697),r(15482)),o=r(99095),c=r(37424),s=r(35281),i=r(22222),u=r(92148),d=r(29473),l=r(3500),m=r(41293),p=r(49656),f=r(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 y=(0,o.vU)({djedditReactWelcome:{id:"".concat(v,".welcome.header"),defaultMessage:"Welcome to the djeddit-react!"},startProjectHeader:{id:"".concat(v,".start_project.header"),defaultMessage:"Start your next react project in seconds!"},startProjectMessage:{id:"".concat(v,".start_project.message"),defaultMessage:"A highly scalable, offline-first foundation with the best DX and a focus on performance and best practices"},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 _=r(39727),b="boilerplate/Home/CHANGE_USERNAME";var w=r(18172),D={username:""};const P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,t=arguments.length>1?arguments[1]:void 0;return(0,w.ZP)(e,(function(e){switch(t.type){case b:e.username=t.username.replace(/@/gi,"")}}))};var x,j,k,E=function(e){return e.home||D},M=function(){return(0,i.P1)(E,(function(e){return e.username}))},S=r(73375),C=r(8425),R=r(77775),H=regeneratorRuntime.mark(N),A=regeneratorRuntime.mark(W);function N(){var e,t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,S.select)(M());case 2:return e=n.sent,t="https://api.github.com/users/".concat(e,"/repos?type=all&sort=updated"),n.prev=4,n.next=7,(0,S.call)(R.Z,t);case 7:return r=n.sent,n.next=10,(0,S.put)((0,_.reposLoaded)(r,e));case 10:n.next=16;break;case 12:return n.prev=12,n.t0=n.catch(4),n.next=16,(0,S.put)((0,_.repoLoadingError)(n.t0));case 16:case"end":return n.stop()}}),H,null,[[4,12]])}function W(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.takeLatest)(C.W0,N);case 2:case"end":return e.stop()}}),A)}function Z(e,t,r,n){k||(k="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var a=e&&e.defaultProps,o=arguments.length-3;if(t||0===o||(t={children:void 0}),1===o)t.children=n;else if(o>1){for(var c=new Array(o),s=0;s<o;s++)c[s]=arguments[s+3];t.children=c}if(t&&a)for(var i in a)void 0===t[i]&&(t[i]=a[i]);else t||(t=a||{});return{$$typeof:k,type:e,key:void 0===r?null:""+r,ref:null,props:t,_owner:null}}var I="home",U=window.DJEDDIT_CONFIG,z=!1;function F(e){var t=e.username,r=(e.loading,e.error,e.repos,e.onSubmitForm);e.onChangeUsername;return(0,u.v)({key:I,reducer:P}),(0,d.h)({key:I,saga:W}),(0,n.useEffect)((function(){t&&t.trim().length>0&&r()}),[]),z?x||(x=Z(p.l_,{to:"topics"})):Z("article",{},void 0,j||(j=Z(a.q,{},void 0,Z("title",{},void 0,"Home Page"),Z("meta",{name:"description",content:"React comments Django homepage"}))),Z("div",{},void 0,Z(h,{},void 0,Z(m.Z,{},void 0,n.createElement(o._H,y.djedditReactWelcome)),Z("p",{})),Z(g,{})))}U&&(z=U.EMBEDDED_MODE);var G=(0,i.zB)({repos:(0,l.zW)(),username:M(),loading:(0,l.DO)(),error:(0,l.hz)()});function L(e){return{onChangeUsername:function(t){return e((r=t.target.value,{type:b,username:r}));var r},onSubmitForm:function(t){void 0!==t&&t.preventDefault&&t.preventDefault(),e((0,_.loadRepos)())}}}var O=(0,c.connect)(G,L);const T=(0,s.compose)(O,n.memo)(F)}}]);