-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e009b9b
commit 1aeb34e
Showing
6 changed files
with
143 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import { CSSProperties, JSX, useEffect, useState } from "react"; | ||
import style_base from '@/app/styles/minecraftConnect.module.css'; | ||
import { IconBrandDiscord, IconBrandTwitch, IconFlag, IconX } from "@tabler/icons-react"; | ||
import styles from "@/app/styles/me/me.module.css"; | ||
import style_main from "@/app/styles/RolesDialog.module.css"; | ||
import ReactCSSTransition from "./CSSTransition"; | ||
import { Role } from "@/app/interfaces"; | ||
import ApiManager from "../utils/apiManager"; | ||
import IconBoosty from '@/app/resources/boosty.svg'; | ||
|
||
|
||
const RolesDialog = ({ children }: { children: JSX.Element }) => { | ||
const [expanded, setExpanded] = useState<boolean>(false); | ||
const [roles, setRoles] = useState<Role[]>([]); | ||
|
||
useEffect(() => { | ||
ApiManager.getRoles() | ||
.then(setRoles) | ||
.catch(console.error); | ||
}, []) | ||
|
||
const roles_el = roles.map((role) => { | ||
return ( | ||
<div key={role.id} className={styles.role_container}> | ||
<span style={{ backgroundColor: "#" + role.color.toString(16) }} className={styles.role_dot}> | ||
</span> | ||
<span className={styles.role_title}>{role.title}</span> | ||
</div> | ||
) | ||
}) | ||
|
||
return ( | ||
<> | ||
<span onClick={() => setExpanded(true)}> | ||
{children} | ||
</span> | ||
<ReactCSSTransition | ||
state={expanded} | ||
timeout={150} | ||
classNames={{ | ||
enter: style_base['background-enter'], | ||
exitActive: style_base['background-exit-active'], | ||
}} | ||
> | ||
<div className={style_base.background} /> | ||
</ReactCSSTransition> | ||
|
||
<ReactCSSTransition | ||
state={expanded} | ||
timeout={150} | ||
classNames={{ | ||
enter: style_base['menu-enter'], | ||
exitActive: style_base['menu-exit-active'], | ||
}}> | ||
<div className={style_base.base}> | ||
<div className={style_base.container}> | ||
<div className={style_base.header}> | ||
<h3 style={{ margin: 0, display: 'flex', gap: '.5rem', alignItems: 'center' }}><IconFlag />Роли для регистрации</h3> | ||
<IconX className={style_base.close} onClick={() => setExpanded(false)} /> | ||
</div> | ||
<p style={{ margin: 0, fontSize: '.9rem', opacity: .6 }}>Для регистрации Вы должны иметь одну из этих ролей на Discord сервере PWGood.</p> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexWrap: 'wrap' | ||
}}> | ||
{roles_el} | ||
</div> | ||
|
||
<h4 style={{ margin: 0, marginTop: '.5rem' }}>Ссылки на соцсети Пугода:</h4> | ||
<div className={style_main.container}> | ||
<a | ||
className={style_main.link} | ||
href='https://baad.pw/twitch' | ||
style={{ '--accent': '#772ce8' } as CSSProperties} | ||
> | ||
<IconBrandTwitch />Twitch | ||
</a> | ||
<a | ||
className={style_main.link} | ||
href='https://baad.pw/ds' | ||
style={{ '--accent': '#4752c4' } as CSSProperties} | ||
> | ||
<IconBrandDiscord />Discord | ||
</a> | ||
<a | ||
className={style_main.link} | ||
href='https://baad.pw/boosty' | ||
style={{ | ||
'--accent': '#f15f2c' | ||
} as CSSProperties} | ||
> | ||
<IconBoosty />Boosty | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</ReactCSSTransition> | ||
</> | ||
); | ||
} | ||
|
||
export default RolesDialog; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.link { | ||
display: flex; | ||
justify-content: center; | ||
border: 2px solid rgb(38, 38, 38); | ||
border-radius: 10px; | ||
height: 2.3rem; | ||
align-items: center; | ||
box-sizing: border-box; | ||
text-decoration: none; | ||
transition-timing-function: cubic-bezier(.4, 0, .2, 1); | ||
transition-duration: .15s; | ||
gap: .2rem; | ||
} | ||
|
||
.link:hover { | ||
background-color: var(--accent); | ||
} | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
gap: .4rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters