Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnets #125

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
"func": "netlify dev"
},
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
}
}
45 changes: 27 additions & 18 deletions src/app/[pohid]/[chain]/[request]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Hash } from "@wagmi/core";
import Arrow from "components/Arrow";
import Attachment from "components/Attachment";
import ChainLogo from "components/ChainLogo";
import ExternalLink from "components/ExternalLink";
Expand Down Expand Up @@ -316,7 +317,7 @@ export default async function Request({ params }: PageProps) {
src={ipfs(registrationFile.photo)}
width={144}
height={144}
unoptimized={true}
unoptimized={true} //Skips cache
/>
}
/>
Expand All @@ -342,7 +343,7 @@ export default async function Request({ params }: PageProps) {
<div className="flex items-center">
<Identicon diameter={24} address={request.claimer.id} />
<ExternalLink
className="text-primaryText ml-2 font-semibold underline underline-offset-2"
className="ml-2 font-semibold text-slate-400 hover:text-slate-600"
href={explorerLink(request.claimer.id, chain)}
>
{request.claimer.id.slice(0, 20)}
Expand All @@ -358,27 +359,35 @@ export default async function Request({ params }: PageProps) {
{chain.name}
</span>
</div>

<div className="mb-4 h-1 w-full border-b"></div>
<div className="mb-2 flex flex-col-reverse justify-between md:flex-row">
<div className="flex items-center">
<span className="flex items-center text-slate-400">POH ID</span>
<div className="mx-[10px]">
<Info
nbRequests={
+request.humanity.nbRequests +
+request.humanity.nbLegacyRequests
}
/>
</div>
</div>
</div>
<div className="text-orange mb-8 flex flex-wrap gap-x-[8px] gap-y-[8px] font-medium">
<div className="flex flex-row flex-wrap gap-x-[8px]">
<Link
className="text-orange flex flex-row flex-wrap gap-x-[8px] font-semibold hover:text-orange-500"
href={`/${prettifyId(pohId)}`}
>
<Image
alt="poh id"
src="/logo/pohid.svg"
height={24}
width={24}
/>
<Link className="text-orange" href={`/${prettifyId(pohId)}`}>
{prettifyId(pohId).slice(0, 20)}
<wbr />
{prettifyId(pohId).slice(20)}
</Link>
<Info
nbRequests={
+request.humanity.nbRequests +
+request.humanity.nbLegacyRequests
}
/>
</div>
{prettifyId(pohId).slice(0, 20)}
<wbr />
{prettifyId(pohId).slice(20)} <span>- Open ID</span> <Arrow />
</Link>
</div>

<div className="flex flex-col items-center md:hidden">
Expand All @@ -392,7 +401,7 @@ export default async function Request({ params }: PageProps) {
src={ipfs(registrationFile.photo)}
width={144}
height={144}
unoptimized={true}
unoptimized={true} //Skips cache
/>
}
/>
Expand Down Expand Up @@ -420,7 +429,7 @@ export default async function Request({ params }: PageProps) {
<div className="flex grid w-full flex-col justify-items-end font-normal md:flex-row md:items-end">
<Link
href={`/attachment?url=${ipfs(policyLink)}`}
className="text-primaryText ml-2 underline"
className="text-primaryText ml-2"
>
<div className="text-primaryText group relative flex py-[8px]">
Policy in force at submission
Expand Down
7 changes: 7 additions & 0 deletions src/components/Arrow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client";

import RightArrow from "icons/RightArrow.svg";

export default function Arrow() {
return <RightArrow className="h-6 w-6 stroke-2" />;
}
Comment on lines +5 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance component accessibility and reusability.

Consider the following improvements:

  1. Add aria-label for accessibility
  2. Make dimensions configurable via props
  3. Add JSDoc documentation for the component

Here's a suggested implementation:

+interface ArrowProps {
+  /** Width in pixels or CSS units */
+  width?: string | number;
+  /** Height in pixels or CSS units */
+  height?: string | number;
+  /** ARIA label for accessibility */
+  ariaLabel?: string;
+}
+
+/**
+ * Arrow component displaying a right-pointing arrow icon
+ * @param props - Component properties
+ */
-export default function Arrow() {
+export default function Arrow({ 
+  width = 6,
+  height = 6,
+  ariaLabel = "Right arrow" 
+}: ArrowProps) {
-  return <RightArrow className="h-6 w-6 stroke-2" />;
+  return (
+    <RightArrow 
+      className={`h-${height} w-${width} stroke-2`}
+      aria-label={ariaLabel}
+      role="img"
+    />
+  );
}

Committable suggestion was skipped due to low confidence.

2 changes: 1 addition & 1 deletion src/components/Vouch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Vouch: React.FC<VouchingTooltipProps> = ({
src={ipfs(photo)}
width={64}
height={64}
unoptimized={true}
unoptimized={true} //Skips cache
/>
) : (
<Identicon key={key} address={address} diameter={32} />
Expand Down
4 changes: 4 additions & 0 deletions src/icons/RightArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5717,7 +5717,12 @@ camelize@^1.0.0:
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.1.tgz#89b7e16884056331a35d6b5ad064332c91daa6c3"
integrity sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==

caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541:
caniuse-lite@^1.0.30001406:
version "1.0.30001674"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001674.tgz#eb200a716c3e796d33d30b9c8890517a72f862c8"
integrity sha512-jOsKlZVRnzfhLojb+Ykb+gyUSp9Xb57So+fAiFlLzzTKpqg8xxSav0e40c8/4F/v9N8QSvrRRaLeVzQbLqomYw==

caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541:
version "1.0.30001618"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001618.tgz"
integrity sha512-p407+D1tIkDvsEAPS22lJxLQQaG8OTBEqo0KhzfABGk0TU4juBNDSfH0hyAp/HRyx+M8L17z/ltyhxh27FTfQg==
Expand Down
Loading