christianyipper / portfolio

Hey! This is my portfolio project that I'm currently working on. Lots of work to be done but we're learning through this crazy journey!
https://yipper91.github.io/portfolio/
0 stars 0 forks source link

Social Media Links Broken #8

Closed christianyipper closed 6 days ago

christianyipper commented 1 week ago

Name: Broken Social Media Links

Status: Resolved

Description: Some social media links lead to nowhere.

Steps to Reproduce:

  1. Go to yipper.ca
  2. Select one of the social media icons in the navigation menu or footer

Expected Result: The selected icon should lead to the desired location in a new tab.

Actual Result: Reloads the page.

Configuration: iPhone 13: Chrome-Yes | Firefox-Yes | Edge-N/A Windows 10: Chrome-Yes | Firefox-Yes | Edge-Yes

Severity: Low

Priority: Low

Type: Bug

christianyipper commented 6 days ago

Solution

To resolve this issue, I had to use mailto to send users to their email address. I then used encodeURIComponent to set the subject line and body. Here is the code:

    const email = 'christian@yipper.ca';
    const subject = 'Your Subject';
    const body = 'Hello Christian,';

<Button
    text="christian@yipper.ca"
    link={`mailto:${email}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`}
    duration="glow-24"
/>