Skip to content

Commit b7f4fab

Browse files
committed
Added portal to Tile House, fixed values.yaml, removed theme support for
now
1 parent d397827 commit b7f4fab

File tree

10 files changed

+93
-116
lines changed

10 files changed

+93
-116
lines changed

frontend/chart/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ spec:
2424
- name: {{ .Chart.Name }}
2525
securityContext:
2626
{{- toYaml .Values.securityContext | nindent 12 }}
27-
image: "{{ .Values.image }}"
27+
image: "{{ .Values.IMAGE }}"
2828
env:
2929
- name: NEXT_PUBLIC_API_ENDPOINT
30-
value: "https://api.{{ .Values.domain }}"
30+
value: "{{ .Values.API_ENDPOINT }}"
3131
imagePullPolicy: Always
3232
ports:
3333
- name: http
@@ -41,7 +41,7 @@ spec:
4141
httpGet:
4242
path: /
4343
port: http
44-
initialDelaySeconds: 60
44+
initialDelaySeconds: 15
4545
resources:
4646
{{- toYaml .Values.resources | nindent 12 }}
4747
{{- with .Values.nodeSelector }}

frontend/chart/values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Declare variables to be passed into your templates.
44

55
replicaCount: 2
6-
7-
image: 389059433654.dkr.ecr.us-east-1.amazonaws.com/frontend:0.2
86
imagePullSecrets: []
97
nameOverride: ""
108
fullnameOverride: ""

frontend/chart/values/prod.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
IMAGE: 389059433654.dkr.ecr.us-east-1.amazonaws.com/frontend:1.0.5
2+
API_ENDPOINT: https://api.pixelmap.io
23
DOMAINS:
34
- "pixelmap.io"
45
- "pixelmap.com"

frontend/components/Account.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import MetaMaskOnboarding from "@metamask/onboarding";
22
import { useWeb3React } from "@web3-react/core";
33
import { UserRejectedRequestError } from "@web3-react/injected-connector";
4-
import { useEffect, useLayoutEffect, useRef, useState } from "react";
4+
import { useEffect, useRef, useState } from "react";
55
import { injected } from "../utils/web3Connectors";
66
import useENSName from "../hooks/useENSName";
77
import { formatEtherscanLink, shortenIfHex } from "../utils/misc";
@@ -23,7 +23,7 @@ const Account = ({ triedToEagerConnect }: Props) => {
2323
// initialize metamask onboarding
2424
const onboarding = useRef<MetaMaskOnboarding>();
2525

26-
useLayoutEffect(() => {
26+
useEffect(() => {
2727
onboarding.current = new MetaMaskOnboarding();
2828
}, []);
2929

frontend/components/Layout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { useContext } from 'react';
2-
import { ThemeContext, ThemeSetting } from '../components/ThemeContext';
32

43
import Header from '../components/Header';
54
import Footer from '../components/Footer';
65

76
import styles from '../styles/pages/Home.module.scss';
87

98
export default function Layout({ children }) {
10-
const { theme } = useContext(ThemeContext)
119
const hours = new Date().getHours();
1210
const isDayTime = hours > 7 && hours < 20;
1311

@@ -24,4 +22,4 @@ export default function Layout({ children }) {
2422

2523
</div>
2624
)
27-
}
25+
}

frontend/components/ThemeContext.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

frontend/components/TileCard.tsx

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React, { useState } from "react";
22
import Link from 'next/link'
33
import { TileAsset } from '../types/TileAsset';
4-
4+
import portal from '../public/assets/images/portal.gif';
55
import { shortenIfHex, formatPrice, openseaLink, cleanUrl } from "../utils/misc";
66
import TileImage from './TileImage';
7+
import logo from "../public/assets/images/logo.png";
8+
import Image from "next/image";
79

810
interface TileCardProps {
911
tile: TileAsset,
@@ -20,7 +22,6 @@ export default function TileCard({tile, large}: TileCardProps) {
2022
<TileImage className={`${large ? "h-20 w-20 md:h-40 md:w-40" : "h-16 w-16 md:h-20 md:w-20"}`} image={tile.image} />
2123
</div>
2224
</div>
23-
2425
<div className={`flex-grow-1 space-y-1 ${large ? "md:space-y-3" : ""}`}>
2526
<h3 className={`text-gray-900 font-bold ${large ? "md:text-3xl" : "text-xl"} mb-1 relative`}>
2627
<span>PixelMap #{tile.id}</span>
@@ -29,35 +30,43 @@ export default function TileCard({tile, large}: TileCardProps) {
2930
<p className={"text-sm text-gray-700"}>
3031
Owner: <Link href={`/owner/${tile.owner}`}>{shortenIfHex(tile.owner, 12)}</Link>
3132
</p>
32-
33+
3334
<div className="truncate">
3435
<a href={cleanUrl(tile.url)} className={`text-blue-600 break-all truncate text-sm whitespace-normal ${large ? 'md:text-base': ''}`} target="_blank" rel="noreferrer">{tile.url}</a>
3536
</div>
36-
37+
3738
</div>
3839
</div>
3940

4041
<div className={`px-4 py-3 bg-gray-50 ${large ? "md:px-8 md:py-4" : ""}`}>
4142
<div className="flex justify-between items-center">
42-
<div>
43-
<h3 className="text-sm tracking-wide font-medium text-gray-500">Price</h3>
44-
<p className="font-bold text-lg ml-1">{formatPrice(tile)}</p>
45-
</div>
43+
<Link href={`/house/${encodeURIComponent(tile.id)}`}>
44+
<div className="nes-btn is-primary flex items-center justify-between md:px-5.5 py-1 md:py-1">
45+
<Image
46+
className="w-full h-auto"
47+
width={30}
48+
height={30}
49+
src={portal}
50+
alt="Portal"
51+
/>
52+
<div className="font-bold md:px-3" >{'Enter Tile'}</div>
53+
</div>
54+
</Link>
4655
<div>
4756
{ tile.wrapped &&
48-
<a className="nes-btn is-primary font-bold" target="_blank" href={openseaLink(tile.id)} rel="noreferrer">
49-
{tile.openseaPrice != "0" ? 'Buy on OpenSea' : 'View on OpenSea'}
50-
</a>
57+
<a className="nes-btn is-primary font-bold md:px-5.5 py-1 md:py-2.5" target="_blank" href={openseaLink(tile.id)} rel="noreferrer">
58+
{tile.openseaPrice != "0" ? 'Buy for ' + formatPrice(tile) : 'View on OpenSea'}
59+
</a>
5160
}
5261

53-
{ !tile.wrapped &&
54-
<button className="flex items-center justify-center">
55-
<div>
56-
<p className="mr-2 text-green-600">Buy on Marketplace</p>
57-
<p className="text-sm text-gray-500">(Coming soon)</p>
58-
</div>
59-
60-
</button>
62+
{ !tile.wrapped &&
63+
<button className="flex items-center justify-center">
64+
<div>
65+
<p className="mr-2 text-green-600">Not Wrapped</p>
66+
<p className="text-sm text-gray-500">(Use Etherscan)</p>
67+
</div>
68+
69+
</button>
6170
}
6271
</div>
6372
</div>

frontend/components/ToggleTheme.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

frontend/pages/_app.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState } from 'react';
22

33
import { Web3ReactProvider } from '@web3-react/core';
4-
import { ThemeProvider } from '../components/ThemeContext';
54

65
import getLibrary from '../utils/getLibrary';
76
import Layout from '../components/Layout'
@@ -12,11 +11,9 @@ function App({ Component, pageProps }) {
1211

1312
return (
1413
<Web3ReactProvider getLibrary={getLibrary}>
15-
<ThemeProvider>
16-
<Layout>
17-
<Component {...pageProps} />
18-
</Layout>
19-
</ThemeProvider>
14+
<Layout>
15+
<Component {...pageProps} />
16+
</Layout>
2017
</Web3ReactProvider>
2118
)
2219
}

frontend/pages/house/[id].tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React, { useEffect, useState } from 'react';
2+
import Head from 'next/head'
3+
import { useRouter } from 'next/router'
4+
5+
import { fetchSingleTile } from '../../utils/api';
6+
7+
import { TileAsset } from '../../types/TileAsset';
8+
import Loader from '../../components/Loader';
9+
10+
const House = () => {
11+
const [tile, setTile] = useState<TileAsset>();
12+
const [fetching, setFetching] = useState(false);
13+
const router = useRouter()
14+
const id = router.query.id as string;
15+
16+
useEffect( () => {
17+
setFetching(true);
18+
19+
fetchSingleTile(id).then( (_tile) => {
20+
setTile(_tile);
21+
setFetching(false);
22+
});
23+
}, [, id]);
24+
25+
return (
26+
<>
27+
{ !tile &&
28+
<>
29+
<Head>
30+
<title>Tile - PixelMap.io</title>
31+
<link rel="icon" href="/favicon.ico" />
32+
</Head>
33+
</>
34+
}
35+
36+
{ fetching &&
37+
<div className="flex items-center justify-center min-h-80">
38+
<Loader />
39+
</div>
40+
}
41+
42+
{ tile && !fetching &&
43+
<>
44+
<Head>
45+
<title>Tile House #{tile.id} - PixelMap.io</title>
46+
<link rel="icon" href="/favicon.ico" />
47+
</Head>
48+
</>
49+
}
50+
</>
51+
52+
);
53+
}
54+
55+
export default House

0 commit comments

Comments
 (0)