Skip to content

Commit

Permalink
Merge pull request #15 from Nuklai/piotr-add-biome
Browse files Browse the repository at this point in the history
Add biome
  • Loading branch information
piotrpietruszka authored Jul 5, 2024
2 parents 2bbb27c + f5983e0 commit 2576ef3
Show file tree
Hide file tree
Showing 18 changed files with 1,873 additions and 1,738 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"cSpell.words": ["Nuklai"]
"cSpell.words": ["Nuklai", "wailsjs"],
"editor.defaultFormatter": "biomejs.biome"
}
30 changes: 30 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"ignore": [],
"attributePosition": "auto",
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf"
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"files": {
"ignore": ["wailsjs", "build", "dist"]
}
}
58 changes: 30 additions & 28 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
{
"name": "nuklai-wallet-frontend",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@ant-design/icons": "^5.2.5",
"@ant-design/plots": "^1.2.5",
"antd": "^5.8.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.15.0"
},
"devDependencies": {
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"path": "^0.12.7",
"typescript": "^5.5.3",
"url": "^0.11.1",
"vite": "^5.3.3"
},
"packageManager": "yarn@4.3.1"
"name": "nuklai-wallet-frontend",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"check": "biome check ./"
},
"dependencies": {
"@ant-design/icons": "^5.2.5",
"@ant-design/plots": "^1.2.5",
"antd": "^5.8.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.15.0"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"path": "^0.12.7",
"typescript": "^5.5.3",
"url": "^0.11.1",
"vite": "^5.3.3"
},
"packageManager": "yarn@4.3.1"
}
2 changes: 1 addition & 1 deletion frontend/package.json.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
65321fcf80cf31c52b644cf6ab6757d6
56fb010925dec06f4b587d097770583a
109 changes: 55 additions & 54 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,66 @@
// Copyright (C) 2024, Nuklai. All rights reserved.
// See the file LICENSE for licensing terms.

import { App as AApp, FloatButton, Layout, Row, Typography } from "antd";
import { useEffect, useState } from "react";
import { Outlet } from "react-router-dom";
import { GetCommitHash, OpenLink } from "../wailsjs/go/main/App";
import logo from "./assets/images/nuklai-footer.png";
import NavBar from "./components/NavBar";
import { App as AApp, FloatButton, Layout, Row, Typography } from 'antd';
import { useEffect, useState } from 'react';
import { Outlet } from 'react-router-dom';
import { GetCommitHash, OpenLink } from '../wailsjs/go/main/App';
import logo from './assets/images/nuklai-footer.png';
import NavBar from './components/NavBar';

const { Text } = Typography;
const { Content } = Layout;

const App = () => {
const [commit, setCommit] = useState("");
useEffect(() => {
const getCommit = async () => {
const c = await GetCommitHash();
setCommit(c);
};
getCommit();
}, []);
return (
<AApp>
<Layout
style={{
minHeight: "95vh",
}}
>
<NavBar />
<Layout className="site-layout">
<Content
style={{
background: "white",
padding: "0 50px",
}}
>
<div
style={{
padding: 24,
}}
>
<Outlet />
<FloatButton.BackTop />
</div>
</Content>
</Layout>
<Row justify="center" style={{ background: "white" }}>
<a
onClick={() => {
OpenLink("https://github.com/ava-labs/hypersdk");
}}
>
<img src={logo} style={{ width: "300px" }} alt="footer" />
</a>
</Row>
<Row justify="center" style={{ background: "white" }}>
<Text type="secondary">Commit: {commit}</Text>
</Row>
</Layout>
</AApp>
);
const [commit, setCommit] = useState('');
useEffect(() => {
const getCommit = async () => {
const c = await GetCommitHash();
setCommit(c);
};
getCommit();
}, []);
return (
<AApp>
<Layout
style={{
minHeight: '95vh',
}}
>
<NavBar />
<Layout className="site-layout">
<Content
style={{
background: 'white',
padding: '0 50px',
}}
>
<div
style={{
padding: 24,
}}
>
<Outlet />
<FloatButton.BackTop />
</div>
</Content>
</Layout>
<Row justify="center" style={{ background: 'white' }}>
<a
// biome-ignore lint/a11y/useValidAnchor: TODO
onClick={() => {
OpenLink('https://github.com/ava-labs/hypersdk');
}}
>
<img src={logo} style={{ width: '300px' }} alt="footer" />
</a>
</Row>
<Row justify="center" style={{ background: 'white' }}>
<Text type="secondary">Commit: {commit}</Text>
</Row>
</Layout>
</AApp>
);
};

export default App;
Loading

0 comments on commit 2576ef3

Please sign in to comment.