Skip to content

Commit 9b96363

Browse files
committed
chore: add Discord link
1 parent 6731ec8 commit 9b96363

6 files changed

Lines changed: 63 additions & 27 deletions

File tree

README-zh.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![codecov](https://codecov.io/gh/sheepzh/time-tracker-4-browser/branch/main/graph/badge.svg?token=S98QSBSKCR&style=flat-square)](https://codecov.io/gh/sheepzh/time-tracker-4-browser)
44
[![](https://img.shields.io/badge/license-Anti%20996-blue)](https://github.com/996icu/996.ICU)
55
[![](https://img.shields.io/github/v/release/sheepzh/time-tracker-4-browser)](https://github.com/sheepzh/time-tracker-4-browser/releases)
6+
[![Discord](https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white)](https://discord.gg/yXCngD8pKS)
67

78
<p>
89
<a href="https://chromewebstore.google.com/detail/dkdhhcbjijekmneelocdllcldcpmekmm/reviews"><img src="https://developer.chrome.com/static/docs/webstore/branding/image/206x58-chrome-web-bcb82d15b2486.png" alt="Chrome Web Store" height="48"></a>
@@ -54,13 +55,25 @@
5455
<img src="./doc/screenshot/app.png" width="100%">
5556
</div>
5657

57-
## 贡献指南
58+
## 如何反馈
5859

59-
如果你想参与到该项目的开源建设,可以考虑以下几种方式
60+
如果你在使用过程中遇到了问题,或有任何想法和建议,欢迎通过以下方式告诉我们:
6061

6162
#### 提交 Issue
6263

63-
如果您有一些好的想法,或者 bug 反馈,可以新建一条 [issue](https://github.com/sheepzh/time-tracker-4-browser/issues) 。作者会在第一时间进行回复。
64+
[GitHub Issues](https://github.com/sheepzh/time-tracker-4-browser/issues) 中描述你遇到的问题或功能建议,我们会尽快回复。
65+
66+
#### 加入 Discord
67+
68+
加入我们的 [Discord 社区](https://discord.gg/yXCngD8pKS),与开发者和其他用户直接交流。
69+
70+
#### 创建 Discussion
71+
72+
[GitHub Discussions](https://github.com/sheepzh/time-tracker-4-browser/discussions) 中发起话题,适合分享使用经验或进行开放性讨论。
73+
74+
## 贡献指南
75+
76+
如果你想参与到该项目的开源建设,可以考虑以下几种方式
6477

6578
#### 参与开发
6679

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![codecov](https://codecov.io/gh/sheepzh/time-tracker-4-browser/branch/main/graph/badge.svg?token=S98QSBSKCR&style=flat-square)](https://codecov.io/gh/sheepzh/time-tracker-4-browser)
44
[![](https://img.shields.io/badge/license-Anti%20996-blue)](https://github.com/996icu/996.ICU)
55
[![Crowdin](https://badges.crowdin.net/timer-chrome-edge-firefox/localized.svg)](https://crowdin.com/project/timer-chrome-edge-firefox)
6+
[![Discord](https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white)](https://discord.gg/yXCngD8pKS)
67

78
<p>
89
<a href="https://chromewebstore.google.com/detail/dkdhhcbjijekmneelocdllcldcpmekmm/reviews"><img src="https://developer.chrome.com/static/docs/webstore/branding/image/206x58-chrome-web-bcb82d15b2486.png" alt="Available in the Chrome Web Store" height="48"></a>
@@ -53,15 +54,27 @@ Time Tracker is a browser extension to track the time you spent on all websites.
5354
<p>Page Blocking</p>
5455
</div>
5556

56-
## Contribution
57+
## Feedback
5758

58-
There are some things you can do to contribute to this software.
59+
If you encounter any issues or have suggestions during use, feel free to reach out through the following channels:
60+
61+
#### 1. Submit an Issue
62+
63+
Describe your problem or feature request in [GitHub Issues](https://github.com/sheepzh/time-tracker-4-browser/issues), and we'll get back to you as soon as possible.
64+
65+
#### 2. Join Discord
5966

60-
#### 1. Submit issues
67+
Join our [Discord community](https://discord.gg/yXCngD8pKS) to chat directly with the developer and other users.
6168

62-
You can [submit one issue](https://github.com/sheepzh/time-tracker-4-browser/issues) to us if you have some suggestions, feature requests, or feedback of bugs. And we will reply it as soon as possible.
69+
#### 3. Create a Discussion
70+
71+
Start a topic in [GitHub Discussions](https://github.com/sheepzh/time-tracker-4-browser/discussions) — great for sharing experiences or open-ended conversations.
72+
73+
## Contribution
74+
75+
There are some things you can do to contribute to this software.
6376

64-
#### 2. Participate in development
77+
#### 1. Participate in development
6578

6679
If you know how to develop browser extensions and are familiar with the project's technology stack (TypeScript + Vue3 + Element Plus + Echarts), you can also contribute code
6780

src/i18n/message/popup/header-resource.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"en": {
33
"rating": "Submit rating",
4+
"discord": "Join Discord",
45
"showSiteName": "Display site name",
56
"showTopN": "Display top {n}",
67
"donutChart": "Displayed as donut charts"

src/i18n/message/popup/header.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import resource from './header-resource.json'
99

1010
export type HeaderMessage = {
1111
rating: string
12+
discord: string
1213
donutChart: string
1314
showSiteName: string
1415
showTopN: string

src/pages/icons.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ export const GitHub: Icon = () => (
1414
</svg>
1515
)
1616

17+
export const Discord: Icon = () => (
18+
<svg viewBox="0 0 1280 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
19+
<path d="M1049.062 139.672a3 3 0 0 0-1.528-1.4A970.13 970.13 0 0 0 808.162 64.06a3.632 3.632 0 0 0-3.846 1.82 674.922 674.922 0 0 0-29.8 61.2 895.696 895.696 0 0 0-268.852 0 619.082 619.082 0 0 0-30.27-61.2 3.78 3.78 0 0 0-3.848-1.82 967.378 967.378 0 0 0-239.376 74.214 3.424 3.424 0 0 0-1.576 1.352C78.136 367.302 36.372 589.38 56.86 808.708a4.032 4.032 0 0 0 1.53 2.75 975.332 975.332 0 0 0 293.65 148.378 3.8 3.8 0 0 0 4.126-1.352A696.4 696.4 0 0 0 416.24 860.8a3.72 3.72 0 0 0-2.038-5.176 642.346 642.346 0 0 1-91.736-43.706 3.77 3.77 0 0 1-0.37-6.252 502.094 502.094 0 0 0 18.218-14.274 3.638 3.638 0 0 1 3.8-0.512c192.458 87.834 400.82 87.834 591 0a3.624 3.624 0 0 1 3.848 0.466 469.066 469.066 0 0 0 18.264 14.32 3.768 3.768 0 0 1-0.324 6.252 602.814 602.814 0 0 1-91.78 43.66 3.75 3.75 0 0 0-2 5.222 782.11 782.11 0 0 0 60.028 97.63 3.728 3.728 0 0 0 4.126 1.4A972.096 972.096 0 0 0 1221.4 811.458a3.764 3.764 0 0 0 1.53-2.704c24.528-253.566-41.064-473.824-173.868-669.082zM444.982 675.16c-57.944 0-105.688-53.174-105.688-118.478s46.818-118.482 105.688-118.482c59.33 0 106.612 53.64 105.686 118.478 0 65.308-46.82 118.482-105.686 118.482z m390.76 0c-57.942 0-105.686-53.174-105.686-118.478s46.818-118.482 105.686-118.482c59.334 0 106.614 53.64 105.688 118.478 0 65.308-46.354 118.482-105.688 118.482z" />
20+
</svg>
21+
)
22+
1723
export const Heart: Icon = () => (
1824
<svg viewBox="0 0 1024 1024">
1925
<path d="M1000 248Q976.992 192 933.984 148.992 849.984 64 732.992 64q-64 0-121.504 28T512 171.008q-42.016-51.008-99.488-79.008T291.008 64Q174.016 64 90.016 150.016 47.008 193.024 24 249.024-0.992 308.032 0 371.04q0.992 68.992 28.992 130.496t79.008 104.512q4.992 4 8.992 8 14.016 12 112.992 102.016 208 191.008 256.992 235.008 11.008 8.992 24.992 8.992t24.992-8.992q32.992-30.016 180.992-164.992 158.016-144 196-179.008 52-43.008 80.992-104.992t28.992-132q0-64-24-122.016z" />

src/pages/popup/components/Header/MoreInfo.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { createTab } from "@api/chrome/tab"
22
import { Collection, MoreFilled } from '@element-plus/icons-vue'
33
import Flex from '@pages/components/Flex'
4-
import { GitHub, Heart } from '@pages/icons'
4+
import { Discord, GitHub, Heart } from '@pages/icons'
55
import { rateClicked } from '@pages/util/rate'
66
import { getColor, type ColorVariant } from '@pages/util/style'
77
import { t } from '@popup/locale'
8-
import { BUY_ME_A_COFFEE_PAGE, CHANGE_LOG_PAGE, DONATION_PAGE, REVIEW_PAGE, SOURCE_CODE_PAGE } from "@util/constant/url"
8+
import { CHANGE_LOG_PAGE, REVIEW_PAGE, SOURCE_CODE_PAGE } from "@util/constant/url"
99
import { ElDropdown, ElDropdownItem, ElDropdownMenu, ElIcon } from "element-plus"
10+
import { createStringUnionGuard } from 'typescript-guard'
1011
import { defineComponent, type FunctionalComponent, type StyleValue } from "vue"
1112
import { type JSX } from 'vue/jsx-runtime'
1213

13-
type Command = 'rate' | 'coffee' | 'donation' | 'github' | 'changelog'
14+
type Command = 'github' | 'changelog' | 'rate' | 'discord'
15+
16+
const isCommand = createStringUnionGuard<Command>('github', 'changelog', 'rate', 'discord')
1417

1518
type ItemLinkProps = {
1619
icon: JSX.Element
@@ -24,27 +27,23 @@ const ItemLink: FunctionalComponent<ItemLinkProps> = ({ icon, text, iconColor })
2427
</Flex>
2528
)
2629

30+
const HANDLERS: Record<Command, NoArgCallback> = {
31+
github: () => createTab(SOURCE_CODE_PAGE),
32+
changelog: () => createTab(CHANGE_LOG_PAGE),
33+
rate: () => {
34+
rateClicked()
35+
createTab(REVIEW_PAGE)
36+
},
37+
discord: () => createTab('https://discord.gg/yXCngD8pKS'),
38+
}
39+
2740
const MoreInfo = defineComponent<{}>(() => {
28-
const handleCmd = async (cmd: Command) => {
29-
if (cmd === 'rate') {
30-
rateClicked()
31-
createTab(REVIEW_PAGE)
32-
} else if (cmd === 'coffee') {
33-
createTab(BUY_ME_A_COFFEE_PAGE)
34-
} else if (cmd === 'github') {
35-
createTab(SOURCE_CODE_PAGE)
36-
} else if (cmd === 'changelog') {
37-
createTab(CHANGE_LOG_PAGE)
38-
} else if (cmd === 'donation') {
39-
createTab(DONATION_PAGE)
40-
}
41-
}
4241

4342
return () => (
4443
<ElDropdown
4544
size='small'
4645
trigger='click'
47-
onCommand={handleCmd}
46+
onCommand={val => isCommand(val) && HANDLERS[val]()}
4847
style={{ cursor: 'pointer' } satisfies StyleValue}
4948
v-slots={{
5049
default: () => <ElIcon><MoreFilled /></ElIcon>,
@@ -56,7 +55,10 @@ const MoreInfo = defineComponent<{}>(() => {
5655
<ElDropdownItem command={'changelog' satisfies Command}>
5756
<ItemLink icon={<Collection />} text={t(msg => msg.base.changeLog)} />
5857
</ElDropdownItem>
59-
<ElDropdownItem command={'rate' satisfies Command} divided>
58+
<ElDropdownItem command={'discord' satisfies Command} divided>
59+
<ItemLink icon={<Discord />} text={t(msg => msg.header.discord)} />
60+
</ElDropdownItem>
61+
<ElDropdownItem command={'rate' satisfies Command}>
6062
<ItemLink icon={<Heart />} text={t(msg => msg.header.rating)} iconColor="danger" />
6163
</ElDropdownItem>
6264
</ElDropdownMenu>

0 commit comments

Comments
 (0)