Добавил кликабельность ссылок на профили
This commit is contained in:
parent
b4652faa97
commit
6abf440f5e
|
|
@ -96,6 +96,10 @@
|
||||||
justify-content: space-around
|
justify-content: space-around
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title-header-link:hover {
|
||||||
|
color: #6F7E8C;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (width <= 570px) {
|
@media (width <= 570px) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export default function ItemDialog({ blacklistItem, open, handleClose }: { black
|
||||||
onClose={() => handleClose()}
|
onClose={() => handleClose()}
|
||||||
>
|
>
|
||||||
<DialogTitle>
|
<DialogTitle>
|
||||||
<TitleHeader name={width < 570 ? trimLink(blacklistItem?.link) : blacklistItem?.link} handleClose={handleClose}/>
|
<TitleHeader name={blacklistItem?.link} handleClose={handleClose} isLink={true}/>
|
||||||
<TagList
|
<TagList
|
||||||
afk={blacklistItem?.afk}
|
afk={blacklistItem?.afk}
|
||||||
cheater={blacklistItem?.cheater}
|
cheater={blacklistItem?.cheater}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
import useWindowDimensions from "~/hooks/windowDimensions";
|
||||||
|
import trimLink from "~/functions/trimLink";
|
||||||
|
|
||||||
|
export default function NameField ({name, isLink} : {name: string|undefined, isLink: boolean} ) {
|
||||||
|
if (!name){
|
||||||
|
return (<p>???</p>)
|
||||||
|
}
|
||||||
|
const { width } = useWindowDimensions();
|
||||||
|
if (isLink){
|
||||||
|
return (
|
||||||
|
<a href={name} target="_blank" className="title-header-link">{width < 570 ? trimLink(name) : name}</a>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<p>{width < 570 ? trimLink(name) : name}</p>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import {IconButton} from "@mui/material";
|
import {IconButton} from "@mui/material";
|
||||||
import CloseIcon from '@mui/icons-material/Close';
|
import CloseIcon from '@mui/icons-material/Close';
|
||||||
|
import NameField from "~/components/itemDialog/NameField";
|
||||||
|
|
||||||
export default function TitleHeader({ name, handleClose }:{ name: string|undefined, handleClose: Function }){
|
export default function TitleHeader({ name, handleClose, isLink }:{ name: string|undefined, handleClose: Function, isLink: boolean }){
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="report-title-header">
|
<div className="report-title-header">
|
||||||
<p>{name}</p>
|
<NameField name={name} isLink={isLink}/>
|
||||||
<IconButton aria-label="Close">
|
<IconButton aria-label="Close">
|
||||||
<CloseIcon sx={{color: "#E0E3E7"}} onClick={() => handleClose()}/>
|
<CloseIcon sx={{color: "#E0E3E7"}} onClick={() => handleClose()}/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ export default function ReportDialog({ open, handleClose }: { open: boolean, han
|
||||||
onClose={() => handleClose()}
|
onClose={() => handleClose()}
|
||||||
>
|
>
|
||||||
<DialogTitle>
|
<DialogTitle>
|
||||||
<TitleHeader name={'Creating Hunt: Showdown player report'} handleClose={handleClose}/>
|
<TitleHeader name={'Creating Hunt: Showdown player report'} handleClose={handleClose} isLink={false}/>
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<Divider sx={{marginTop: '10px', marginBottom: '10px', alignSelf: 'center'}}/>
|
<Divider sx={{marginTop: '10px', marginBottom: '10px', alignSelf: 'center'}}/>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue