Skip to content

Commit

Permalink
#20 added favicon feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrat0199 committed Oct 4, 2024
1 parent 3209d57 commit 44d848f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const Manager = () => {
setPasswordArray(passwords);
};

// function to add favicon before a website
// domain format examples = google.com || dev.to || youtube.com
const getFavicon = (domain) => {
return `https://www.google.com/s2/favicons?domain=${domain}&sz=25`;
};

useEffect(() => {
getPasswords();
}, []);
Expand Down Expand Up @@ -233,6 +239,7 @@ const Manager = () => {
<tr key={index}>
<td className="py-2 border border-white text-center">
<div className="flex items-center justify-center">
<img src={getFavicon(item.site)} className="mr-3"/>
<a
href={item.site}
target="_blank"
Expand Down

0 comments on commit 44d848f

Please sign in to comment.