-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 7.08 KB
/
.eslintcache
1
[{"D:\\Documents\\Programming\\Node.js\\Disq\\DisqKeiSite\\src\\upload.tsx":"1","D:\\Documents\\Programming\\Node.js\\Disq\\DisqKeiSite\\src\\index.tsx":"2","D:\\Documents\\Programming\\Node.js\\Disq\\DisqKeiSite\\src\\listen.tsx":"3"},{"size":5985,"mtime":1609629692566,"results":"4","hashOfConfig":"5"},{"size":447,"mtime":1609592358720,"results":"6","hashOfConfig":"5"},{"size":5624,"mtime":1609628476019,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"19h38ld",{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"12","messages":"13","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"14"},"D:\\Documents\\Programming\\Node.js\\Disq\\DisqKeiSite\\src\\upload.tsx",[],"D:\\Documents\\Programming\\Node.js\\Disq\\DisqKeiSite\\src\\index.tsx",[],"D:\\Documents\\Programming\\Node.js\\Disq\\DisqKeiSite\\src\\listen.tsx",["15"],"import React, { Component, ReactPropTypes } from 'react'\r\nimport ReactAudioPlayer from 'react-audio-player';\r\nimport './assets/index.css';\r\n\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { fas } from '@fortawesome/free-solid-svg-icons' \r\nimport { fab } from '@fortawesome/free-brands-svg-icons'\r\nlibrary.add(fab, fas)\r\n\r\ninterface listenTypes {\r\n exists: boolean;\r\n audio: Audio;\r\n}\r\n\r\ninterface Audio {\r\n id: string;\r\n title: string;\r\n description: string;\r\n uploaded: number;\r\n expires: number;\r\n filesize: number;\r\n filename: string;\r\n}\r\n\r\nexport default class upload extends Component<ReactPropTypes, listenTypes> {\r\n constructor(props: ReactPropTypes){\r\n super(props)\r\n this.state = {\r\n exists: false,\r\n audio: {\r\n id: \"PLSACSX\",\r\n title: \"Audio does not exist!\",\r\n description: \"PLSACSX\",\r\n uploaded: 0,\r\n expires: 0,\r\n filesize: 0,\r\n filename: \"PLSACSX\"\r\n }\r\n }\r\n }\r\n\r\n async componentDidMount() {\r\n let audioId = window.location.pathname.split(\"/\")[1]\r\n fetch(`https://api.kei.disq.me/audio/get?id=${audioId}`)\r\n .then(res => res.json())\r\n .then(async (audioResponse) => {\r\n if(!audioResponse.success) return this.setState({exists: false})\r\n this.setState({exists: true})\r\n await this.setState(audioResponse)\r\n })\r\n }\r\n\r\n render() {\r\n return (\r\n <div>\r\n <div className=\"main_container supercenter\">\r\n <div className=\"side_container listen\">\r\n <div className=\"listen_stuff\">\r\n {(this.state.exists) ? <h2>{this.state.audio.title}</h2> : void(0)}\r\n {(this.state.exists) ? <h4>{this.state.audio.description}</h4> : void(0)}\r\n {(this.state.exists) ? <p><b>Uploaded</b> - {new Date(this.state.audio.uploaded * 1000).toLocaleString()}</p> : void(0)}\r\n {(this.state.exists) ? <p><b>Expires</b> - {new Date(this.state.audio.expires * 1000).toLocaleString()}</p> : void(0)}\r\n {(this.state.exists) ? <p><b>Audio ID</b> - <code>{this.state.audio.id}</code></p> : void(0)}\r\n {(this.state.exists) ? <p><b>File size</b> - {(this.state.audio.filesize/1024/1024).toFixed(2)}MB</p> : void(0)}\r\n {(this.state.exists) ? <p><b>Audio</b> - <br/> <AudioPlayer filename={this.state.audio.filename}/></p> : void(0)}\r\n {(!this.state.exists) ? <div className=\"listen_errortext_container\"><h1>{this.state.audio.title}</h1></div> : void(0)}\r\n </div>\r\n {(this.state.exists) ? <ShareButtons filename={this.state.audio.filename}/> : void(0)}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n}\r\n\r\ninterface AudioPlayerProps {\r\n filename: string\r\n}\r\n\r\nclass AudioPlayer extends Component<AudioPlayerProps> {\r\n render() {\r\n return (\r\n <div className=\"audioplayer\">\r\n <ReactAudioPlayer src={\"https://api.kei.disq.me/storage/\" + this.props.filename} controls></ReactAudioPlayer>\r\n </div>\r\n )\r\n }\r\n}\r\n\r\ninterface ShareButtonsState {\r\n copyText: string;\r\n}\r\n\r\ninterface ShareButtonsProps {\r\n filename: string;\r\n}\r\n\r\nclass ShareButtons extends Component<ShareButtonsProps, ShareButtonsState> {\r\n constructor(props: ShareButtonsProps){\r\n super(props)\r\n this.copytoclip.bind(this)\r\n this.state = {\r\n copyText: \"Copy URL\",\r\n }\r\n }\r\n\r\n copytoclip = () => {\r\n console.log(\"clip\")\r\n navigator.clipboard.writeText(window.location.href)\r\n this.setState({copyText: \"Copied!\"})\r\n }\r\n\r\n render() {\r\n return(\r\n <div className=\"share listen_stuff\">\r\n <h1>Share</h1>\r\n <a href={\"https://twitter.com/intent/tweet?text=\" + encodeURIComponent(window.location.href)}>\r\n <button className=\"twitter copybutton\"><FontAwesomeIcon className=\"btn_icon\" icon={['fab', 'twitter']}/>Tweet</button>\r\n </a>\r\n <button onClick={this.copytoclip} className=\"copybutton\">\r\n <FontAwesomeIcon className=\"btn_icon\" icon={['fas', 'link']}/>\r\n {this.state.copyText}\r\n </button>\r\n <a href={\"https://api.kei.disq.me/storage/\" + this.props.filename} download={\"kei_\" + this.props.filename}>\r\n <button className=\"copybutton\"><FontAwesomeIcon className=\"btn_icon\" icon={['fas', 'file-download']}/>Download file</button>\r\n </a>\r\n\r\n <h1>kei</h1>\r\n <a href=\"/\">\r\n <button className=\"copybutton\"><FontAwesomeIcon className=\"btn_icon\" icon={['fas', 'file-upload']}/>Upload new file</button>\r\n </a>\r\n <a href=\"https://github.com/disqTeam/kei\">\r\n <button className=\"copybutton\"><FontAwesomeIcon className=\"btn_icon\" icon={['fab', 'github']}/>GitHub</button>\r\n </a>\r\n </div>\r\n )\r\n }\r\n}\r\n\r\nfunction ErrorScreen() {\r\n return(\r\n <div className=\"side_container listen\">\r\n <p className=\"listenError\">This audio does not exist</p>\r\n </div>\r\n )\r\n}",{"ruleId":"16","severity":1,"message":"17","line":141,"column":10,"nodeType":"18","messageId":"19","endLine":141,"endColumn":21},"@typescript-eslint/no-unused-vars","'ErrorScreen' is defined but never used.","Identifier","unusedVar"]