-
Войти через Minecraft
+ {title}
setExpanded(false)} />
-
Этот способ будет работать, если вы привязали аккаунт Minecraft в личном кабинете.
+ {login &&
Этот способ будет работать, если вы привязали аккаунт Minecraft в личном кабинете.
}
Зайдите на Minecraft сервер
` selectText('oauth_name')}>
oauth.pplbandage.ru
@@ -80,6 +82,7 @@ const MinecraftConnect = ({ children, onInput }: MinecraftConnectProps) => {
if (target.value.length != 6) return;
onInput(target.value)
+ .then(() => setExpanded(false))
.catch(response => {
const data = response.data as { message: string };
const err = document.getElementById('error') as HTMLParagraphElement;
diff --git a/src/app/modules/utils/apiManager.ts b/src/app/modules/utils/apiManager.ts
index 06717b7..0b1c573 100644
--- a/src/app/modules/utils/apiManager.ts
+++ b/src/app/modules/utils/apiManager.ts
@@ -167,12 +167,12 @@ class ApiManager {
}
/* Set public profile */
- static async setPublicProfile(params: { state: boolean }): Promise {
- return (await this.doRequest({
+ static async setPublicProfile(params: { state: boolean }): Promise {
+ await this.doRequest({
url: `/user/me`,
method: 'PATCH',
data: { public: params.state }
- })).data.new_data;
+ });
}
/* Set user profile theme */
diff --git a/src/app/styles/EditConfirmation.module.css b/src/app/styles/EditConfirmation.module.css
new file mode 100644
index 0000000..b8f9fbe
--- /dev/null
+++ b/src/app/styles/EditConfirmation.module.css
@@ -0,0 +1,25 @@
+.button {
+ color: var(--main-text-color);
+ background-color: var(--main-card-color);
+ border-radius: 10px;
+ border: 1px var(--main-element-color) solid;
+ height: 2.4rem;
+ box-sizing: border-box;
+ cursor: auto;
+ transition: background-color 250ms, border 150ms;
+ font-weight: 600;
+ font-family: inherit;
+ font-size: 1rem;
+ display: flex;
+ align-items: center;
+ flex-direction: row;
+ justify-content: center;
+}
+
+.available {
+ cursor: pointer;
+}
+
+.available:hover {
+ background-color: #ED4245;
+}
\ No newline at end of file
diff --git a/src/app/styles/me/me.module.css b/src/app/styles/me/me.module.css
index 121d029..1f3a349 100644
--- a/src/app/styles/me/me.module.css
+++ b/src/app/styles/me/me.module.css
@@ -49,10 +49,8 @@
.login_main {
position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
+ inset: 0;
+ z-index: 2;
display: flex;
align-items: center;
diff --git a/src/app/styles/minecraftConnect.module.css b/src/app/styles/minecraftConnect.module.css
index df6b098..7017b53 100644
--- a/src/app/styles/minecraftConnect.module.css
+++ b/src/app/styles/minecraftConnect.module.css
@@ -11,7 +11,7 @@
position: fixed;
inset: 0;
z-index: 9000;
- background-color: rgba(0, 0, 0, 0.4);
+ background-color: rgba(0, 0, 0, 0.6);
}
.container {
diff --git a/src/app/workshop/[id]/client.tsx b/src/app/workshop/[id]/client.tsx
index 43f2987..ed5348b 100644
--- a/src/app/workshop/[id]/client.tsx
+++ b/src/app/workshop/[id]/client.tsx
@@ -217,7 +217,7 @@ export default function Home({ data, referrer }: { data: Interfaces.Bandage, ref
diff --git a/src/app/workshop/[id]/components/edit.tsx b/src/app/workshop/[id]/components/edit.tsx
index 4b47790..f9a1978 100644
--- a/src/app/workshop/[id]/components/edit.tsx
+++ b/src/app/workshop/[id]/components/edit.tsx
@@ -6,6 +6,7 @@ import style from "@/app/styles/editor/page.module.css";
import * as Interfaces from "@/app/interfaces";
import Select from 'react-select';
import { IconArchive, IconX } from "@tabler/icons-react";
+import EditConfirmation from "@/app/modules/components/EditConfirmation";
const lstrip = (string: string) => string.replace(/^\s+/, '');
@@ -62,21 +63,26 @@ const EditElement = ({
});
}
- const deleteBandage = () => {
- const first = confirm(`Вы собираетесь удалить повязку ${bandage.title}! Это действе необратимо! Подтверждаете?`);
- if (!first) return;
- const second = confirm('Последний шанс! Удалить?');
- if (!second) return;
- ApiManager.deleteBandage(bandage.external_id)
- .then(() => router.replace('/workshop'))
- .catch(err => alert(err.data.message));
+ const deleteBandage = async (): Promise => {
+ return new Promise((resolve, reject) => {
+ ApiManager.deleteBandage(bandage.external_id)
+ .then(() => {
+ resolve();
+ router.replace('/workshop');
+ })
+ .catch(err => reject(err.data.message))
+ });
}
- const archiveBandage = () => {
- if (!confirm('Заархивировать повязку? После архивации её будет невозможно изменить!')) return;
- ApiManager.archiveBandage(bandage.external_id)
- .then(() => window.location.reload())
- .catch(err => alert(err.data?.message || err.message));
+ const archiveBandage = (): Promise => {
+ return new Promise((resolve, reject) => {
+ ApiManager.archiveBandage(bandage.external_id)
+ .then(() => {
+ resolve();
+ window.location.reload();
+ })
+ .catch(err => reject(err.data.message))
+ });
}
return
@@ -125,10 +131,16 @@ const EditElement = ({
marginTop: '1rem',
marginBottom: '.4rem'
}}>
-
-
-
-
+
+
+
+
+
+
Удалить повязку