Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: manage link preview click (#10164)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Jan 22, 2024
1 parent 02f4cd3 commit 261c30c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion components/user/UserLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function UserLink({
username,
isEnabled = true,
manage = false,
url,
}) {
const DisplayIcon = getIcon(link.icon);
let aria = "";
Expand All @@ -38,7 +39,9 @@ export default function UserLink({

const item = (link) => (
<Link
href={`${BASE_URL}/api/profiles/${username}/links/${link._id}`}
href={
url ? url : `${BASE_URL}/api/profiles/${username}/links/${link._id}`
}
target="_blank"
rel="noopener noreferrer"
className={classNames(
Expand Down
5 changes: 3 additions & 2 deletions pages/account/manage/link/[[...data]].js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function ManageLink({ BASE_URL, username, link, groups }) {
const handleSubmit = async (e) => {
e.preventDefault();
setIsDisabled(true);

let method = "POST";
let selectedIcon = icon !== "" ? icon : "FaGlobe";
let putLink = {
Expand Down Expand Up @@ -290,8 +290,9 @@ export default function ManageLink({ BASE_URL, username, link, groups }) {
)}
<UserLink
BASE_URL={BASE_URL}
link={{ name, url, icon, animation }}
link={{ _id: link._id, name, url, icon, animation }}
username={username}
url={url}
/>
</div>
</div>
Expand Down

0 comments on commit 261c30c

Please sign in to comment.