Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
4081a6f5
Commit
4081a6f5
authored
Feb 08, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add more reactions
parent
334e4898
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
215 additions
and
127 deletions
+215
-127
apidocs.swagger.yaml
api/v2/apidocs.swagger.yaml
+16
-6
reaction_service.proto
proto/api/v2/reaction_service.proto
+11
-6
README.md
proto/gen/api/v2/README.md
+11
-6
reaction_service.pb.go
proto/gen/api/v2/reaction_service.pb.go
+59
-39
README.md
proto/gen/store/README.md
+11
-6
reaction.pb.go
proto/gen/store/reaction.pb.go
+58
-38
reaction.proto
proto/store/reaction.proto
+11
-6
reaction.go
store/db/mysql/reaction.go
+1
-1
reaction.go
store/db/postgres/reaction.go
+1
-1
reaction.go
store/db/sqlite/reaction.go
+1
-1
MemoReactionListView.tsx
web/src/components/MemoReactionListView.tsx
+8
-6
ReactionSelector.tsx
web/src/components/ReactionSelector.tsx
+10
-4
ReactionView.tsx
web/src/components/ReactionView.tsx
+17
-7
No files found.
api/v2/apidocs.swagger.yaml
View file @
4081a6f5
...
...
@@ -416,12 +416,17 @@ paths:
type
:
string
enum
:
-
TYPE_UNSPECIFIED
-
EYES
-
THUMBS_UP
-
THUMBS_DOWN
-
HEART
-
FIRE
-
CLAPPING_HANDS
-
LAUGH
-
OK_HAND
-
ROCKET
-
THUMBS_DOWN
-
THUMBS_UP
-
EYES
-
THINKING_FACE
-
CLOWN_FACE
default
:
TYPE_UNSPECIFIED
tags
:
-
MemoService
...
...
@@ -1541,12 +1546,17 @@ definitions:
type
:
string
enum
:
-
TYPE_UNSPECIFIED
-
EYES
-
THUMBS_UP
-
THUMBS_DOWN
-
HEART
-
FIRE
-
CLAPPING_HANDS
-
LAUGH
-
OK_HAND
-
ROCKET
-
THUMBS_DOWN
-
THUMBS_UP
-
EYES
-
THINKING_FACE
-
CLOWN_FACE
default
:
TYPE_UNSPECIFIED
apiv2RowStatus
:
type
:
string
...
...
proto/api/v2/reaction_service.proto
View file @
4081a6f5
...
...
@@ -13,12 +13,17 @@ message Reaction {
enum
Type
{
TYPE_UNSPECIFIED
=
0
;
EYES
=
1
;
HEART
=
2
;
LAUGH
=
3
;
ROCKET
=
4
;
THUMBS_DOWN
=
5
;
THUMBS_UP
=
6
;
THUMBS_UP
=
1
;
THUMBS_DOWN
=
2
;
HEART
=
3
;
FIRE
=
4
;
CLAPPING_HANDS
=
5
;
LAUGH
=
6
;
OK_HAND
=
7
;
ROCKET
=
8
;
EYES
=
9
;
THINKING_FACE
=
10
;
CLOWN_FACE
=
11
;
}
Type
reaction_type
=
4
;
}
proto/gen/api/v2/README.md
View file @
4081a6f5
...
...
@@ -1171,12 +1171,17 @@ Used internally for obfuscating the page token.
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNSPECIFIED | 0 | |
| EYES | 1 | |
| HEART | 2 | |
| LAUGH | 3 | |
| ROCKET | 4 | |
| THUMBS_DOWN | 5 | |
| THUMBS_UP | 6 | |
| THUMBS_UP | 1 | |
| THUMBS_DOWN | 2 | |
| HEART | 3 | |
| FIRE | 4 | |
| CLAPPING_HANDS | 5 | |
| LAUGH | 6 | |
| OK_HAND | 7 | |
| ROCKET | 8 | |
| EYES | 9 | |
| THINKING_FACE | 10 | |
| CLOWN_FACE | 11 | |
...
...
proto/gen/api/v2/reaction_service.pb.go
View file @
4081a6f5
...
...
@@ -24,33 +24,48 @@ type Reaction_Type int32
const
(
Reaction_TYPE_UNSPECIFIED
Reaction_Type
=
0
Reaction_EYES
Reaction_Type
=
1
Reaction_HEART
Reaction_Type
=
2
Reaction_LAUGH
Reaction_Type
=
3
Reaction_ROCKET
Reaction_Type
=
4
Reaction_THUMBS_DOWN
Reaction_Type
=
5
Reaction_THUMBS_UP
Reaction_Type
=
6
Reaction_THUMBS_UP
Reaction_Type
=
1
Reaction_THUMBS_DOWN
Reaction_Type
=
2
Reaction_HEART
Reaction_Type
=
3
Reaction_FIRE
Reaction_Type
=
4
Reaction_CLAPPING_HANDS
Reaction_Type
=
5
Reaction_LAUGH
Reaction_Type
=
6
Reaction_OK_HAND
Reaction_Type
=
7
Reaction_ROCKET
Reaction_Type
=
8
Reaction_EYES
Reaction_Type
=
9
Reaction_THINKING_FACE
Reaction_Type
=
10
Reaction_CLOWN_FACE
Reaction_Type
=
11
)
// Enum value maps for Reaction_Type.
var
(
Reaction_Type_name
=
map
[
int32
]
string
{
0
:
"TYPE_UNSPECIFIED"
,
1
:
"EYES"
,
2
:
"HEART"
,
3
:
"LAUGH"
,
4
:
"ROCKET"
,
5
:
"THUMBS_DOWN"
,
6
:
"THUMBS_UP"
,
0
:
"TYPE_UNSPECIFIED"
,
1
:
"THUMBS_UP"
,
2
:
"THUMBS_DOWN"
,
3
:
"HEART"
,
4
:
"FIRE"
,
5
:
"CLAPPING_HANDS"
,
6
:
"LAUGH"
,
7
:
"OK_HAND"
,
8
:
"ROCKET"
,
9
:
"EYES"
,
10
:
"THINKING_FACE"
,
11
:
"CLOWN_FACE"
,
}
Reaction_Type_value
=
map
[
string
]
int32
{
"TYPE_UNSPECIFIED"
:
0
,
"EYES"
:
1
,
"HEART"
:
2
,
"LAUGH"
:
3
,
"ROCKET"
:
4
,
"THUMBS_DOWN"
:
5
,
"THUMBS_UP"
:
6
,
"THUMBS_UP"
:
1
,
"THUMBS_DOWN"
:
2
,
"HEART"
:
3
,
"FIRE"
:
4
,
"CLAPPING_HANDS"
:
5
,
"LAUGH"
:
6
,
"OK_HAND"
:
7
,
"ROCKET"
:
8
,
"EYES"
:
9
,
"THINKING_FACE"
:
10
,
"CLOWN_FACE"
:
11
,
}
)
...
...
@@ -157,7 +172,7 @@ var File_api_v2_reaction_service_proto protoreflect.FileDescriptor
var
file_api_v2_reaction_service_proto_rawDesc
=
[]
byte
{
0x0a
,
0x1d
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x2f
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x5f
,
0x73
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x12
,
0x0c
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x22
,
0x
ff
,
0x01
,
0x0c
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x22
,
0x
ce
,
0x02
,
0x0a
,
0x08
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x0e
,
0x0a
,
0x02
,
0x69
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x02
,
0x69
,
0x64
,
0x12
,
0x18
,
0x0a
,
0x07
,
0x63
,
0x72
,
0x65
,
0x61
,
0x74
,
0x6f
,
0x72
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x07
,
0x63
,
0x72
,
0x65
,
...
...
@@ -167,25 +182,30 @@ var file_api_v2_reaction_service_proto_rawDesc = []byte{
0x74
,
0x79
,
0x70
,
0x65
,
0x18
,
0x04
,
0x20
,
0x01
,
0x28
,
0x0e
,
0x32
,
0x1b
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x2e
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x2e
,
0x54
,
0x79
,
0x70
,
0x65
,
0x52
,
0x0c
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x54
,
0x79
,
0x70
,
0x65
,
0x22
,
0x68
,
0x0a
,
0x04
,
0x54
,
0x79
,
0x70
,
0x65
,
0x12
,
0x14
,
0x0a
,
0x10
,
0x54
,
0x59
,
0x50
,
0x45
,
0x5f
,
0x55
,
0x4e
,
0x53
,
0x50
,
0x45
,
0x43
,
0x49
,
0x46
,
0x49
,
0x45
,
0x44
,
0x10
,
0x00
,
0x12
,
0x08
,
0x0a
,
0x04
,
0x45
,
0x59
,
0x45
,
0x53
,
0x10
,
0x01
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x48
,
0x45
,
0x41
,
0x52
,
0x54
,
0x10
,
0x02
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x4c
,
0x41
,
0x55
,
0x47
,
0x48
,
0x10
,
0x03
,
0x12
,
0x0a
,
0x0a
,
0x06
,
0x52
,
0x4f
,
0x43
,
0x4b
,
0x45
,
0x54
,
0x10
,
0x04
,
0x12
,
0x0f
,
0x0a
,
0x0b
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x44
,
0x4f
,
0x57
,
0x4e
,
0x10
,
0x05
,
0x12
,
0x0d
,
0x0a
,
0x09
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x55
,
0x50
,
0x10
,
0x06
,
0x42
,
0xac
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x42
,
0x14
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x30
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x32
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x32
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x3a
,
0x56
,
0x32
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x6e
,
0x54
,
0x79
,
0x70
,
0x65
,
0x22
,
0xb6
,
0x01
,
0x0a
,
0x04
,
0x54
,
0x79
,
0x70
,
0x65
,
0x12
,
0x14
,
0x0a
,
0x10
,
0x54
,
0x59
,
0x50
,
0x45
,
0x5f
,
0x55
,
0x4e
,
0x53
,
0x50
,
0x45
,
0x43
,
0x49
,
0x46
,
0x49
,
0x45
,
0x44
,
0x10
,
0x00
,
0x12
,
0x0d
,
0x0a
,
0x09
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x55
,
0x50
,
0x10
,
0x01
,
0x12
,
0x0f
,
0x0a
,
0x0b
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x44
,
0x4f
,
0x57
,
0x4e
,
0x10
,
0x02
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x48
,
0x45
,
0x41
,
0x52
,
0x54
,
0x10
,
0x03
,
0x12
,
0x08
,
0x0a
,
0x04
,
0x46
,
0x49
,
0x52
,
0x45
,
0x10
,
0x04
,
0x12
,
0x12
,
0x0a
,
0x0e
,
0x43
,
0x4c
,
0x41
,
0x50
,
0x50
,
0x49
,
0x4e
,
0x47
,
0x5f
,
0x48
,
0x41
,
0x4e
,
0x44
,
0x53
,
0x10
,
0x05
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x4c
,
0x41
,
0x55
,
0x47
,
0x48
,
0x10
,
0x06
,
0x12
,
0x0b
,
0x0a
,
0x07
,
0x4f
,
0x4b
,
0x5f
,
0x48
,
0x41
,
0x4e
,
0x44
,
0x10
,
0x07
,
0x12
,
0x0a
,
0x0a
,
0x06
,
0x52
,
0x4f
,
0x43
,
0x4b
,
0x45
,
0x54
,
0x10
,
0x08
,
0x12
,
0x08
,
0x0a
,
0x04
,
0x45
,
0x59
,
0x45
,
0x53
,
0x10
,
0x09
,
0x12
,
0x11
,
0x0a
,
0x0d
,
0x54
,
0x48
,
0x49
,
0x4e
,
0x4b
,
0x49
,
0x4e
,
0x47
,
0x5f
,
0x46
,
0x41
,
0x43
,
0x45
,
0x10
,
0x0a
,
0x12
,
0x0e
,
0x0a
,
0x0a
,
0x43
,
0x4c
,
0x4f
,
0x57
,
0x4e
,
0x5f
,
0x46
,
0x41
,
0x43
,
0x45
,
0x10
,
0x0b
,
0x42
,
0xac
,
0x01
,
0x0a
,
0x10
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x61
,
0x70
,
0x69
,
0x2e
,
0x76
,
0x32
,
0x42
,
0x14
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x53
,
0x65
,
0x72
,
0x76
,
0x69
,
0x63
,
0x65
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x30
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x61
,
0x70
,
0x69
,
0x2f
,
0x76
,
0x32
,
0x3b
,
0x61
,
0x70
,
0x69
,
0x76
,
0x32
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x41
,
0x58
,
0xaa
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x41
,
0x70
,
0x69
,
0x2e
,
0x56
,
0x32
,
0xca
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0xe2
,
0x02
,
0x18
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x41
,
0x70
,
0x69
,
0x5c
,
0x56
,
0x32
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0e
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x41
,
0x70
,
0x69
,
0x3a
,
0x3a
,
0x56
,
0x32
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
var
(
...
...
proto/gen/store/README.md
View file @
4081a6f5
...
...
@@ -213,12 +213,17 @@
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNSPECIFIED | 0 | |
| EYES | 1 | |
| HEART | 2 | |
| LAUGH | 3 | |
| ROCKET | 4 | |
| THUMBS_DOWN | 5 | |
| THUMBS_UP | 6 | |
| THUMBS_UP | 1 | |
| THUMBS_DOWN | 2 | |
| HEART | 3 | |
| FIRE | 4 | |
| CLAPPING_HANDS | 5 | |
| LAUGH | 6 | |
| OK_HAND | 7 | |
| ROCKET | 8 | |
| EYES | 9 | |
| THINKING_FACE | 10 | |
| CLOWN_FACE | 11 | |
...
...
proto/gen/store/reaction.pb.go
View file @
4081a6f5
...
...
@@ -24,33 +24,48 @@ type Reaction_Type int32
const
(
Reaction_TYPE_UNSPECIFIED
Reaction_Type
=
0
Reaction_EYES
Reaction_Type
=
1
Reaction_HEART
Reaction_Type
=
2
Reaction_LAUGH
Reaction_Type
=
3
Reaction_ROCKET
Reaction_Type
=
4
Reaction_THUMBS_DOWN
Reaction_Type
=
5
Reaction_THUMBS_UP
Reaction_Type
=
6
Reaction_THUMBS_UP
Reaction_Type
=
1
Reaction_THUMBS_DOWN
Reaction_Type
=
2
Reaction_HEART
Reaction_Type
=
3
Reaction_FIRE
Reaction_Type
=
4
Reaction_CLAPPING_HANDS
Reaction_Type
=
5
Reaction_LAUGH
Reaction_Type
=
6
Reaction_OK_HAND
Reaction_Type
=
7
Reaction_ROCKET
Reaction_Type
=
8
Reaction_EYES
Reaction_Type
=
9
Reaction_THINKING_FACE
Reaction_Type
=
10
Reaction_CLOWN_FACE
Reaction_Type
=
11
)
// Enum value maps for Reaction_Type.
var
(
Reaction_Type_name
=
map
[
int32
]
string
{
0
:
"TYPE_UNSPECIFIED"
,
1
:
"EYES"
,
2
:
"HEART"
,
3
:
"LAUGH"
,
4
:
"ROCKET"
,
5
:
"THUMBS_DOWN"
,
6
:
"THUMBS_UP"
,
0
:
"TYPE_UNSPECIFIED"
,
1
:
"THUMBS_UP"
,
2
:
"THUMBS_DOWN"
,
3
:
"HEART"
,
4
:
"FIRE"
,
5
:
"CLAPPING_HANDS"
,
6
:
"LAUGH"
,
7
:
"OK_HAND"
,
8
:
"ROCKET"
,
9
:
"EYES"
,
10
:
"THINKING_FACE"
,
11
:
"CLOWN_FACE"
,
}
Reaction_Type_value
=
map
[
string
]
int32
{
"TYPE_UNSPECIFIED"
:
0
,
"EYES"
:
1
,
"HEART"
:
2
,
"LAUGH"
:
3
,
"ROCKET"
:
4
,
"THUMBS_DOWN"
:
5
,
"THUMBS_UP"
:
6
,
"THUMBS_UP"
:
1
,
"THUMBS_DOWN"
:
2
,
"HEART"
:
3
,
"FIRE"
:
4
,
"CLAPPING_HANDS"
:
5
,
"LAUGH"
:
6
,
"OK_HAND"
:
7
,
"ROCKET"
:
8
,
"EYES"
:
9
,
"THINKING_FACE"
:
10
,
"CLOWN_FACE"
:
11
,
}
)
...
...
@@ -167,7 +182,7 @@ var File_store_reaction_proto protoreflect.FileDescriptor
var
file_store_reaction_proto_rawDesc
=
[]
byte
{
0x0a
,
0x14
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x2f
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x2e
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x12
,
0x0b
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x22
,
0x
a2
,
0x02
,
0x0a
,
0x08
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x6f
,
0x72
,
0x65
,
0x22
,
0x
f1
,
0x02
,
0x0a
,
0x08
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x12
,
0x0e
,
0x0a
,
0x02
,
0x69
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x02
,
0x69
,
0x64
,
0x12
,
0x1d
,
0x0a
,
0x0a
,
0x63
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x64
,
0x5f
,
0x74
,
0x73
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x09
,
0x63
,
0x72
,
0x65
,
0x61
,
0x74
,
0x65
,
0x64
,
0x54
,
0x73
,
0x12
,
...
...
@@ -178,24 +193,29 @@ var file_store_reaction_proto_rawDesc = []byte{
0x0d
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x5f
,
0x74
,
0x79
,
0x70
,
0x65
,
0x18
,
0x05
,
0x20
,
0x01
,
0x28
,
0x0e
,
0x32
,
0x1a
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x2e
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x2e
,
0x54
,
0x79
,
0x70
,
0x65
,
0x52
,
0x0c
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x54
,
0x79
,
0x70
,
0x65
,
0x22
,
0x68
,
0x0a
,
0x04
,
0x54
,
0x79
,
0x70
,
0x65
,
0x12
,
0x14
,
0x0a
,
0x10
,
0x54
,
0x59
,
0x50
,
0x45
,
0x5f
,
0x55
,
0x4e
,
0x53
,
0x50
,
0x45
,
0x43
,
0x49
,
0x46
,
0x49
,
0x45
,
0x44
,
0x10
,
0x00
,
0x12
,
0x08
,
0x0a
,
0x04
,
0x45
,
0x59
,
0x45
,
0x53
,
0x10
,
0x01
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x48
,
0x45
,
0x41
,
0x52
,
0x54
,
0x10
,
0x02
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x4c
,
0x41
,
0x55
,
0x47
,
0x48
,
0x10
,
0x03
,
0x12
,
0x0a
,
0x0a
,
0x06
,
0x52
,
0x4f
,
0x43
,
0x4b
,
0x45
,
0x54
,
0x10
,
0x04
,
0x12
,
0x0f
,
0x0a
,
0x0b
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x44
,
0x4f
,
0x57
,
0x4e
,
0x10
,
0x05
,
0x12
,
0x0d
,
0x0a
,
0x09
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x55
,
0x50
,
0x10
,
0x06
,
0x42
,
0x98
,
0x01
,
0x0a
,
0x0f
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x42
,
0x0d
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x29
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x53
,
0x58
,
0xaa
,
0x02
,
0x0b
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0xca
,
0x02
,
0x0b
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0xe2
,
0x02
,
0x17
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x52
,
0x0c
,
0x72
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x54
,
0x79
,
0x70
,
0x65
,
0x22
,
0xb6
,
0x01
,
0x0a
,
0x04
,
0x54
,
0x79
,
0x70
,
0x65
,
0x12
,
0x14
,
0x0a
,
0x10
,
0x54
,
0x59
,
0x50
,
0x45
,
0x5f
,
0x55
,
0x4e
,
0x53
,
0x50
,
0x45
,
0x43
,
0x49
,
0x46
,
0x49
,
0x45
,
0x44
,
0x10
,
0x00
,
0x12
,
0x0d
,
0x0a
,
0x09
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x55
,
0x50
,
0x10
,
0x01
,
0x12
,
0x0f
,
0x0a
,
0x0b
,
0x54
,
0x48
,
0x55
,
0x4d
,
0x42
,
0x53
,
0x5f
,
0x44
,
0x4f
,
0x57
,
0x4e
,
0x10
,
0x02
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x48
,
0x45
,
0x41
,
0x52
,
0x54
,
0x10
,
0x03
,
0x12
,
0x08
,
0x0a
,
0x04
,
0x46
,
0x49
,
0x52
,
0x45
,
0x10
,
0x04
,
0x12
,
0x12
,
0x0a
,
0x0e
,
0x43
,
0x4c
,
0x41
,
0x50
,
0x50
,
0x49
,
0x4e
,
0x47
,
0x5f
,
0x48
,
0x41
,
0x4e
,
0x44
,
0x53
,
0x10
,
0x05
,
0x12
,
0x09
,
0x0a
,
0x05
,
0x4c
,
0x41
,
0x55
,
0x47
,
0x48
,
0x10
,
0x06
,
0x12
,
0x0b
,
0x0a
,
0x07
,
0x4f
,
0x4b
,
0x5f
,
0x48
,
0x41
,
0x4e
,
0x44
,
0x10
,
0x07
,
0x12
,
0x0a
,
0x0a
,
0x06
,
0x52
,
0x4f
,
0x43
,
0x4b
,
0x45
,
0x54
,
0x10
,
0x08
,
0x12
,
0x08
,
0x0a
,
0x04
,
0x45
,
0x59
,
0x45
,
0x53
,
0x10
,
0x09
,
0x12
,
0x11
,
0x0a
,
0x0d
,
0x54
,
0x48
,
0x49
,
0x4e
,
0x4b
,
0x49
,
0x4e
,
0x47
,
0x5f
,
0x46
,
0x41
,
0x43
,
0x45
,
0x10
,
0x0a
,
0x12
,
0x0e
,
0x0a
,
0x0a
,
0x43
,
0x4c
,
0x4f
,
0x57
,
0x4e
,
0x5f
,
0x46
,
0x41
,
0x43
,
0x45
,
0x10
,
0x0b
,
0x42
,
0x98
,
0x01
,
0x0a
,
0x0f
,
0x63
,
0x6f
,
0x6d
,
0x2e
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x42
,
0x0d
,
0x52
,
0x65
,
0x61
,
0x63
,
0x74
,
0x69
,
0x6f
,
0x6e
,
0x50
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x50
,
0x01
,
0x5a
,
0x29
,
0x67
,
0x69
,
0x74
,
0x68
,
0x75
,
0x62
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x2f
,
0x75
,
0x73
,
0x65
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x6d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2f
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x2f
,
0x67
,
0x65
,
0x6e
,
0x2f
,
0x73
,
0x74
,
0x6f
,
0x72
,
0x65
,
0xa2
,
0x02
,
0x03
,
0x4d
,
0x53
,
0x58
,
0xaa
,
0x02
,
0x0b
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x2e
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0xca
,
0x02
,
0x0b
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0xe2
,
0x02
,
0x17
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x5c
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x5c
,
0x47
,
0x50
,
0x42
,
0x4d
,
0x65
,
0x74
,
0x61
,
0x64
,
0x61
,
0x74
,
0x61
,
0xea
,
0x02
,
0x0c
,
0x4d
,
0x65
,
0x6d
,
0x6f
,
0x73
,
0x3a
,
0x3a
,
0x53
,
0x74
,
0x6f
,
0x72
,
0x65
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
var
(
...
...
proto/store/reaction.proto
View file @
4081a6f5
...
...
@@ -17,12 +17,17 @@ message Reaction {
enum
Type
{
TYPE_UNSPECIFIED
=
0
;
EYES
=
1
;
HEART
=
2
;
LAUGH
=
3
;
ROCKET
=
4
;
THUMBS_DOWN
=
5
;
THUMBS_UP
=
6
;
THUMBS_UP
=
1
;
THUMBS_DOWN
=
2
;
HEART
=
3
;
FIRE
=
4
;
CLAPPING_HANDS
=
5
;
LAUGH
=
6
;
OK_HAND
=
7
;
ROCKET
=
8
;
EYES
=
9
;
THINKING_FACE
=
10
;
CLOWN_FACE
=
11
;
}
Type
reaction_type
=
5
;
}
store/db/mysql/reaction.go
View file @
4081a6f5
...
...
@@ -45,7 +45,7 @@ func (d *DB) ListReactions(ctx context.Context, find *store.FindReaction) ([]*st
reaction_type
FROM reaction
WHERE `
+
strings
.
Join
(
where
,
" AND "
)
+
`
ORDER BY id
DE
SC`
,
ORDER BY id
A
SC`
,
args
...
,
)
if
err
!=
nil
{
...
...
store/db/postgres/reaction.go
View file @
4081a6f5
...
...
@@ -44,7 +44,7 @@ func (d *DB) ListReactions(ctx context.Context, find *store.FindReaction) ([]*st
reaction_type
FROM reaction
WHERE `
+
strings
.
Join
(
where
,
" AND "
)
+
`
ORDER BY id
DE
SC`
,
ORDER BY id
A
SC`
,
args
...
,
)
if
err
!=
nil
{
...
...
store/db/sqlite/reaction.go
View file @
4081a6f5
...
...
@@ -45,7 +45,7 @@ func (d *DB) ListReactions(ctx context.Context, find *store.FindReaction) ([]*st
reaction_type
FROM reaction
WHERE `
+
strings
.
Join
(
where
,
" AND "
)
+
`
ORDER BY id
DE
SC`
,
ORDER BY id
A
SC`
,
args
...
,
)
if
err
!=
nil
{
...
...
web/src/components/MemoReactionListView.tsx
View file @
4081a6f5
...
...
@@ -33,12 +33,14 @@ const MemoReactionListView = (props: Props) => {
},
[
reactions
]);
return
(
<
div
className=
"w-full mt-2 flex flex-row justify-start items-start flex-wrap gap-1 select-none"
>
{
currentUser
&&
<
ReactionSelector
memo=
{
memo
}
/>
}
{
Array
.
from
(
reactionGroup
).
map
(([
reactionType
,
users
])
=>
{
return
<
ReactionView
key=
{
`${reactionType.toString()} ${users.length}`
}
memo=
{
memo
}
reactionType=
{
reactionType
}
users=
{
users
}
/>;
})
}
</
div
>
(
currentUser
||
reactionGroup
.
size
>
0
)
&&
(
<
div
className=
"w-full mt-2 flex flex-row justify-start items-start flex-wrap gap-1 select-none"
>
{
currentUser
&&
<
ReactionSelector
memo=
{
memo
}
/>
}
{
Array
.
from
(
reactionGroup
).
map
(([
reactionType
,
users
])
=>
{
return
<
ReactionView
key=
{
`${reactionType.toString()} ${users.length}`
}
memo=
{
memo
}
reactionType=
{
reactionType
}
users=
{
users
}
/>;
})
}
</
div
>
)
);
};
...
...
web/src/components/ReactionSelector.tsx
View file @
4081a6f5
...
...
@@ -15,10 +15,15 @@ interface Props {
const
REACTION_TYPES
=
[
Reaction_Type
.
THUMBS_UP
,
Reaction_Type
.
THUMBS_DOWN
,
Reaction_Type
.
LAUGH
,
Reaction_Type
.
HEART
,
Reaction_Type
.
FIRE
,
Reaction_Type
.
CLAPPING_HANDS
,
Reaction_Type
.
LAUGH
,
Reaction_Type
.
OK_HAND
,
Reaction_Type
.
ROCKET
,
Reaction_Type
.
EYES
,
Reaction_Type
.
THINKING_FACE
,
Reaction_Type
.
CLOWN_FACE
,
];
const
ReactionSelector
=
(
props
:
Props
)
=>
{
...
...
@@ -46,6 +51,7 @@ const ReactionSelector = (props: Props) => {
}
catch
(
error
)
{
// skip error.
}
setOpen
(
false
);
};
return
(
...
...
@@ -57,16 +63,16 @@ const ReactionSelector = (props: Props) => {
</
MenuButton
>
<
Menu
className=
"relative text-sm"
component=
"div"
size=
"sm"
placement=
"bottom-start"
>
<
div
ref=
{
containerRef
}
>
<
div
className=
"
flex-row justify-start items-start py-0.5 px-2 h-auto font-mono space-x
-1"
>
<
div
className=
"
grid grid-cols-6 py-0.5 px-2 h-auto font-mono gap
-1"
>
{
REACTION_TYPES
.
map
((
reactionType
)
=>
{
return
(
<
div
<
span
key=
{
reactionType
}
className=
"inline-flex w-auto cursor-pointer rounded text-lg px-1 text-gray-500 dark:text-gray-400 hover:bg-zinc-100 dark:hover:bg-zinc-800"
onClick=
{
()
=>
handleReactionClick
(
reactionType
)
}
>
{
stringifyReactionType
(
reactionType
)
}
</
div
>
</
span
>
);
})
}
</
div
>
...
...
web/src/components/ReactionView.tsx
View file @
4081a6f5
...
...
@@ -15,18 +15,28 @@ interface Props {
export
const
stringifyReactionType
=
(
reactionType
:
Reaction_Type
):
string
=>
{
switch
(
reactionType
)
{
case
Reaction_Type
.
EYES
:
return
"👀"
;
case
Reaction_Type
.
THUMBS_UP
:
return
"👍"
;
case
Reaction_Type
.
THUMBS_DOWN
:
return
"👎"
;
case
Reaction_Type
.
HEART
:
return
"💗"
;
return
"💛"
;
case
Reaction_Type
.
FIRE
:
return
"🔥"
;
case
Reaction_Type
.
CLAPPING_HANDS
:
return
"👏"
;
case
Reaction_Type
.
LAUGH
:
return
"😂"
;
case
Reaction_Type
.
OK_HAND
:
return
"👌"
;
case
Reaction_Type
.
ROCKET
:
return
"🚀"
;
case
Reaction_Type
.
THUMBS_DOWN
:
return
"👎"
;
case
Reaction_Type
.
THUMBS_UP
:
return
"👍"
;
case
Reaction_Type
.
EYES
:
return
"👀"
;
case
Reaction_Type
.
THINKING_FACE
:
return
"🤔"
;
case
Reaction_Type
.
CLOWN_FACE
:
return
"🤡"
;
default
:
return
""
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment