Добавил кликабельность ссылок на профили
This commit is contained in:
parent
b4652faa97
commit
6abf440f5e
|
|
@ -96,6 +96,10 @@
|
|||
justify-content: space-around
|
||||
}
|
||||
|
||||
.title-header-link:hover {
|
||||
color: #6F7E8C;
|
||||
}
|
||||
|
||||
|
||||
@media (width <= 570px) {
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export default function ItemDialog({ blacklistItem, open, handleClose }: { black
|
|||
onClose={() => handleClose()}
|
||||
>
|
||||
<DialogTitle>
|
||||
<TitleHeader name={width < 570 ? trimLink(blacklistItem?.link) : blacklistItem?.link} handleClose={handleClose}/>
|
||||
<TitleHeader name={blacklistItem?.link} handleClose={handleClose} isLink={true}/>
|
||||
<TagList
|
||||
afk={blacklistItem?.afk}
|
||||
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 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 (
|
||||
<>
|
||||
<div className="report-title-header">
|
||||
<p>{name}</p>
|
||||
<NameField name={name} isLink={isLink}/>
|
||||
<IconButton aria-label="Close">
|
||||
<CloseIcon sx={{color: "#E0E3E7"}} onClick={() => handleClose()}/>
|
||||
</IconButton>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ export default function ReportDialog({ open, handleClose }: { open: boolean, han
|
|||
onClose={() => handleClose()}
|
||||
>
|
||||
<DialogTitle>
|
||||
<TitleHeader name={'Creating Hunt: Showdown player report'} handleClose={handleClose}/>
|
||||
<TitleHeader name={'Creating Hunt: Showdown player report'} handleClose={handleClose} isLink={false}/>
|
||||
</DialogTitle>
|
||||
<Divider sx={{marginTop: '10px', marginBottom: '10px', alignSelf: 'center'}}/>
|
||||
<DialogContent>
|
||||
|
|
|
|||
Loading…
Reference in New Issue