Skip to content

Commit

Permalink
feat: enhance link styling and add new icons for IP and WHOIS info
Browse files Browse the repository at this point in the history
Refactor link elements to use inline-flex for better alignment and replace text-based icons with new icon libraries for improved visual consistency.
  • Loading branch information
ccbikai committed Oct 8, 2024
1 parent e8d6f3a commit 5e0cec3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
13 changes: 5 additions & 8 deletions components/dns/dns-result.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ function addLink(text) {
const isIP = z.string().ip().safeParse(text).success
if (isIP) {
return (
<a href={`https://html.zone/ip/query?ip=${text}`} target="blank" rel="noopener">
<a href={`https://html.zone/ip/query?ip=${text}`} target="blank" rel="noopener" className="inline-flex items-center">
{text}
{' '}
<span title="IP Info" className="bg-gray-100 text-gray-400 text-xs px-1 ml-1 w-5 inline-block text-center py-0.5 rounded-full">i</span>
<span title="IP Info" class="ml-1 w-4 h-4 icon-[oui--i-in-circle]"></span>
</a>
)
}
else if (isDomain(text)) {
return (
<a href={`https://html.zone/whois/${text}`} target="blank" rel="noopener">
<a href={`https://html.zone/whois/${text}`} target="blank" rel="noopener" className="inline-flex items-center">
{text}
{' '}
<span title="WHOIS" className="bg-gray-100 text-gray-400 text-xs px-1 ml-1 w-5 inline-block text-center py-0.5 rounded-full">w</span>
<span title="WHOIS" class="ml-1 w-4 h-4 icon-[mynaui--letter-w-circle]"></span>
</a>
)
// return <span>{text}<a href={`https://html.zone/whois/${text}`} target="blank" rel="noopener" title="WHOIS" className="bg-gray-100 text-gray-500 text-xs px-1 ml-1 w-5 inline-block text-center py-0.5 rounded-full">w</a></span>
Expand Down Expand Up @@ -96,8 +94,7 @@ export function DNSResult({ formData, region, config }) {
.toString('utf-8')
.replace(/=/g, '')
const dnsRes = await fetch(
`${dnsHost}/api/region/${region}?dns=${dnsQueryData}&resolver=${formData.resolver
}&region=${region}&_=${Math.random()}`,
`${dnsHost}/api/region/${region}?dns=${dnsQueryData}&resolver=${formData.resolver}&region=${region}&_=${Math.random()}`,
{
headers: {
Accept: 'application/dns-message',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"@iconify-json/devicon": "^1.1.33",
"@iconify-json/lucide": "^1.1.150",
"@iconify-json/mdi": "^1.1.63",
"@iconify-json/mynaui": "^1.2.6",
"@iconify-json/oui": "^1.2.0",
"@iconify-json/subway": "^1.1.10",
"@iconify/tailwind": "^0.1.4",
"@svgr/webpack": "^8.1.0",
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e0cec3

Please sign in to comment.