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

Form styles #5

Open
wants to merge 3 commits into
base: addressbook-read-write
Choose a base branch
from
Open
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 components/UI/AccountBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Image from 'next/image';
const AccountBanner = ({ children, src }) => {

return (
<div className="flex flex-row justify-around items-center w-60">
<div className="flex flex-row justify-center items-center gap-2">
<Image
className="rounded-full"
src={src}
Expand Down
2 changes: 1 addition & 1 deletion helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export function marshallUser({ username, platforms }) {
username,
aliases: platforms,
};
}
}
5 changes: 1 addition & 4 deletions hooks/useAddressbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useEffect, useState } from 'react';

const useAddressbook = ({ discordId }) => {
const [addressbook, setAddressbook] = useState([]);
const [user, setUser] = useState({});
const [isLoading, setIsLoading] = useState(true);

useEffect(() => {
Expand All @@ -14,9 +13,7 @@ const useAddressbook = ({ discordId }) => {
'https://raw.githubusercontent.com/ShenaniganDApp/scoreboard/master/data/addressbook.json'
);
const json = await response.json();
json.find((user) => {
discordId === user.discordId ? setUser(user) : null;
});

setAddressbook(json);
setIsLoading(false);
};
Expand Down
20 changes: 12 additions & 8 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { formatAddress } from '../helpers/utils';
import { writeAddressbook } from '../helpers/github';

export default function Home() {
const [user, setUser] = useState({});
const [addBookEntry, setAddBookEntry] = useState({});

const { connect, address } = useWeb3Modal();
const { data: session, status } = useSession({ required: true });
Expand All @@ -31,18 +31,22 @@ export default function Home() {
: null;
});
}, [session, addressbook]);

return (
<div className={styles.container}>
<CornerTriangle origin="origin-top-right" corner={'top-0 left-0'} />
<CornerTriangle origin="origin-bottom-left" corner={'bottom-0 right-0'} />
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<title>Scoreboard Signup</title>
<meta
name="description"
content="Signup to receive weekly SHE Particle Airdrops"
/>
<link rel="icon" href="/favicon.ico" />
</Head>

<main className={`${styles.main} bg-white`}>
<div className="flex row justify-around items-center w-60 ">
<div className="absolute top-10 flex row justify-around items-center w-60 ">
<Image
className=" rounded-full"
src={session.user.image}
Expand All @@ -54,11 +58,11 @@ export default function Home() {

<div className="w-full flex flex-row justify-center items-center">
<div className="w-1/2 flex flex-col gap-5 justify-center items-start ml-10">
<AccountBanner src={'/assets/ethereum.png'}>
<AccountBanner src={'/assets/ethereum.png'}>
{addBookEntry.address
? `${formatAddress(addBookEntry.address)}`
: 'No Ethereum Address'}
</AccountBanner>
: 'No Ethereum Address'}
</AccountBanner>
<AccountBanner src={'/assets/github.png'}>
{addBookEntry.github
? addBookEntry.github
Expand Down Expand Up @@ -88,7 +92,7 @@ export default function Home() {
</button>

<a href="https://she.energy" target="_blank" rel="noopener noreferrer">
Powered by SHE
Connected by SHE
{/* <span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span> */}
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'./components/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: { colors: { 'she-pink': '#ff006c' } },
extend: { colors: { 'she-pink': '#ff006c', cornflowerblue: '#46a1f3' } },
},
plugins: [],
};
Loading