make title selectable

This commit is contained in:
Vitaly Turovsky 2024-12-14 10:34:28 +03:00
commit 5f87385486
3 changed files with 8 additions and 3 deletions

View file

@ -38,10 +38,10 @@ export default ({
return (
<Screen
className='small-content'
titleSelectable={isError}
title={
<>
<span style={{
userSelect: isError ? 'text' : undefined,
wordBreak: 'break-word',
}}
>

View file

@ -4,15 +4,16 @@ interface Props {
backdrop?: boolean | 'dirt'
style?: React.CSSProperties
className?: string
titleSelectable?: boolean
}
export default ({ title, children, backdrop = true, style, className }: Props) => {
export default ({ title, children, backdrop = true, style, className, titleSelectable }: Props) => {
return (
<>
{backdrop === 'dirt' ? <div className='dirt-bg' /> : backdrop ? <div className="backdrop" /> : null}
<div className={`fullscreen ${className}`} style={{ overflow: 'auto', ...style }}>
<div className="screen-content">
<div className="screen-title">{title}</div>
<div className={`screen-title ${titleSelectable ? 'text-select' : ''}`}>{title}</div>
{children}
</div>
</div>

View file

@ -181,6 +181,10 @@ body::xr-overlay #viewer-canvas {
color: #999;
}
.text-select {
user-select: text;
}
@media screen and (min-width: 430px) {
.span-2 {
grid-column: span 2;