Skip to content

Commit

Permalink
wrap title text
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Aug 22, 2024
1 parent d45682e commit 1f46a7c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 27 deletions.
9 changes: 9 additions & 0 deletions ui2/src/components/Node/Document/Document.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import "../Node.module.scss";

.document {
@extend %node;

img {
height: $node-img-height;
}
}
4 changes: 2 additions & 2 deletions ui2/src/components/Node/Document/Document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import Tags from "@/components/Node/Tags"
import type {NodeType, PanelMode} from "@/types"
import classes from "./Document.module.css"
import classes from "./Document.module.scss"
import {RootState} from "@/app/types"
import PanelContext from "@/contexts/PanelContext"
import {useProtectedJpg} from "@/hooks/protected_image"
Expand Down Expand Up @@ -43,7 +43,7 @@ export default function Document({node, onClick}: Args) {
<a onClick={() => onClick(node)}>
<img src={protected_image.data || ""} />
<Tags names={tagNames} />
<div className="title">{node.title}</div>
<div className={classes.title}>{node.title}</div>
</a>
</div>
)
Expand Down
20 changes: 0 additions & 20 deletions ui2/src/components/Node/Folder/Folder.module.css

This file was deleted.

12 changes: 12 additions & 0 deletions ui2/src/components/Node/Folder/Folder.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import "../Node.module.scss";

.folder {
@extend %node;
}

.folderIcon {
background-image: url("/public/folder.svg");
background-size: 100% 100%;
width: 64px;
height: 64px;
}
4 changes: 2 additions & 2 deletions ui2/src/components/Node/Folder/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@/slices/dualPanel/dualPanel"

import Tags from "@/components/Node/Tags"
import classes from "./Folder.module.css"
import classes from "./Folder.module.scss"
import {RootState} from "@/app/types"
import type {NodeType, PanelMode} from "@/types"

Expand Down Expand Up @@ -42,7 +42,7 @@ export default function Folder({node, onClick}: Args) {
<a onClick={() => onClick(node)}>
<div className={classes.folderIcon}></div>
<Tags names={tagNames} />
<div>{node.title}</div>
<div className={classes.title}>{node.title}</div>
</a>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.document {
$node-width: 8rem;
$node-img-height: 5rem;

%node {
padding: 0.3rem;
position: relative;

Expand All @@ -7,8 +10,11 @@
outline: 1px solid #6fc5ff;
}

img {
height: 64px;
.title {
text-overflow: ellipsis;
width: $node-width;
overflow: hidden;
white-space: nowrap;
}

a {
Expand Down

0 comments on commit 1f46a7c

Please sign in to comment.