From ad423eb0f3c3fda703db7ab9f819cc3deb61b7e8 Mon Sep 17 00:00:00 2001
From: Ivana Andersson
Date: Thu, 10 Aug 2023 10:40:08 +0300
Subject: [PATCH 01/78] fix: fix svg elements to match react syntax
---
.../LayoutComponent/LandingPage.tsx | 12 ++--
.../QuickStartBar/QuickStartBar.tsx | 68 ++++++++++++-------
2 files changed, 48 insertions(+), 32 deletions(-)
diff --git a/src/components/LayoutComponent/LandingPage.tsx b/src/components/LayoutComponent/LandingPage.tsx
index 8968c9e1..3b59f252 100644
--- a/src/components/LayoutComponent/LandingPage.tsx
+++ b/src/components/LayoutComponent/LandingPage.tsx
@@ -35,8 +35,8 @@ function Content() {
fill="none"
>
@@ -72,13 +72,13 @@ function Content() {
viewBox="0 0 20 20"
fill="none"
>
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Learn More
- Nodes Community
- Documentation
-
-
Quick Start
-
-
- )
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Learn More
+ Nodes Community
+ Documentation
+
+
Quick Start
+
+
+ )
}
-export default QuickStartBar
\ No newline at end of file
+export default QuickStartBar
From b7011e1d1e53615c2cdb64964bf9f06037eaab40 Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Thu, 10 Aug 2023 12:39:24 +0300
Subject: [PATCH 02/78] Implement card with gauge
---
src/components/DeviceStorageHealth.tsx | 59 +++++++++++++++++++
.../LayoutComponent/LandingPage.tsx | 2 +
2 files changed, 61 insertions(+)
create mode 100644 src/components/DeviceStorageHealth.tsx
diff --git a/src/components/DeviceStorageHealth.tsx b/src/components/DeviceStorageHealth.tsx
new file mode 100644
index 00000000..eaf2e62c
--- /dev/null
+++ b/src/components/DeviceStorageHealth.tsx
@@ -0,0 +1,59 @@
+import ShadowBox from './ShadowBox'
+import IconText from './IconText'
+import { Paragraph, Separator, XStack, YStack } from 'tamagui'
+import StandardGauge from './StandardGauge'
+
+const DeviceStorageHealth = () => {
+ const currentLoad = 60
+ const message = currentLoad < 80 ? 'Good' : 'Poor'
+ const data = [
+ {
+ id: 'storage',
+ label: 'Storage',
+ value: 450,
+ color: '#E95460',
+ },
+ {
+ id: 'storage',
+ label: 'Storage',
+ value: 45,
+ color: '#E95460',
+ },
+ ]
+ return (
+
+
+
+
+
+
+
+
+ Storage
+
+
+ {currentLoad} GB
+
+
+
+
+
+
+ {message}
+
+ {/* This is additional text */}
+
+
+
+ )
+}
+
+export default DeviceStorageHealth
diff --git a/src/components/LayoutComponent/LandingPage.tsx b/src/components/LayoutComponent/LandingPage.tsx
index 5a770a92..c0c97935 100644
--- a/src/components/LayoutComponent/LandingPage.tsx
+++ b/src/components/LayoutComponent/LandingPage.tsx
@@ -3,6 +3,7 @@ import './LandingPage.css'
import QuickStartBar from '../QuickStartBar/QuickStartBar'
import DeviceCPULoad from '../DeviceCPULoad'
import NodesLogo from '../NodesLogo'
+import DeviceStorageHealth from '../DeviceStorageHealth'
function LandingPage() {
return (
@@ -90,6 +91,7 @@ function Content() {
Discover Nodes
+
)
From 433265eaccc2458832b07d0e8e5542425bef271e Mon Sep 17 00:00:00 2001
From: Rickard Andersson
Date: Thu, 10 Aug 2023 13:04:41 +0300
Subject: [PATCH 03/78] testing: make `storybook` preview render properly
---
.gitignore | 1 +
.storybook/main.ts | 27 +-
.storybook/preview-head.html | 3 +
.storybook/preview.ts | 15 -
.storybook/preview.tsx | 25 ++
src/App.tsx | 3 +-
.../{LayoutComponent => }/LandingPage.css | 0
src/components/LandingPage.stories.ts | 20 +
.../{LayoutComponent => }/LandingPage.tsx | 26 +-
.../{LayoutComponent => }/LayoutComponent.tsx | 0
.../{QuickStartBar => }/QuickStartBar.css | 0
src/components/QuickStartBar.tsx | 47 +++
.../QuickStartBar/QuickStartBar.tsx | 31 --
.../{LayoutComponent => }/layout.css | 2 +-
src/index.css | 6 +-
src/main.tsx | 2 +-
src/stories/Button.stories.ts | 50 ---
src/stories/Button.tsx | 47 ---
src/stories/Configure.mdx | 364 ------------------
src/stories/Header.stories.ts | 27 --
src/stories/Header.tsx | 54 ---
src/stories/Page.stories.ts | 29 --
src/stories/Page.tsx | 73 ----
src/stories/button.css | 30 --
src/stories/header.css | 32 --
src/stories/page.css | 69 ----
26 files changed, 133 insertions(+), 850 deletions(-)
create mode 100644 .storybook/preview-head.html
delete mode 100644 .storybook/preview.ts
create mode 100644 .storybook/preview.tsx
rename src/components/{LayoutComponent => }/LandingPage.css (100%)
create mode 100644 src/components/LandingPage.stories.ts
rename src/components/{LayoutComponent => }/LandingPage.tsx (98%)
rename src/components/{LayoutComponent => }/LayoutComponent.tsx (100%)
rename src/components/{QuickStartBar => }/QuickStartBar.css (100%)
create mode 100644 src/components/QuickStartBar.tsx
delete mode 100644 src/components/QuickStartBar/QuickStartBar.tsx
rename src/components/{LayoutComponent => }/layout.css (99%)
delete mode 100644 src/stories/Button.stories.ts
delete mode 100644 src/stories/Button.tsx
delete mode 100644 src/stories/Configure.mdx
delete mode 100644 src/stories/Header.stories.ts
delete mode 100644 src/stories/Header.tsx
delete mode 100644 src/stories/Page.stories.ts
delete mode 100644 src/stories/Page.tsx
delete mode 100644 src/stories/button.css
delete mode 100644 src/stories/header.css
delete mode 100644 src/stories/page.css
diff --git a/.gitignore b/.gitignore
index 185b2502..7d3fadfb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,4 @@ dist-ssr
!.yarn/sdks
!.yarn/versions
/.tamagui/
+/storybook-static/
diff --git a/.storybook/main.ts b/.storybook/main.ts
index 6d68d18c..5cad1144 100644
--- a/.storybook/main.ts
+++ b/.storybook/main.ts
@@ -1,19 +1,20 @@
-import type { StorybookConfig } from "@storybook/react-vite";
+import type { StorybookConfig } from '@storybook/react-vite'
const config: StorybookConfig = {
- stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
+ framework: '@storybook/react-vite',
+
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
- "@storybook/addon-links",
- "@storybook/addon-essentials",
- "@storybook/addon-onboarding",
- "@storybook/addon-interactions",
+ '@storybook/addon-links',
+ '@storybook/addon-essentials',
+ '@storybook/addon-interactions',
+ 'storybook-addon-designs',
+ 'storybook-dark-mode',
],
- framework: {
- name: "@storybook/react-vite",
- options: {},
- },
+
docs: {
- autodocs: "tag",
+ autodocs: 'tag',
},
-};
-export default config;
+}
+
+export default config
diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html
new file mode 100644
index 00000000..7100922b
--- /dev/null
+++ b/.storybook/preview-head.html
@@ -0,0 +1,3 @@
+
diff --git a/.storybook/preview.ts b/.storybook/preview.ts
deleted file mode 100644
index 1c372b69..00000000
--- a/.storybook/preview.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import type { Preview } from "@storybook/react";
-
-const preview: Preview = {
- parameters: {
- actions: { argTypesRegex: "^on[A-Z].*" },
- controls: {
- matchers: {
- color: /(background|color)$/i,
- date: /Date$/,
- },
- },
- },
-};
-
-export default preview;
diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
new file mode 100644
index 00000000..8109ae5c
--- /dev/null
+++ b/.storybook/preview.tsx
@@ -0,0 +1,25 @@
+import React from 'react'
+import type { Preview } from '@storybook/react'
+import { TamaguiProvider } from '@tamagui/web'
+import { Provider as StatusProvider } from '@status-im/components'
+import '../src/index.css'
+import appConfig from '../tamagui.config'
+
+const preview: Preview = {
+ parameters: {
+ // layout: 'centered',
+ },
+ decorators: [
+ Story => {
+ return (
+
+
+
+
+
+ )
+ },
+ ],
+}
+
+export default preview
diff --git a/src/App.tsx b/src/App.tsx
index 44948ea8..0e64f693 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,10 +1,9 @@
import { TamaguiProvider } from 'tamagui'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import { Provider as StatusProvider } from '@status-im/components'
-
import './App.css'
import config from '../tamagui.config'
-import LandingPage from './components/LayoutComponent/LandingPage'
+import LandingPage from './components/LandingPage'
const router = createBrowserRouter([
{
diff --git a/src/components/LayoutComponent/LandingPage.css b/src/components/LandingPage.css
similarity index 100%
rename from src/components/LayoutComponent/LandingPage.css
rename to src/components/LandingPage.css
diff --git a/src/components/LandingPage.stories.ts b/src/components/LandingPage.stories.ts
new file mode 100644
index 00000000..8ba9e266
--- /dev/null
+++ b/src/components/LandingPage.stories.ts
@@ -0,0 +1,20 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import LandingPage from './LandingPage'
+
+const meta = {
+ title: 'Pages/LandingPage',
+ component: LandingPage,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+ argTypes: {},
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+export const Page: Story = {
+ args: {},
+}
diff --git a/src/components/LayoutComponent/LandingPage.tsx b/src/components/LandingPage.tsx
similarity index 98%
rename from src/components/LayoutComponent/LandingPage.tsx
rename to src/components/LandingPage.tsx
index 5a770a92..d6bc3dc6 100644
--- a/src/components/LayoutComponent/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,8 +1,6 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
-import QuickStartBar from '../QuickStartBar/QuickStartBar'
-import DeviceCPULoad from '../DeviceCPULoad'
-import NodesLogo from '../NodesLogo'
+import QuickStartBar from './QuickStartBar'
function LandingPage() {
return (
@@ -17,7 +15,14 @@ function Content() {
return (
-
+
+
+
+
+
+ nodesBETA
+
+
@@ -30,8 +35,8 @@ function Content() {
fill="none"
>
@@ -67,13 +72,13 @@ function Content() {
viewBox="0 0 20 20"
fill="none"
>
-
+
-
)
}
diff --git a/src/components/LayoutComponent/LayoutComponent.tsx b/src/components/LayoutComponent.tsx
similarity index 100%
rename from src/components/LayoutComponent/LayoutComponent.tsx
rename to src/components/LayoutComponent.tsx
diff --git a/src/components/QuickStartBar/QuickStartBar.css b/src/components/QuickStartBar.css
similarity index 100%
rename from src/components/QuickStartBar/QuickStartBar.css
rename to src/components/QuickStartBar.css
diff --git a/src/components/QuickStartBar.tsx b/src/components/QuickStartBar.tsx
new file mode 100644
index 00000000..8d82ad84
--- /dev/null
+++ b/src/components/QuickStartBar.tsx
@@ -0,0 +1,47 @@
+import './QuickStartBar.css'
+
+function QuickStartBar() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Learn More
+ Nodes Community
+ Documentation
+
+
Quick Start
+
+
+ )
+}
+
+export default QuickStartBar
diff --git a/src/components/QuickStartBar/QuickStartBar.tsx b/src/components/QuickStartBar/QuickStartBar.tsx
deleted file mode 100644
index 1145038f..00000000
--- a/src/components/QuickStartBar/QuickStartBar.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import './QuickStartBar.css'
-
-function QuickStartBar() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Learn More
- Nodes Community
- Documentation
-
-
Quick Start
-
-
- )
-}
-
-export default QuickStartBar
\ No newline at end of file
diff --git a/src/components/LayoutComponent/layout.css b/src/components/layout.css
similarity index 99%
rename from src/components/LayoutComponent/layout.css
rename to src/components/layout.css
index cc9c610f..5f6c2929 100644
--- a/src/components/LayoutComponent/layout.css
+++ b/src/components/layout.css
@@ -105,4 +105,4 @@ header > div {
/* height: 100%; */
height: 140%;
width: auto;
- }
\ No newline at end of file
+ }
diff --git a/src/index.css b/src/index.css
index 1019558c..63cb7388 100644
--- a/src/index.css
+++ b/src/index.css
@@ -4,7 +4,7 @@
font-weight: 400;
color-scheme: light dark;
- color: rgba(255, 255, 255, 0.87);
+ color: rgba(0, 0, 0, 0.87);
background-color: #242424;
font-synthesis: none;
@@ -14,6 +14,10 @@
-webkit-text-size-adjust: 100%;
}
+#storybook-root {
+ width: 100%;
+}
+
body {
margin: 0;
display: flex;
diff --git a/src/main.tsx b/src/main.tsx
index 3d7150da..c4fc9bba 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -6,5 +6,5 @@ import './index.css'
ReactDOM.createRoot(document.getElementById('root')!).render(
- ,
+
)
diff --git a/src/stories/Button.stories.ts b/src/stories/Button.stories.ts
deleted file mode 100644
index 7a68cbfe..00000000
--- a/src/stories/Button.stories.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { Button } from './Button';
-
-// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
-const meta = {
- title: 'Example/Button',
- component: Button,
- parameters: {
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
- layout: 'centered',
- },
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
- tags: ['autodocs'],
- // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
- argTypes: {
- backgroundColor: { control: 'color' },
- },
-} satisfies Meta;
-
-export default meta;
-type Story = StoryObj;
-
-// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
-export const Primary: Story = {
- args: {
- primary: true,
- label: 'Button',
- },
-};
-
-export const Secondary: Story = {
- args: {
- label: 'Button',
- },
-};
-
-export const Large: Story = {
- args: {
- size: 'large',
- label: 'Button',
- },
-};
-
-export const Small: Story = {
- args: {
- size: 'small',
- label: 'Button',
- },
-};
diff --git a/src/stories/Button.tsx b/src/stories/Button.tsx
deleted file mode 100644
index 3cb9c42f..00000000
--- a/src/stories/Button.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import './button.css'
-
-interface ButtonProps {
- /**
- * Is this the principal call to action on the page?
- */
- primary?: boolean
- /**
- * What background color to use
- */
- backgroundColor?: string
- /**
- * How large should the button be?
- */
- size?: 'small' | 'medium' | 'large'
- /**
- * Button contents
- */
- label: string
- /**
- * Optional click handler
- */
- onClick?: () => void
-}
-
-/**
- * Primary UI component for user interaction
- */
-export const Button = ({
- primary = false,
- size = 'medium',
- backgroundColor,
- label,
- ...props
-}: ButtonProps) => {
- const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'
- return (
-
- {label}
-
- )
-}
diff --git a/src/stories/Configure.mdx b/src/stories/Configure.mdx
deleted file mode 100644
index a50fcea3..00000000
--- a/src/stories/Configure.mdx
+++ /dev/null
@@ -1,364 +0,0 @@
-import { Meta } from "@storybook/blocks";
-
-import Github from "./assets/github.svg";
-import Discord from "./assets/discord.svg";
-import Youtube from "./assets/youtube.svg";
-import Tutorials from "./assets/tutorials.svg";
-import Styling from "./assets/styling.png";
-import Context from "./assets/context.png";
-import Assets from "./assets/assets.png";
-import Docs from "./assets/docs.png";
-import Share from "./assets/share.png";
-import FigmaPlugin from "./assets/figma-plugin.png";
-import Testing from "./assets/testing.png";
-import Accessibility from "./assets/accessibility.png";
-import Theming from "./assets/theming.png";
-import AddonLibrary from "./assets/addon-library.png";
-
-export const RightArrow = () =>
-
-
-
-
-
-
-
- # Configure your project
-
- Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
-
-
-
-
-
Add styling and CSS
-
Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.
-
Learn more
-
-
-
-
Provide context and mocking
-
Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.
-
Learn more
-
-
-
-
-
Load assets and resources
-
To link static files (like fonts) to your projects and stories, use the
- `staticDirs` configuration option to specify folders to load when
- starting Storybook.
-
Learn more
-
-
-
-
-
-
- # Do more with Storybook
-
- Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
-
-
-
-
-
-
-
Autodocs
-
Auto-generate living,
- interactive reference documentation from your components and stories.
-
Learn more
-
-
-
-
Publish to Chromatic
-
Publish your Storybook to review and collaborate with your entire team.
-
Learn more
-
-
-
-
Figma Plugin
-
Embed your stories into Figma to cross-reference the design and live
- implementation in one place.
-
Learn more
-
-
-
-
Testing
-
Use stories to test a component in all its variations, no matter how
- complex.
-
Learn more
-
-
-
-
Accessibility
-
Automatically test your components for a11y issues as you develop.
-
Learn more
-
-
-
-
Theming
-
Theme Storybook's UI to personalize it to your project.
-
Learn more
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Join our contributors building the future of UI development.
-
-
Star on GitHub
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/stories/Header.stories.ts b/src/stories/Header.stories.ts
deleted file mode 100644
index 458391a3..00000000
--- a/src/stories/Header.stories.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-
-import { Header } from './Header';
-
-const meta = {
- title: 'Example/Header',
- component: Header,
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
- tags: ['autodocs'],
- parameters: {
- // More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
- layout: 'fullscreen',
- },
-} satisfies Meta;
-
-export default meta;
-type Story = StoryObj;
-
-export const LoggedIn: Story = {
- args: {
- user: {
- name: 'Jane Doe',
- },
- },
-};
-
-export const LoggedOut: Story = {};
diff --git a/src/stories/Header.tsx b/src/stories/Header.tsx
deleted file mode 100644
index 3bccb939..00000000
--- a/src/stories/Header.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Button } from './Button'
-import './header.css'
-
-type User = {
- name: string
-}
-
-interface HeaderProps {
- user?: User
- onLogin: () => void
- onLogout: () => void
- onCreateAccount: () => void
-}
-
-export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
-
-)
diff --git a/src/stories/Page.stories.ts b/src/stories/Page.stories.ts
deleted file mode 100644
index 69852a2b..00000000
--- a/src/stories/Page.stories.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { within, userEvent } from '@storybook/testing-library';
-
-import { Page } from './Page';
-
-const meta = {
- title: 'Example/Page',
- component: Page,
- parameters: {
- // More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
- layout: 'fullscreen',
- },
-} satisfies Meta;
-
-export default meta;
-type Story = StoryObj;
-
-export const LoggedOut: Story = {};
-
-// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
-export const LoggedIn: Story = {
- play: async ({ canvasElement }) => {
- const canvas = within(canvasElement);
- const loginButton = await canvas.getByRole('button', {
- name: /Log in/i,
- });
- await userEvent.click(loginButton);
- },
-};
diff --git a/src/stories/Page.tsx b/src/stories/Page.tsx
deleted file mode 100644
index e1174830..00000000
--- a/src/stories/Page.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import React from 'react';
-
-import { Header } from './Header';
-import './page.css';
-
-type User = {
- name: string;
-};
-
-export const Page: React.FC = () => {
- const [user, setUser] = React.useState();
-
- return (
-
- setUser({ name: 'Jane Doe' })}
- onLogout={() => setUser(undefined)}
- onCreateAccount={() => setUser({ name: 'Jane Doe' })}
- />
-
-
- Pages in Storybook
-
- We recommend building UIs with a{' '}
-
- component-driven
- {' '}
- process starting with atomic components and ending with pages.
-
-
- Render pages with mock data. This makes it easy to build and review page states without
- needing to navigate to them in your app. Here are some handy patterns for managing page
- data in Storybook:
-
-
-
- Use a higher-level connected component. Storybook helps you compose such data from the
- "args" of child component stories
-
-
- Assemble data in the page component from your services. You can mock these services out
- using Storybook.
-
-
-
- Get a guided tutorial on component-driven development at{' '}
-
- Storybook tutorials
-
- . Read more in the{' '}
-
- docs
-
- .
-
-
-
Tip Adjust the width of the canvas with the{' '}
-
-
-
-
-
- Viewports addon in the toolbar
-
-
-
- );
-};
diff --git a/src/stories/button.css b/src/stories/button.css
deleted file mode 100644
index dc91dc76..00000000
--- a/src/stories/button.css
+++ /dev/null
@@ -1,30 +0,0 @@
-.storybook-button {
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
- font-weight: 700;
- border: 0;
- border-radius: 3em;
- cursor: pointer;
- display: inline-block;
- line-height: 1;
-}
-.storybook-button--primary {
- color: white;
- background-color: #1ea7fd;
-}
-.storybook-button--secondary {
- color: #333;
- background-color: transparent;
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
-}
-.storybook-button--small {
- font-size: 12px;
- padding: 10px 16px;
-}
-.storybook-button--medium {
- font-size: 14px;
- padding: 11px 20px;
-}
-.storybook-button--large {
- font-size: 16px;
- padding: 12px 24px;
-}
diff --git a/src/stories/header.css b/src/stories/header.css
deleted file mode 100644
index d9a70528..00000000
--- a/src/stories/header.css
+++ /dev/null
@@ -1,32 +0,0 @@
-.storybook-header {
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- padding: 15px 20px;
- display: flex;
- align-items: center;
- justify-content: space-between;
-}
-
-.storybook-header svg {
- display: inline-block;
- vertical-align: top;
-}
-
-.storybook-header h1 {
- font-weight: 700;
- font-size: 20px;
- line-height: 1;
- margin: 6px 0 6px 10px;
- display: inline-block;
- vertical-align: top;
-}
-
-.storybook-header button + button {
- margin-left: 10px;
-}
-
-.storybook-header .welcome {
- color: #333;
- font-size: 14px;
- margin-right: 10px;
-}
diff --git a/src/stories/page.css b/src/stories/page.css
deleted file mode 100644
index 098dad11..00000000
--- a/src/stories/page.css
+++ /dev/null
@@ -1,69 +0,0 @@
-.storybook-page {
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 24px;
- padding: 48px 20px;
- margin: 0 auto;
- max-width: 600px;
- color: #333;
-}
-
-.storybook-page h2 {
- font-weight: 700;
- font-size: 32px;
- line-height: 1;
- margin: 0 0 4px;
- display: inline-block;
- vertical-align: top;
-}
-
-.storybook-page p {
- margin: 1em 0;
-}
-
-.storybook-page a {
- text-decoration: none;
- color: #1ea7fd;
-}
-
-.storybook-page ul {
- padding-left: 30px;
- margin: 1em 0;
-}
-
-.storybook-page li {
- margin-bottom: 8px;
-}
-
-.storybook-page .tip {
- display: inline-block;
- border-radius: 1em;
- font-size: 11px;
- line-height: 12px;
- font-weight: 700;
- background: #e7fdd8;
- color: #66bf3c;
- padding: 4px 12px;
- margin-right: 10px;
- vertical-align: top;
-}
-
-.storybook-page .tip-wrapper {
- font-size: 13px;
- line-height: 20px;
- margin-top: 40px;
- margin-bottom: 40px;
-}
-
-.storybook-page .tip-wrapper svg {
- display: inline-block;
- height: 12px;
- width: 12px;
- margin-right: 4px;
- vertical-align: top;
- margin-top: 3px;
-}
-
-.storybook-page .tip-wrapper svg path {
- fill: #1ea7fd;
-}
From 0162a10800ae547d97b0e99f3735a657eef9674a Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Thu, 10 Aug 2023 14:23:57 +0300
Subject: [PATCH 04/78] Style gauge in box
---
src/components/DeviceStorageHealth.tsx | 13 +++++++++----
src/components/StandardGauge.tsx | 26 ++++++++++++++------------
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/src/components/DeviceStorageHealth.tsx b/src/components/DeviceStorageHealth.tsx
index eaf2e62c..b8ace279 100644
--- a/src/components/DeviceStorageHealth.tsx
+++ b/src/components/DeviceStorageHealth.tsx
@@ -10,14 +10,14 @@ const DeviceStorageHealth = () => {
{
id: 'storage',
label: 'Storage',
- value: 450,
+ value: 55,
color: '#E95460',
},
{
id: 'storage',
label: 'Storage',
value: 45,
- color: '#E95460',
+ color: '#E7EAEE',
},
]
return (
@@ -27,11 +27,16 @@ const DeviceStorageHealth = () => {
justifyContent="space-between"
style={{
padding: '8px 16px',
- position: 'relative', // Make XStack a positioning context
+ position: 'relative',
}}
>
diff --git a/src/components/StandardGauge.tsx b/src/components/StandardGauge.tsx
index 6db42bb7..28b7c8bd 100644
--- a/src/components/StandardGauge.tsx
+++ b/src/components/StandardGauge.tsx
@@ -11,18 +11,20 @@ interface StandardGaugeProps {
}
const StandardGauge = ({ data }: StandardGaugeProps) => (
- datum.data.color}
- fit={false}
- activeOuterRadiusOffset={8}
- enableArcLinkLabels={false}
- arcLinkLabelsColor={{ from: 'color' }}
- enableArcLabels={false}
- legends={[]}
- />
+ //
+ datum.data.color}
+ fit={false}
+ activeOuterRadiusOffset={8}
+ enableArcLinkLabels={false}
+ arcLinkLabelsColor={{ from: 'color' }}
+ enableArcLabels={false}
+ legends={[]}
+ />
+ //
)
export default StandardGauge
From 428cc4847f02d97fb6e0d26d5387eadfcb7a37c5 Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Thu, 10 Aug 2023 15:10:30 +0300
Subject: [PATCH 05/78] tweaks
---
src/components/LandingPage.tsx | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index b27f7185..00563d14 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,10 +1,9 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
-import QuickStartBar from '../QuickStartBar/QuickStartBar'
-import DeviceCPULoad from '../DeviceCPULoad'
-import NodesLogo from '../NodesLogo'
-import DeviceStorageHealth from '../DeviceStorageHealth'
-
+import QuickStartBar from './QuickStartBar'
+import DeviceStorageHealth from './DeviceStorageHealth'
+import DeviceCPULoad from './DeviceCPULoad'
+
function LandingPage() {
return (
<>
@@ -98,8 +97,8 @@ function Content() {
Discover Nodes
-
-
+
+
)
}
From 7c2dcab83725c1dce2df7529127d0ccf0aae095f Mon Sep 17 00:00:00 2001
From: Rickard Andersson
Date: Thu, 10 Aug 2023 15:16:40 +0300
Subject: [PATCH 06/78] testing: add `StandardGauge` stories
---
src/components/StandardGauge.stories.tsx | 37 ++++++++++++++++++++++++
src/components/StandardGauge.tsx | 5 ++--
2 files changed, 40 insertions(+), 2 deletions(-)
create mode 100644 src/components/StandardGauge.stories.tsx
diff --git a/src/components/StandardGauge.stories.tsx b/src/components/StandardGauge.stories.tsx
new file mode 100644
index 00000000..fdeeeac6
--- /dev/null
+++ b/src/components/StandardGauge.stories.tsx
@@ -0,0 +1,37 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import StandardGauge from './StandardGauge'
+
+const meta = {
+ title: 'General/StandardGauge',
+ component: StandardGauge,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+ decorators: [
+ Story => (
+
+
+
+ ),
+ ],
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+export const WithDataPoints: Story = {
+ args: {
+ data: [
+ { id: '1', color: 'red', label: 'Red', value: 42 },
+ { id: '2', color: 'blue', label: 'Blue', value: 1337 },
+ ],
+ },
+}
+
+export const WithoutDataPoints: Story = {
+ args: {
+ data: [],
+ },
+}
diff --git a/src/components/StandardGauge.tsx b/src/components/StandardGauge.tsx
index 6db42bb7..5db9a1a6 100644
--- a/src/components/StandardGauge.tsx
+++ b/src/components/StandardGauge.tsx
@@ -1,13 +1,14 @@
import { ResponsivePie } from '@nivo/pie'
-interface Data {
+export interface GaugeDataPoint {
id: string
label: string
value: number
color: string
}
+
interface StandardGaugeProps {
- data: Data[]
+ data: GaugeDataPoint[]
}
const StandardGauge = ({ data }: StandardGaugeProps) => (
From dcb5f85403dcdfe5bc7b03d29034972ffcd58aec Mon Sep 17 00:00:00 2001
From: Rickard Andersson
Date: Thu, 10 Aug 2023 15:26:31 +0300
Subject: [PATCH 07/78] testing: add `HealthInfoSection` stories
---
src/components/HealthInfoSection.stories.tsx | 70 ++++++++++++++++++++
src/components/HealthInfoSection.tsx | 2 +-
2 files changed, 71 insertions(+), 1 deletion(-)
create mode 100644 src/components/HealthInfoSection.stories.tsx
diff --git a/src/components/HealthInfoSection.stories.tsx b/src/components/HealthInfoSection.stories.tsx
new file mode 100644
index 00000000..4036e0fb
--- /dev/null
+++ b/src/components/HealthInfoSection.stories.tsx
@@ -0,0 +1,70 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import HealthInfoSection from './HealthInfoSection'
+
+const meta = {
+ title: 'Device Health/HealthInfoSection',
+ component: HealthInfoSection,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+export const AllGoodStats: Story = {
+ args: {
+ usedStorage: 79 * 1024 * 1024 * 1024,
+ maxStorage: 100 * 1024 * 1024 * 1024,
+ usedRamMemory: 32 * 1024 * 1024 * 1024,
+ maxRamMemory: 64 * 1024 * 1024 * 1024,
+ cpuClockRate: 2.4,
+ networkLatency: 50,
+ },
+}
+
+export const StorageBad: Story = {
+ args: {
+ usedStorage: 80 * 1024 * 1024 * 1024,
+ maxStorage: 100 * 1024 * 1024 * 1024,
+ usedRamMemory: 32 * 1024 * 1024 * 1024,
+ maxRamMemory: 64 * 1024 * 1024 * 1024,
+ cpuClockRate: 2.5,
+ networkLatency: 50,
+ },
+}
+
+export const CpuBad: Story = {
+ args: {
+ usedStorage: 79 * 1024 * 1024 * 1024,
+ maxStorage: 100 * 1024 * 1024 * 1024,
+ usedRamMemory: 32 * 1024 * 1024 * 1024,
+ maxRamMemory: 64 * 1024 * 1024 * 1024,
+ cpuClockRate: 2.3,
+ networkLatency: 50,
+ },
+}
+
+export const RamBad: Story = {
+ args: {
+ usedStorage: 79 * 1024 * 1024 * 1024,
+ maxStorage: 100 * 1024 * 1024 * 1024,
+ usedRamMemory: 56 * 1024 * 1024 * 1024,
+ maxRamMemory: 64 * 1024 * 1024 * 1024,
+ cpuClockRate: 2.4,
+ networkLatency: 50,
+ },
+}
+
+export const LatencyBad: Story = {
+ args: {
+ usedStorage: 79 * 1024 * 1024 * 1024,
+ maxStorage: 100 * 1024 * 1024 * 1024,
+ usedRamMemory: 32 * 1024 * 1024 * 1024,
+ maxRamMemory: 64 * 1024 * 1024 * 1024,
+ cpuClockRate: 2.4,
+ networkLatency: 101,
+ },
+}
diff --git a/src/components/HealthInfoSection.tsx b/src/components/HealthInfoSection.tsx
index ebd88242..6144735e 100644
--- a/src/components/HealthInfoSection.tsx
+++ b/src/components/HealthInfoSection.tsx
@@ -26,7 +26,7 @@ const HealthInfoSection = (props: HealthInfoSectionProps) => {
const usedStoragePercentage = (usedStorage / maxStorage) * 100
const usedRamMemoryPercentage = (usedRamMemory / maxRamMemory) * 100
- const cpuClockRatePercentage = cpuClockRate > 2.4 ? 100 : 0
+ const cpuClockRatePercentage = cpuClockRate < 2.4 ? 100 : 0
const networkLatencyPercentage = networkLatency > 100 ? 100 : 0
return (
From c89e6e1c47c92186e68525c72efe257bcf8fe0f6 Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Thu, 10 Aug 2023 15:28:38 +0300
Subject: [PATCH 08/78] dynamically set left storage
---
src/components/DeviceStorageHealth.tsx | 45 +++++++++++++++-----------
src/components/LandingPage.tsx | 4 +--
src/components/StandardGauge.tsx | 26 +++++++--------
3 files changed, 40 insertions(+), 35 deletions(-)
diff --git a/src/components/DeviceStorageHealth.tsx b/src/components/DeviceStorageHealth.tsx
index b8ace279..e65c28d0 100644
--- a/src/components/DeviceStorageHealth.tsx
+++ b/src/components/DeviceStorageHealth.tsx
@@ -2,24 +2,31 @@ import ShadowBox from './ShadowBox'
import IconText from './IconText'
import { Paragraph, Separator, XStack, YStack } from 'tamagui'
import StandardGauge from './StandardGauge'
+interface DeviceStorageHealthProps {
+ storage: number
+ maxStorage: number
+}
+const DeviceStorageHealth: React.FC = ({ storage, maxStorage }) => {
+ const message = storage < maxStorage ? 'Good' : 'Poor'
+ const data = (storage: number, maxStorage: number) => {
+ const used = storage
+ const free = maxStorage - storage
-const DeviceStorageHealth = () => {
- const currentLoad = 60
- const message = currentLoad < 80 ? 'Good' : 'Poor'
- const data = [
- {
- id: 'storage',
- label: 'Storage',
- value: 55,
- color: '#E95460',
- },
- {
- id: 'storage',
- label: 'Storage',
- value: 45,
- color: '#E7EAEE',
- },
- ]
+ return [
+ {
+ id: 'storage',
+ label: 'Used',
+ value: used,
+ color: '#E95460',
+ },
+ {
+ id: 'storage',
+ label: 'Free',
+ value: free,
+ color: '#E7EAEE',
+ },
+ ]
+ }
return (
@@ -38,14 +45,14 @@ const DeviceStorageHealth = () => {
height: '75px',
}}
>
-
+
Storage
- {currentLoad} GB
+ {storage} GB
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index 00563d14..426af7cd 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -3,7 +3,7 @@ import './LandingPage.css'
import QuickStartBar from './QuickStartBar'
import DeviceStorageHealth from './DeviceStorageHealth'
import DeviceCPULoad from './DeviceCPULoad'
-
+
function LandingPage() {
return (
<>
@@ -97,7 +97,7 @@ function Content() {
Discover Nodes
-
+
)
diff --git a/src/components/StandardGauge.tsx b/src/components/StandardGauge.tsx
index 28b7c8bd..813122fb 100644
--- a/src/components/StandardGauge.tsx
+++ b/src/components/StandardGauge.tsx
@@ -11,20 +11,18 @@ interface StandardGaugeProps {
}
const StandardGauge = ({ data }: StandardGaugeProps) => (
- //
- datum.data.color}
- fit={false}
- activeOuterRadiusOffset={8}
- enableArcLinkLabels={false}
- arcLinkLabelsColor={{ from: 'color' }}
- enableArcLabels={false}
- legends={[]}
- />
- //
+ datum.data.color}
+ fit={false}
+ activeOuterRadiusOffset={8}
+ enableArcLinkLabels={false}
+ arcLinkLabelsColor={{ from: 'color' }}
+ enableArcLabels={false}
+ legends={[]}
+ />
)
export default StandardGauge
From 96210c147788f4ac37c95d6095135023f644d64d Mon Sep 17 00:00:00 2001
From: Rickard Andersson
Date: Thu, 10 Aug 2023 15:28:39 +0300
Subject: [PATCH 09/78] testing: add `QuickStartBar` stories
---
src/components/QuickStartBar.stories.tsx | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 src/components/QuickStartBar.stories.tsx
diff --git a/src/components/QuickStartBar.stories.tsx b/src/components/QuickStartBar.stories.tsx
new file mode 100644
index 00000000..a82cea89
--- /dev/null
+++ b/src/components/QuickStartBar.stories.tsx
@@ -0,0 +1,19 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import QuickStartBar from './QuickStartBar'
+
+const meta = {
+ title: 'General/QuickStartBar',
+ component: QuickStartBar,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+export const Default: Story = {
+ args: {},
+}
From 23de7820c7b78b31547b6141a7d51819b06a2825 Mon Sep 17 00:00:00 2001
From: RadoslavDimchev
Date: Fri, 11 Aug 2023 09:50:47 +0300
Subject: [PATCH 10/78] fix: delete custom buttons
---
src/components/IconButton.tsx | 21 ---------------------
src/components/ReactButton.tsx | 16 ----------------
src/components/Titles.tsx | 5 ++---
3 files changed, 2 insertions(+), 40 deletions(-)
delete mode 100644 src/components/IconButton.tsx
delete mode 100644 src/components/ReactButton.tsx
diff --git a/src/components/IconButton.tsx b/src/components/IconButton.tsx
deleted file mode 100644
index 84f14be5..00000000
--- a/src/components/IconButton.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import Icon from './Icon'
-import ReactButton from './ReactButton'
-
-type IconButtonProps = {
- children: string
- icon: string
- style?: unknown
- size?: string
- fontSize?: string
- onClick?: () => void
-}
-
-const IconButton = ({ icon, children, ...props }: IconButtonProps) => {
- return (
- }>
- {children}
-
- )
-}
-
-export default IconButton
diff --git a/src/components/ReactButton.tsx b/src/components/ReactButton.tsx
deleted file mode 100644
index e1fd1fec..00000000
--- a/src/components/ReactButton.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Button } from 'tamagui'
-import { ReactNode } from 'react'
-
-type ReactButtonProps = {
- children: string
- style?: unknown
- icon?: ReactNode
- size?: string
- onClick?: () => void
-}
-
-const ReactButton = ({ children, ...props }: ReactButtonProps) => {
- return {children}
-}
-
-export default ReactButton
diff --git a/src/components/Titles.tsx b/src/components/Titles.tsx
index 93f872c2..5c8a363a 100644
--- a/src/components/Titles.tsx
+++ b/src/components/Titles.tsx
@@ -1,7 +1,6 @@
import { XStack, YStack } from 'tamagui'
import Title from './Title'
import SubTitle from './SubTitle'
-import IconButton from './IconButton'
type TitlesProps = {
title: string
@@ -13,7 +12,7 @@ const Titles = ({ title, subtitle }: TitlesProps) => {
{title}
- {
fontSize={'$5'}
>
Advanced Settings
-
+ */}
{subtitle}
From 1c8a5f2cadd7305f7da68192acf08f752e842215 Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Fri, 11 Aug 2023 09:52:23 +0300
Subject: [PATCH 11/78] Remove animation
---
src/components/LandingPage.tsx | 2 --
src/components/StandardGauge.tsx | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index 426af7cd..c7183dc4 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -97,8 +97,6 @@ function Content() {
Discover Nodes
-
-
)
}
diff --git a/src/components/StandardGauge.tsx b/src/components/StandardGauge.tsx
index 813122fb..ccaaae6c 100644
--- a/src/components/StandardGauge.tsx
+++ b/src/components/StandardGauge.tsx
@@ -22,6 +22,8 @@ const StandardGauge = ({ data }: StandardGaugeProps) => (
arcLinkLabelsColor={{ from: 'color' }}
enableArcLabels={false}
legends={[]}
+ motionConfig="gentle" // Define transition style
+ animate={false} // Enable animation
/>
)
From f204cb0acefd16181a1c50712ef598dc4cb57208 Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Fri, 11 Aug 2023 09:55:02 +0300
Subject: [PATCH 12/78] Update LandingPage.tsx
---
src/components/LandingPage.tsx | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index c7183dc4..d6bc3dc6 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,8 +1,6 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
import QuickStartBar from './QuickStartBar'
-import DeviceStorageHealth from './DeviceStorageHealth'
-import DeviceCPULoad from './DeviceCPULoad'
function LandingPage() {
return (
From 9d7cd4c2c55f01f7a27e45fd455e98bef9d15a9d Mon Sep 17 00:00:00 2001
From: RadoslavDimchev
Date: Fri, 11 Aug 2023 09:59:45 +0300
Subject: [PATCH 13/78] fix: delete information box
---
src/components/InformationBox.tsx | 29 -----------------------------
1 file changed, 29 deletions(-)
delete mode 100644 src/components/InformationBox.tsx
diff --git a/src/components/InformationBox.tsx b/src/components/InformationBox.tsx
deleted file mode 100644
index 36016d53..00000000
--- a/src/components/InformationBox.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { XStack } from 'tamagui'
-
-import Icon from './Icon'
-import FormattedText, { TextElement } from './FormattedText'
-
-type InformationBoxProps = {
- icon: string
- textElements: TextElement[]
-}
-
-const InformationBox = ({ icon, textElements }: InformationBoxProps) => {
- return (
-
-
-
-
- )
-}
-
-export default InformationBox
From 04b29d9e841f4ab8e3cd57080f24bbab3a44b19d Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Fri, 11 Aug 2023 10:13:05 +0300
Subject: [PATCH 14/78] Implement memory health card
---
src/components/DeviceMemoryHealth.tsx | 70 +++++++++++++++++++++++++++
src/components/LandingPage.tsx | 2 +
2 files changed, 72 insertions(+)
create mode 100644 src/components/DeviceMemoryHealth.tsx
diff --git a/src/components/DeviceMemoryHealth.tsx b/src/components/DeviceMemoryHealth.tsx
new file mode 100644
index 00000000..b5857e22
--- /dev/null
+++ b/src/components/DeviceMemoryHealth.tsx
@@ -0,0 +1,70 @@
+import StandartLineChart from './StandardLineChart'
+import ShadowBox from './ShadowBox'
+import IconText from './IconText'
+import { Paragraph, Separator, XStack, YStack } from 'tamagui'
+
+type DataPoint = {
+ x: number
+ y: number
+}
+
+type ChartData = {
+ id: string
+ color: string
+ data: DataPoint[]
+}
+
+type DeviceMemoryProps = {
+ load: number[]
+}
+const DeviceMemory: React.FC = ({ load }) => {
+ const chartData: ChartData[] = [
+ {
+ id: 'cpu',
+ color: '#8DC6BC',
+ data: load.map((yValue, index: number) => ({
+ x: index + 1,
+ y: yValue,
+ })),
+ },
+ ]
+ const currentLoad =
+ chartData[0].data.length > 0 ? chartData[0].data[chartData[0].data.length - 1].y : 0
+
+ const message = currentLoad < 80 ? 'Good' : 'Poor'
+
+ return (
+
+
+
+
+
+
+
+
+ Memory
+
+
+ {currentLoad} GB
+
+
+
+
+
+
+ {message}
+
+ {/* This is additional text */}
+
+
+
+ )
+}
+
+export default DeviceMemory
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index d6bc3dc6..25286f31 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,6 +1,7 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
import QuickStartBar from './QuickStartBar'
+import DeviceMemory from './DeviceMemoryHealth'
function LandingPage() {
return (
@@ -95,6 +96,7 @@ function Content() {
Discover Nodes
+
)
}
From e9b4946c73642803c94fbfce2ed768c8ca02791b Mon Sep 17 00:00:00 2001
From: RadoslavDimchev
Date: Fri, 11 Aug 2023 10:17:27 +0300
Subject: [PATCH 15/78] fix: update formatted text to work with status
---
src/components/FormattedText.tsx | 30 +++++++++++-------------------
1 file changed, 11 insertions(+), 19 deletions(-)
diff --git a/src/components/FormattedText.tsx b/src/components/FormattedText.tsx
index a0d02652..671e0e0d 100644
--- a/src/components/FormattedText.tsx
+++ b/src/components/FormattedText.tsx
@@ -1,35 +1,27 @@
-import { Text } from 'tamagui'
+import { Text } from '@status-im/components'
export type TextElement = {
text: string
bold?: boolean
italic?: boolean
+ weight?: 'regular' | 'medium' | 'bold'
}
type FormattedTextProps = {
textElements: TextElement[]
color?: string
- fontSize?: string
+ size: 27 | 19 | 15 | 13 | 11
}
-const FormattedText = ({ textElements, color, fontSize }: FormattedTextProps) => {
- const calculateStyle = (textElement: TextElement) => {
- const isBold = textElement.bold ?? false
- const isItalic = textElement.italic ?? false
-
- return { fontWeight: isBold ? 'bold' : '', fontStyle: isItalic ? 'italic' : '' }
- }
-
+const FormattedText = ({ textElements, color, size }: FormattedTextProps) => {
return (
-
- {textElements.map((textElement, index) => {
- return (
-
- {textElement.text}
-
- )
- })}
-
+ <>
+ {textElements.map((textElement, index) => (
+
+ {textElement.text}
+
+ ))}
+ >
)
}
From 6927177c3951a05f0bd25784f2ad45665f348638 Mon Sep 17 00:00:00 2001
From: Hristo Nedelkov
Date: Fri, 11 Aug 2023 10:18:07 +0300
Subject: [PATCH 16/78] Implement card without chart
---
src/components/DeviceNetworkHealth.tsx | 70 ++++++++++++++++++++++++++
src/components/LandingPage.tsx | 2 +
2 files changed, 72 insertions(+)
create mode 100644 src/components/DeviceNetworkHealth.tsx
diff --git a/src/components/DeviceNetworkHealth.tsx b/src/components/DeviceNetworkHealth.tsx
new file mode 100644
index 00000000..1c99bfd8
--- /dev/null
+++ b/src/components/DeviceNetworkHealth.tsx
@@ -0,0 +1,70 @@
+import StandartLineChart from './StandardLineChart'
+import ShadowBox from './ShadowBox'
+import IconText from './IconText'
+import { Paragraph, Separator, XStack, YStack } from 'tamagui'
+
+type DataPoint = {
+ x: number
+ y: number
+}
+
+type ChartData = {
+ id: string
+ color: string
+ data: DataPoint[]
+}
+
+type DeviceNetworkHealthProps = {
+ load: number[]
+}
+const DeviceNetworkHealth: React.FC = ({ load }) => {
+ const chartData: ChartData[] = [
+ {
+ id: 'cpu',
+ color: '#8DC6BC',
+ data: load.map((yValue, index: number) => ({
+ x: index + 1,
+ y: yValue,
+ })),
+ },
+ ]
+ const currentLoad =
+ chartData[0].data.length > 0 ? chartData[0].data[chartData[0].data.length - 1].y : 0
+
+ const message = currentLoad < 80 ? 'Good' : 'Poor'
+
+ return (
+
+
+
+
+
+
+
+
+ Network
+
+
+ {currentLoad} GB
+
+
+
+
+
+
+ {message}
+
+ {/* This is additional text */}
+
+
+
+ )
+}
+
+export default DeviceNetworkHealth
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index d6bc3dc6..178f721a 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,6 +1,7 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
import QuickStartBar from './QuickStartBar'
+import DeviceNetworkHealth from './DeviceNetworkHealth'
function LandingPage() {
return (
@@ -95,6 +96,7 @@ function Content() {
Discover Nodes
+
)
}
From e091c591f6fbe1472a5eec794a2f067a3514164c Mon Sep 17 00:00:00 2001
From: RadoslavDimchev
Date: Fri, 11 Aug 2023 10:34:21 +0300
Subject: [PATCH 17/78] fix: make icon work with status image
---
src/components/Icon.tsx | 9 ++++-----
src/components/IconText.tsx | 2 +-
src/components/LandingPage.tsx | 2 ++
src/components/NimbusLogo.tsx | 2 +-
src/components/NodesLogo.tsx | 2 +-
5 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx
index c65a6302..d4269152 100644
--- a/src/components/Icon.tsx
+++ b/src/components/Icon.tsx
@@ -1,14 +1,13 @@
-import { Image } from 'tamagui'
+import { Image } from '@status-im/components'
export type IconProps = {
- source: string
+ src: string
width?: number
height?: number
- className?: string
}
-const Icon = ({ source, width = 16, height = 16, ...props }: IconProps) => {
- return
+const Icon = ({ src, width = 16, height = 16 }: IconProps) => {
+ return
}
export default Icon
diff --git a/src/components/IconText.tsx b/src/components/IconText.tsx
index 1fa15f68..c721f9c0 100644
--- a/src/components/IconText.tsx
+++ b/src/components/IconText.tsx
@@ -14,7 +14,7 @@ const IconText = ({ icon, children, ...props }: IconTextProps) => {
}}
space={'$2'}
>
-
+
{children}
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index d6bc3dc6..aab94217 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,6 +1,7 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
import QuickStartBar from './QuickStartBar'
+import NodesLogo from './NodesLogo'
function LandingPage() {
return (
@@ -23,6 +24,7 @@ function Content() {
nodesBETA
+
diff --git a/src/components/NimbusLogo.tsx b/src/components/NimbusLogo.tsx
index 7efa5558..11bb10ee 100644
--- a/src/components/NimbusLogo.tsx
+++ b/src/components/NimbusLogo.tsx
@@ -11,7 +11,7 @@ const NimbusLogo = () => {
}}
space={'$2'}
>
-
+
Nimbus
diff --git a/src/components/NodesLogo.tsx b/src/components/NodesLogo.tsx
index d5fd10e4..f4f1d07e 100644
--- a/src/components/NodesLogo.tsx
+++ b/src/components/NodesLogo.tsx
@@ -11,7 +11,7 @@ const NodesLogo = () => {
}}
space={'$2'}
>
-
+
nodes
From 4e5a29c5d47e26e6e9ab792a2abed310a6394a8a Mon Sep 17 00:00:00 2001
From: RadoslavDimchev
Date: Fri, 11 Aug 2023 10:39:34 +0300
Subject: [PATCH 18/78] fix: icon text work with status text
---
src/components/FormattedText.tsx | 2 +-
src/components/IconText.tsx | 9 +++++----
src/components/LandingPage.tsx | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/components/FormattedText.tsx b/src/components/FormattedText.tsx
index 671e0e0d..415aaf01 100644
--- a/src/components/FormattedText.tsx
+++ b/src/components/FormattedText.tsx
@@ -4,7 +4,7 @@ export type TextElement = {
text: string
bold?: boolean
italic?: boolean
- weight?: 'regular' | 'medium' | 'bold'
+ weight?: 'regular' | 'medium' | 'semibold'
}
type FormattedTextProps = {
diff --git a/src/components/IconText.tsx b/src/components/IconText.tsx
index c721f9c0..5e43db2f 100644
--- a/src/components/IconText.tsx
+++ b/src/components/IconText.tsx
@@ -1,12 +1,13 @@
-import { Paragraph, XStack } from 'tamagui'
+import { XStack } from 'tamagui'
import Icon from './Icon'
+import { Text } from '@status-im/components'
type IconTextProps = {
icon: string
children: string
}
-const IconText = ({ icon, children, ...props }: IconTextProps) => {
+const IconText = ({ icon, children }: IconTextProps) => {
return (
{
space={'$2'}
>
-
+
{children}
-
+
)
}
diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx
index aab94217..f529ca29 100644
--- a/src/components/LandingPage.tsx
+++ b/src/components/LandingPage.tsx
@@ -1,7 +1,7 @@
import LayoutComponent from './LayoutComponent'
import './LandingPage.css'
import QuickStartBar from './QuickStartBar'
-import NodesLogo from './NodesLogo'
+import IconText from './IconText'
function LandingPage() {
return (
@@ -15,6 +15,7 @@ function LandingPage() {
function Content() {
return (