Skip to content

Commit 219145f

Browse files
authored
Merge pull request #577 from Lemoncode/vnext
glow post it selected
2 parents 3007b89 + dff581d commit 219145f

File tree

6 files changed

+41
-15
lines changed

6 files changed

+41
-15
lines changed

src/App.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
--bg-table: var(--background-700);
107107
--header-table: var(--primary-300);
108108

109+
/* Note */
110+
--bg-note: #f8f4d3;
111+
--border-note: #d4c896;
112+
--shadow-note: #9a8550;
113+
109114
/* Input */
110115
--bg-input: var(--background-500);
111116
--bg-input-disabled: var(--background-600);
@@ -165,6 +170,11 @@ body {
165170
--bg-table: #f6f7f9;
166171
--header-table: var(--primary-300);
167172

173+
/* Note */
174+
--bg-note: #f8f4d3;
175+
--border-note: #d4c896;
176+
--shadow-note: #9a8550;
177+
168178
/* Toolbar */
169179
--bg-toolbar: #f0f2f5;
170180
--border-toolbar: 1.5px solid var(--primary-200);

src/pods/canvas/canvas-svg.component.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import { DatabaseTable } from './components/table/database-table.component';
1010
import { DatabaseRelationCollectionComponent } from './components/relation';
1111
import { SelectedTableFilterHighlightComponent } from './components/table/components/selected-table-filter-highlight.component';
12+
import { SelectedNoteFilterHighlightComponent } from './components/note/components';
1213
import { CANVAS_MAX_HEIGHT, CANVAS_MAX_WIDTH } from '@/core/providers';
1314
import { Note } from './components/note';
1415

@@ -65,6 +66,7 @@ export const CanvasSvgComponent: React.FC<Props> = props => {
6566
onSelectRelation={onSelectElement}
6667
/>
6768
<SelectedTableFilterHighlightComponent />
69+
<SelectedNoteFilterHighlightComponent />
6870
{canvasSchema.tables.map(table => (
6971
<DatabaseTable
7072
key={table.id}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './note-body.component';
22
export * from './note-title.component';
33
export * from './note-border.component';
4+
export * from './selected-note-filter-highlight.component';

src/pods/canvas/components/note/components/note-border.component.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ interface Props {
1010
export const NoteBorder: React.FC<Props> = props => {
1111
const { width, height, isSelected } = props;
1212

13+
const rectStyle = {
14+
filter: isSelected ? 'url(#note_component_selected)' : 'none',
15+
};
16+
1317
return (
1418
<rect
1519
x="0"
1620
y="0"
1721
width={width}
1822
height={height}
19-
className={isSelected ? classes.noteBorderSelected : classes.noteBorder}
23+
style={rectStyle}
24+
className={classes.noteBorder}
2025
/>
2126
);
2227
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const SelectedNoteFilterHighlightComponent: React.FC = () => {
2+
return (
3+
<defs>
4+
<filter id="note_component_selected" x="0" y="0">
5+
<feDropShadow
6+
dx="4"
7+
dy="4"
8+
stdDeviation="3"
9+
floodColor="var(--shadow-note)"
10+
/>
11+
</filter>
12+
</defs>
13+
);
14+
};

src/pods/canvas/components/note/note.module.css

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.noteTitleContainer {
2-
fill: #f8f4d3;
2+
fill: var(--bg-note);
33
}
44

55
.noteTitle {
@@ -15,7 +15,7 @@
1515
}
1616

1717
.noteBody {
18-
fill: #f8f4d3;
18+
fill: var(--bg-note);
1919
}
2020

2121
.noteBodyText {
@@ -36,22 +36,16 @@
3636
white-space: pre-wrap;
3737
}
3838

39-
.noteBorder {
40-
fill: none;
41-
stroke: #d4c896;
42-
stroke-width: 1;
43-
}
44-
45-
.noteBorderSelected {
46-
fill: none;
47-
stroke: #c9b155;
48-
stroke-width: 3;
49-
}
50-
5139
.noteContainer {
5240
cursor: grabbing;
5341
}
5442

43+
.noteBorder {
44+
fill: var(--bg-note);
45+
stroke: var(--border-note);
46+
stroke-width: 1;
47+
}
48+
5549
.editIcon {
5650
color: var(--text-dark);
5751
}

0 commit comments

Comments
 (0)