Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48e05c3

Browse files
textarea and multi-line notes
1 parent6c76e74 commit48e05c3

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

‎db.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@
2020
"id":"78486737-f03f-4da1-a40c-460149e7cf87",
2121
"createdAt":"2022-09-17T16:16:02.765Z",
2222
"updatedAt":"2022-09-17T16:18:04.640Z"
23+
},
24+
{
25+
"text":"asdasdsad\nAsadasds\nasdasdasdad",
26+
"priority":"low",
27+
"id":"52ceb228-fc3b-440e-b849-31351a188498",
28+
"createdAt":"2022-09-17T19:00:58.267Z",
29+
"updatedAt":"2022-09-17T19:00:58.267Z"
30+
},
31+
{
32+
"text":"line 1\nline 2\nline 3\nline 4\n",
33+
"priority":"low",
34+
"id":"a1ad66bb-7f36-48f2-b6b0-e21dfadd5d63",
35+
"createdAt":"2022-09-17T19:01:13.245Z",
36+
"updatedAt":"2022-09-17T19:01:13.245Z"
37+
},
38+
{
39+
"text":"sdasdadasd asdasd sad asda. asd as das d asd as das d das d sa dd asd das dd\n a sd sa d asdsad\n sad sadas d asd sad\n a sd sa das d asdsa\n\n\nasdsdasdasd",
40+
"priority":"low",
41+
"id":"32a0c88d-45cc-4997-bc03-9c5dd31093aa",
42+
"createdAt":"2022-09-17T19:02:48.509Z",
43+
"updatedAt":"2022-09-17T19:02:48.509Z"
2344
}
2445
]
2546
}

‎src/components/add-note/add-note.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.add-noteinput{
2-
line-height:2rem;
1+
.add-notetextarea{
32
width:60%;
43
border:0;
54
padding:0;
5+
vertical-align: bottom;
66
}
77
.add-notebutton{
88
line-height:2rem;

‎src/components/add-note/add-note.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function AddNote(props: AddNoteProps) {
1616
consttheme=useContext(ThemeContext);
1717
const{ state, dispatch}=useContext(StateContext);
1818

19-
consthandleChange=(e:React.ChangeEvent<HTMLInputElement>)=>{
19+
consthandleChange=(e:React.ChangeEvent<HTMLTextAreaElement>)=>{
2020
setText(e.target.value);
2121
};
2222

@@ -78,7 +78,8 @@ function AddNote(props: AddNoteProps) {
7878
return(
7979
<CardbgColor={theme==='dark' ?'#333' :'#ddd'}height="2"padding="1">
8080
<formclassName="add-note">
81-
<inputtype="text"onChange={handleChange}value={text}/>
81+
<textareaonChange={handleChange}value={text}></textarea>
82+
{/* <input type="text" onChange={handleChange} value={text} /> */}
8283
<selectonChange={handleSelect}value={priority}>
8384
<optionvalue="high">High</option>
8485
<optionvalue="medium">Medium</option>

‎src/components/note/note.css‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,13 @@
1313
}
1414
.date{
1515
font-size:0.3rem;
16+
}
17+
.text{
18+
white-space: pre-wrap;
19+
overflow: hidden;
20+
text-overflow: ellipsis;
21+
display: -webkit-box;
22+
-webkit-line-clamp:2;/* number of lines to show */
23+
line-clamp:2;
24+
-webkit-box-orient: vertical;
1625
}

‎src/components/note/note.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ function Note(props: NoteProps) {
3939
?props.priority&&ColorDark[props.priority]
4040
:props.priority&&ColorLight[props.priority]
4141
}
42-
height="2"
42+
height="3"
4343
padding="1"
4444
>
4545
<>
46-
<div>{props.text}</div>
46+
<divclassName='text'>{props.text}</div>
4747
<divclassName='left-corner date'>{props.updatedAt.toLocaleString()}</div>
4848
<divclassName="right-corner">
4949
<FaEditonClick={()=>editNote(props.note)}></FaEdit>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp