From 80b631afcecce910a0b942a43604b81833c99115 Mon Sep 17 00:00:00 2001 From: smolgrrr Date: Sun, 3 Sep 2023 22:46:07 +1000 Subject: [PATCH] UI and PoW --- client/package-lock.json | 9 +++++++++ client/package.json | 1 + client/public/manifest.json | 2 +- client/src/components/Header/Header.tsx | 11 +++++++++++ client/src/components/Home.tsx | 11 ++++++++--- client/src/components/PostCard/CardContainer.tsx | 2 +- client/src/components/PostCard/PostCard.tsx | 5 ++--- client/src/index.css | 12 ++++++++++++ client/tailwind.config.js | 2 +- 9 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 client/src/components/Header/Header.tsx diff --git a/client/package-lock.json b/client/package-lock.json index 8925840..49aa75f 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -8,6 +8,7 @@ "name": "client", "version": "0.1.0", "dependencies": { + "@heroicons/react": "^2.0.18", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -2513,6 +2514,14 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@heroicons/react": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.0.18.tgz", + "integrity": "sha512-7TyMjRrZZMBPa+/5Y8lN0iyvUU/01PeMGX2+RE7cQWpEUIcb4QotzUObFkJDejj/HUH4qjP/eQ0gzzKs2f+6Yw==", + "peerDependencies": { + "react": ">= 16" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.11", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", diff --git a/client/package.json b/client/package.json index a97212f..a7a49f5 100644 --- a/client/package.json +++ b/client/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "@heroicons/react": "^2.0.18", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", diff --git a/client/public/manifest.json b/client/public/manifest.json index 5d4e0b9..9e09708 100644 --- a/client/public/manifest.json +++ b/client/public/manifest.json @@ -21,5 +21,5 @@ "start_url": ".", "display": "standalone", "theme_color": "#000000", - "background_color": "#ffffff" + "background_color": "#000000" } diff --git a/client/src/components/Header/Header.tsx b/client/src/components/Header/Header.tsx new file mode 100644 index 0000000..f8f77a6 --- /dev/null +++ b/client/src/components/Header/Header.tsx @@ -0,0 +1,11 @@ +import { CogIcon } from '@heroicons/react/24/outline'; + +export default function Header() { + return ( + + ); +} \ No newline at end of file diff --git a/client/src/components/Home.tsx b/client/src/components/Home.tsx index 6a4319b..446e766 100644 --- a/client/src/components/Home.tsx +++ b/client/src/components/Home.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { relayInit } from 'nostr-tools'; import PostCard from './PostCard/PostCard'; +import Header from './Header/Header'; // Define the Event interface interface Event { @@ -10,7 +11,7 @@ interface Event { // Add other fields if necessary } -const relay = relayInit('wss://powrelay.xyz'); +const relay = relayInit('wss://relay.damus.io'); const Home = () => { // Define the type of the state variable @@ -22,6 +23,7 @@ const Home = () => { const eventList = await relay.list([ { + ids: ['0000'], kinds: [1], limit: 10, }, @@ -39,13 +41,16 @@ const Home = () => { }, []); return ( -
+ <> +
{events.map((event, index) => ( ))}
-
+ +
+ ); }; diff --git a/client/src/components/PostCard/CardContainer.tsx b/client/src/components/PostCard/CardContainer.tsx index 61c2439..4f71473 100644 --- a/client/src/components/PostCard/CardContainer.tsx +++ b/client/src/components/PostCard/CardContainer.tsx @@ -3,7 +3,7 @@ import { PropsWithChildren } from 'react'; export default function CardContainer({ children }: PropsWithChildren) { return (
-
{children}
+
{children}
); } \ No newline at end of file diff --git a/client/src/components/PostCard/PostCard.tsx b/client/src/components/PostCard/PostCard.tsx index 4c07c8a..5fe46ca 100644 --- a/client/src/components/PostCard/PostCard.tsx +++ b/client/src/components/PostCard/PostCard.tsx @@ -5,12 +5,11 @@ const PostCard = ({ content }: { content: string }) => { return ( <> -
-
+
+
{content}
-
); diff --git a/client/src/index.css b/client/src/index.css index ec2585e..11f2170 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -1,3 +1,7 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', @@ -11,3 +15,11 @@ code { font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; } + +@layer components { + .card { + border-radius: theme('borderRadius.lg'); + padding: theme('spacing.6'); + } + /* ... */ +} \ No newline at end of file diff --git a/client/tailwind.config.js b/client/tailwind.config.js index d947ab1..a930689 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -1,6 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: [], + content: ["./src/**/*.{js,jsx,ts,tsx}"], theme: { extend: {}, },