Skip to content

Commit

Permalink
Fixed share by text links
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 9, 2024
1 parent 9dae838 commit ed01e2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/elements/favorites-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const ShareButtons = () => {
const copyUrl = isClient ? window.location.origin + urlParams : urlParams

const smsCopy =
"sms:&body=" +
"sms:?body=" +
encodeURIComponent(
`I saved some Stanford Summer Session courses that looked interesting to me. What do you think? ${copyUrl}`
)
const emailCopy =
"mailto:?subject=" +
decodeURIComponent("Someone wants you to see their list of favorite courses from Stanford Summer Session") +
encodeURIComponent("Someone wants you to see their list of favorite courses from Stanford Summer Session") +
"&body=" +
encodeURIComponent(
`I saved some Stanford Summer Session courses that looked interesting to me. What do you think? ${copyUrl}`
Expand Down
9 changes: 7 additions & 2 deletions src/components/elements/shareCourses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ const ShareCourses = ({courseName, courseUrl, courseNum}: Props) => {
useEventListener("keydown", handleEscape, ref)

const copyUrl = courseUrl
const smsCopy = `sms:&body=Check out this course from Stanford Summer Session: ${courseName} ${copyUrl}`
const emailCopy = `mailto:?body=Check out this course from Stanford Summer Session: ${courseName} ${copyUrl} &subject=Someone shared a Stanford Summer Session course with you`
const smsCopy =
"sms:?body=" + encodeURIComponent(`Check out this course from Stanford Summer Session: ${courseName} ${copyUrl}`)
const emailCopy =
"mailto:?body=" +
encodeURIComponent(`Check out this course from Stanford Summer Session: ${courseName} ${copyUrl}`) +
"&subject=" +
encodeURIComponent("Someone shared a Stanford Summer Session course with you")

return (
<div ref={ref} className="relative flex">
Expand Down

0 comments on commit ed01e2d

Please sign in to comment.