build/static/js/137.358cfd10.chunk.js

1 line
2.7 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[137],{cfYI:function(e,t,n){},oeDK:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,r=!1,u=void 0;try{for(var l,o=e[Symbol.iterator]();!(a=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,u=e}finally{try{!a&&o.return&&o.return()}finally{if(r)throw u}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=n("q1tI"),l=s(u),o=n("eO8H");n("cfYI");var c=s(n("CnBM")),i=s(n("HUFq"));function s(e){return e&&e.__esModule?e:{default:e}}var f=(0,c.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(5),n.e(121)]).then(n.t.bind(null,"Fu44",7))},loading:i.default}),d=(0,c.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(5),n.e(122)]).then(n.t.bind(null,"6P6j",7))},loading:i.default});t.default=function(e){var t=e.match.params.username,n=e.history.location.pathname,c=e.user,i=(e.undo_messages,(0,u.useState)("undo")),s=r(i,2),m=s[0],p=s[1],E=(0,u.useState)(0),h=r(E,2),v=h[0],y=h[1],b=(0,u.useState)(0),_=r(b,2),g=_[0],j=_[1],S=(0,u.useState)(0),w=r(S,2),N=w[0],O=w[1],P=(0,u.useState)(!0),k=r(P,2),I=(k[0],k[1],e.current_user);function M(t,n){var a=n;"apply"===t?O(N-n):"undo"===t?j(g-n):(y(0),a=v),(a||0===a)&&e.deleteUndoEvent(a)}return(0,u.useEffect)((function(){t&&I&&I.login!==t&&e.history.push("/"+t)}),[I,t]),(0,u.useEffect)((function(){c&&(j(c.undo_transfer_projects),O(c.undo_join_projects),y(c.undo_messages))}),[c]),(0,u.useEffect)((function(){n&&t&&(n==="/"+t+"/notice"&&p("undo"),n==="/"+t+"/notice/apply"&&p("apply"))}),[n,c]),l.default.createElement("div",null,l.default.createElement("ul",{className:"noticeMenu"},l.default.createElement("li",{className:"undo"===m?"active":""},l.default.createElement(o.Link,{to:"/"+t+"/notice"},l.default.createElement("span",null,"接收仓库"),g?l.default.createElement("span",{className:"unNum"},g):"")),l.default.createElement("li",{className:"apply"===m?"active":""},l.default.createElement(o.Link,{to:"/"+t+"/notice/apply"},l.default.createElement("span",null,"成员申请"),N?l.default.createElement("span",{className:"unNum"},N):""))),l.default.createElement(o.Switch,null,l.default.createElement(o.Route,{path:"/:username/notice/apply",render:function(t){return l.default.createElement(f,a({},e,t,{deleteEvent:M}))}}),l.default.createElement(o.Route,{path:"/:username/notice",render:function(t){return l.default.createElement(d,a({},e,t,{deleteEvent:M}))}})))}}}]);