Skip to content

Commit

Permalink
[Add] #2 一覧カード部分実装
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjyami committed Jul 2, 2022
1 parent 71096a7 commit e2e0e9b
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/viewer/components/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styles from '../styles/Home.module.css';

export default function Card({ title, imgSrc, children }) {
return (
<div className={styles.card}>
<img className={styles.cardImg} src={imgSrc} />
<h3>{title}</h3>
<p>{children}</p>
</div>
);
}
7 changes: 7 additions & 0 deletions frontend/viewer/pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}

export default MyApp
64 changes: 64 additions & 0 deletions frontend/viewer/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import Head from 'next/head';
import Image from 'next/image';
import styles from '../styles/Home.module.css';

// import web3 from "../web3/web3";
import Web3 from 'web3';

import TheHeader from '../components/TheHeader';
import Card from '../components/Card';

export default function Home() {
// const url = 'https://rpc-mumbai.maticvigil.com/';
const url = 'https://rpc-mainnet.maticvigil.com';
const web3 = new Web3(new Web3.providers.HttpProvider(url));
const contractAddress = '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB';
const abi = ['function balanceOf(address) view returns (unit)'];

/*
const contract = new web3.eth.Contract([], contractAddress);
contract.methods
.totalSupply()
.call()
.then(result => {
console.log(result);
});
*/

return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>

<TheHeader />

<main className={styles.cardWrap}>
<Card title="What is Lorem Ipsum?">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</Card>
<Card title="Why do we use it?">
It is a long established fact that a reader will be distracted by the readable content of a page when looking
at its layout.{' '}
</Card>
<Card title="Where does it come from?">Contrary to popular belief, Lorem Ipsum is not simply random text.</Card>
<Card title="Where can I get some?">
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in
some form, by injected humour, or randomised words which don't look even slightly believable.
</Card>
<Card title="What is Lorem Ipsum?">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</Card>
<Card title="Why do we use it?">
It is a long established fact that a reader will be distracted by the readable content of a page when looking
at its layout.{' '}
</Card>
</main>

<footer className={styles.footer}>Powered by xyzip</footer>
</div>
);
}
16 changes: 16 additions & 0 deletions frontend/viewer/styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

a {
color: inherit;
text-decoration: none;
}

* {
box-sizing: border-box;
}

0 comments on commit e2e0e9b

Please sign in to comment.