Skip to content

Commit 75781ff

Browse files
committed
feat(post): add shortcuts for like and unlike
1 parent e596f52 commit 75781ff

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "https://www.raycast.com/schemas/extension.json",
33
"name": "openjike",
44
"title": "OpenJike",
5+
"version": "0.0.0",
56
"description": "",
67
"icon": "command-icon.png",
78
"license": "MIT",

src/components/actions/post.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ export const LikePost = ({
4949
style: Toast.Style.Success,
5050
})
5151
}
52-
return <Action icon="👍" title="点赞" onAction={action} />
52+
return (
53+
<Action
54+
icon="👍"
55+
title="点赞"
56+
shortcut={{ modifiers: ['cmd'], key: 'l' }}
57+
onAction={action}
58+
/>
59+
)
5360
}
5461

5562
export const UnlikePost = ({
@@ -68,5 +75,12 @@ export const UnlikePost = ({
6875
style: Toast.Style.Success,
6976
})
7077
}
71-
return <Action icon="💔" title="取消点赞" onAction={action} />
78+
return (
79+
<Action
80+
icon="💔"
81+
title="取消点赞"
82+
shortcut={{ modifiers: ['cmd', 'opt'], key: 'l' }}
83+
onAction={action}
84+
/>
85+
)
7286
}

0 commit comments

Comments
 (0)