Skip to content

Commit

Permalink
make title selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Dec 14, 2024
1 parent 372583b commit 5f87385
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/react/AppStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export default ({
return (
<Screen
className='small-content'
titleSelectable={isError}
title={
<>
<span style={{
userSelect: isError ? 'text' : undefined,
wordBreak: 'break-word',
}}
>
Expand Down
5 changes: 3 additions & 2 deletions src/react/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f87385

Please sign in to comment.