diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0c7dde..8008c6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ on: - - push - - pull_request + pull_request: + push: + branches: + - master + - beta jobs: build: name: Test Build diff --git a/package.json b/package.json index 9348fc4..c428a28 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "react-syntax-highlighter": "^12.2.1", "react-with-important-style": "^0.2.2", "semantic-ui-css": "^2.4.1", - "semantic-ui-react": "^0.88.2", + "semantic-ui-react": "^1.1.0", "sha.js": "^2.4.11", "typed.js": "^2.0.11" }, @@ -45,6 +45,6 @@ ] }, "devDependencies": { - "react-git-info": "^1.1.0" + "react-git-info": "^2.0.0" } } diff --git a/src/routes/Home.js b/src/routes/Home.js index 6cb3af7..df89a4f 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -131,6 +131,16 @@ class Home extends React.Component { + {this.state.message ? ( + + ) : ( + '' + )} { ads.top && (
@@ -154,17 +164,6 @@ class Home extends React.Component { content="국내 디스코드봇들을 확인하고, 초대해보세요!" /> - {this.state.message ? ( - - ) : ( - '' - )} -

카테고리로 빠르게 찾아보기:

{cats.map(r => ( <> @@ -412,6 +411,11 @@ const messages = { level: 'success', title: '봇 신고 성공!', message: '신고 내용이 관리자에게 전달되었습니다.' + }, + delete: { + level: 'success', + title: '봇 삭제 성공!', + message: '봇이 삭제처리되셨습니다.' } } diff --git a/src/routes/ManageBot.js b/src/routes/ManageBot.js index 1a5ba54..f7d962a 100644 --- a/src/routes/ManageBot.js +++ b/src/routes/ManageBot.js @@ -13,7 +13,8 @@ import { Image, Button, Popup, - Table + Table, + Modal } from 'semantic-ui-react' import Redirect from '../components/Redirect' import ReactMarkdown from 'react-markdown/with-html' @@ -36,6 +37,7 @@ class ManageBot extends Component { token: '', owners: '', ownersError: '', + delete: '', info: { code: 0 }, data: { state: 0, data: {} } } @@ -144,6 +146,21 @@ class ManageBot extends Component { else window.location.reload() }) } + + removeBot = async() => { + const token = localStorage.token, + id = localStorage.id, + date = localStorage.date + await fetch(config.api + '/bots/' + this.state.info.data.id, { + method: 'DELETE', + headers: { token, id, time: date } + }) + .then(r => r.json()) + .then(res => { + if (res.code !== 200) alert(res.message) + else window.location.href = '/?message=delete' + }) + } async componentDidMount() { const res = await fetch( config.api + '/bots/completeInfo/' + this.props.match.params.id, @@ -450,10 +467,20 @@ class ManageBot extends Component {

봇을 삭제합니다

봇을 영구적으로 삭제합니다.

- } - /> + } closeIcon> + + {bot.name} 삭제하기 + + + +

봇을 삭제하시려면 {bot.name} 을 입력해주세요.

+ +

+ 봇을 삭제하시게되면 다시는 복구하실 수 없다는 점을 동의합니다.
+