| 22 | import QLGetComments from './graphql/getComments' |
| 23 | |
| 24 | class GitalkComponent extends Component { |
| 25 | state = { |
| 26 | user: null, |
| 27 | issue: null, |
| 28 | comments: [], |
| 29 | localComments: [], |
| 30 | comment: '', |
| 31 | page: 1, |
| 32 | pagerDirection: 'last', |
| 33 | cursor: null, |
| 34 | previewHtml: '', |
| 35 | |
| 36 | isNoInit: false, |
| 37 | isIniting: true, |
| 38 | isCreating: false, |
| 39 | isLoading: false, |
| 40 | isLoadMore: false, |
| 41 | isLoadOver: false, |
| 42 | isIssueCreating: false, |
| 43 | isPopupVisible: false, |
| 44 | isInputFocused: false, |
| 45 | isPreview: false, |
| 46 | |
| 47 | isOccurError: false, |
| 48 | errorMsg: '', |
| 49 | } |
| 50 | constructor (props) { |
| 51 | super(props) |
| 52 | this.options = Object.assign({}, { |
| 53 | id: window.location.href, |
| 54 | number: -1, |
| 55 | labels: ['Gitalk'], |
| 56 | title: window.document.title, |
| 57 | body: '', // window.location.href + header.meta[description] |
| 58 | language: window.navigator.language || window.navigator.userLanguage, |
| 59 | perPage: 10, |
| 60 | pagerDirection: 'last', // last or first |
| 61 | createIssueManually: false, |
| 62 | distractionFreeMode: false, |
| 63 | proxy: 'https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token', |
| 64 | flipMoveOptions: { |
| 65 | staggerDelayBy: 150, |
| 66 | appearAnimation: 'accordionVertical', |
| 67 | enterAnimation: 'accordionVertical', |
| 68 | leaveAnimation: 'accordionVertical', |
| 69 | }, |
| 70 | enableHotKey: true, |
| 71 | |
| 72 | url: window.location.href, |
| 73 | |
| 74 | defaultAuthor: { |
| 75 | avatarUrl: '//avatars1.githubusercontent.com/u/29697133?s=50', |
| 76 | login: 'null', |
| 77 | url: '', |
| 78 | }, |
| 79 | |
| 80 | updateCountCallback: null |
| 81 | }, props.options) |
nothing calls this directly
no test coverage detected