Skip to content

Commit 4861a02

Browse files
authored
Modify ShareButtons for updated Twitter URL (JhaSourav07#2411)
Updated Twitter sharing URL to use 'x.com' and added conditional text parameter. ## Description Fixes JhaSourav07#2407 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview ## Checklist before requesting a review: - [ ] I have read the `CONTRIBUTING.md` file. - [ ] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [ ] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [ ] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [ ] I have started the repo. - [ ] I have made sure that i have only one commit to merge in this PR. - [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [ ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents c091e3e + e985993 commit 4861a02

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

components/ShareButtons.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ interface ShareButtonsProps {
66
}
77

88
export default function ShareButtons({ url, title = '' }: ShareButtonsProps) {
9-
const linkedinUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(url)}`;
10-
const twitterUrl = `https://twitter.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent(title)}`;
9+
const linkedinUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(
10+
url
11+
)}`;
12+
const twitterUrl =
13+
`https://x.com/intent/tweet?url=${encodeURIComponent(url)}` +
14+
(title ? `&text=${encodeURIComponent(title)}` : '');
1115

1216
return (
1317
<div className="flex gap-3">

0 commit comments

Comments
 (0)