Skip to content

Commit 31a69c0

Browse files
committed
refactor: centralize external links in shared constants
1 parent 5af1ccd commit 31a69c0

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/renderer/src/components/support/CommunitySection.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { Card, CardContent } from '@renderer/components/ui/card'
22
import { Button } from '@renderer/components/ui/button'
33
import { MessageCircle, Bell, HelpCircle, Users, ExternalLink } from 'lucide-react'
4+
import { EXTERNAL_LINKS } from '@shared/constants/links'
45
import whatsappQr from '../../../../../resources/whatsapp-qr.png?asset'
56

6-
const WHATSAPP_LINK = 'https://chat.whatsapp.com/L4LMwxsbjPk514I1ToRris'
7-
87
export const CommunitySection = () => {
98
const benefits = [
109
{
@@ -74,7 +73,7 @@ export const CommunitySection = () => {
7473
</p>
7574
<Button
7675
className="bg-gradient-to-r from-green-500 to-emerald-500 hover:from-green-600 hover:to-emerald-600 text-white"
77-
onClick={() => window.open(WHATSAPP_LINK, '_blank')}
76+
onClick={() => window.open(EXTERNAL_LINKS.WHATSAPP_COMMUNITY, '_blank')}
7877
>
7978
<MessageCircle className="h-4 w-4 mr-2" />
8079
Join WhatsApp Community

src/renderer/src/components/support/ReportIssue.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import {
1414
} from 'lucide-react'
1515
import { useSettings } from '@renderer/contexts/SettingsContext'
1616
import { useState } from 'react'
17-
18-
const WHATSAPP_LINK = 'https://chat.whatsapp.com/L4LMwxsbjPk514I1ToRris'
17+
import { EXTERNAL_LINKS } from '@shared/constants/links'
1918

2019
export const ReportIssue = () => {
2120
const { appVersion } = useSettings()
@@ -131,7 +130,7 @@ export const ReportIssue = () => {
131130
<MessageCircle className="h-3 w-3 inline-block mr-1" />
132131
Prefer chat? Join our{' '}
133132
<button
134-
onClick={() => window.open(WHATSAPP_LINK, '_blank')}
133+
onClick={() => window.open(EXTERNAL_LINKS.WHATSAPP_COMMUNITY, '_blank')}
135134
className="text-green-500 hover:underline"
136135
>
137136
WhatsApp Community

src/shared/constants/links.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const EXTERNAL_LINKS = {
2+
WHATSAPP_COMMUNITY: 'https://chat.whatsapp.com/L4LMwxsbjPk514I1ToRris',
3+
GITHUB_REPO: 'https://github.com/wavezync/opnotes',
4+
GITHUB_ISSUES: 'https://github.com/wavezync/opnotes/issues',
5+
GITHUB_DISCUSSIONS: 'https://github.com/wavezync/opnotes/discussions'
6+
} as const

0 commit comments

Comments
 (0)