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

Add personal builder page #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Link from "next/link";
import { FaGithub, FaXTwitter } from "react-icons/fa6";

const Socials: React.FC = () => {
const socialPlatforms = [
{ name: "github", url: "https://github.com/krvvs", icon: <FaGithub size={24} /> },
{ name: "twitter", url: "https://x.com/xkrvsx", icon: <FaXTwitter size={24} /> },
];

return (
<div className="flex flex-row gap-4">
{socialPlatforms.map(social => (
<Link key={social.name} href={social.url} target="_blank">
{social.icon}
</Link>
))}
</div>
);
};

export default Socials;
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"use client";

import { useEffect, useState } from "react";
import Image from "next/image";
import Socials from "./components/Socials";
import type { NextPage } from "next";
import { useEnsAvatar, useEnsName } from "wagmi";
import { Address } from "~~/components/scaffold-eth";

const builderAddress = "0xe9Ad7D1C2069E0Fa9b5852Adc77C9196651BB8b8";

const KrvvsProfile: NextPage = () => {
const [ensAvatar, setEnsAvatar] = useState<string | null>();

const { data: fetchedEns } = useEnsName({
address: builderAddress,
chainId: 1,
});

const { data: fetchedEnsAvatar } = useEnsAvatar({
name: fetchedEns ? fetchedEns : "",
chainId: 1,
});

useEffect(() => {
setEnsAvatar(fetchedEnsAvatar);
}, [fetchedEnsAvatar]);
krvvs marked this conversation as resolved.
Show resolved Hide resolved

return (
<div className="flex justify-center">
<div className="w-[800px] min-w-[200px] max-w-[800px] p-[30px] m-[50px] bg-base-200 shadow-2xl rounded-2xl flex flex-col gap-6 items-center">
<div className="avatar">
<div className="w-40 rounded-full">
<Image
krvvs marked this conversation as resolved.
Show resolved Hide resolved
src={ensAvatar || "https://avatars.githubusercontent.com/u/141290516?v=4"}
alt="Builder's Avatar"
height={100}
width={100}
objectFit="cover"
krvvs marked this conversation as resolved.
Show resolved Hide resolved
/>
</div>
</div>
<div className="flex flex-col items-center gap-4">
<div className="card-title">{fetchedEns}</div>
krvvs marked this conversation as resolved.
Show resolved Hide resolved
<Socials />
</div>

<div className="text-center max-w-[400px] mt-[8px]">
<p>Hello World!</p>
<p>
I am a builder who enjoys learning and creating value, with a strong interest in bringing blockchain
technologies to life.
</p>
</div>
<div className="flex items-center mt-8">
<Address address={builderAddress} format="short" size="xs" onlyEnsOrAddress={true} />
</div>
</div>
</div>
);
};

export default KrvvsProfile;
10 changes: 10 additions & 0 deletions packages/nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ const nextConfig = {
config.externals.push("pino-pretty", "lokijs", "encoding");
return config;
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
port: "",
pathname: "/u/**",
},
],
},
};

module.exports = nextConfig;