Skip to content

Commit

Permalink
prettier web-app
Browse files Browse the repository at this point in the history
  • Loading branch information
minaxolone committed Jul 14, 2024
1 parent 586d393 commit 850c325
Show file tree
Hide file tree
Showing 103 changed files with 601 additions and 763 deletions.
7 changes: 2 additions & 5 deletions web-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
}
};
8 changes: 0 additions & 8 deletions web-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,22 @@

### Added


### Changed


### Removed


## [0.0.1] - 2024-04-13

### Added


### Changed


### Removed


## [0.0.1] - 2024-04-12

### Added


### Changed


### Removed
16 changes: 8 additions & 8 deletions web-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="UTF-8" />

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />

<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand All @@ -26,4 +26,4 @@
<div id="root" class="h-full"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
</html>
16 changes: 16 additions & 0 deletions web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"postcss": "^8.4.38",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.4",
"typescript": "^5.4.5",
"vite": "^5.3.1"
Expand Down
2 changes: 1 addition & 1 deletion web-app/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default {
tailwindcss: {},
autoprefixer: {},
},
}
};
34 changes: 17 additions & 17 deletions web-app/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
4 changes: 2 additions & 2 deletions web-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import App from './modules/core/App';

import './index.css';

const VITE_POSTHOG_KEY = "phc_hPZOabiIQet1rsxRGAELYmKy8eByxgklujcj3rTz4cd";
const VITE_POSTHOG_HOST = "https://eu.posthog.com";
const VITE_POSTHOG_KEY = 'phc_hPZOabiIQet1rsxRGAELYmKy8eByxgklujcj3rTz4cd';
const VITE_POSTHOG_HOST = 'https://eu.posthog.com';

const PostHogProviderWrapper = ({ children }: PropsWithChildren) => {
if (window.location.host === '0l.fyi') {
Expand Down
14 changes: 5 additions & 9 deletions web-app/src/modules/aptos/Provider.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { FC, PropsWithChildren, useMemo } from "react";
import { AptosClient } from "aptos";
import aptosContext from "./context";
import { FC, PropsWithChildren, useMemo } from 'react';
import { AptosClient } from 'aptos';
import aptosContext from './context';

const AptosProvider: FC<PropsWithChildren> = ({ children }) => {
const client = useMemo(() => {
return new AptosClient("https://rpc.0l.fyi");
return new AptosClient('https://rpc.0l.fyi');
}, []);

return (
<aptosContext.Provider value={client}>
{children}
</aptosContext.Provider>
);
return <aptosContext.Provider value={client}>{children}</aptosContext.Provider>;
};

export default AptosProvider;
4 changes: 2 additions & 2 deletions web-app/src/modules/aptos/context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext } from "react";
import { AptosClient } from "aptos";
import { createContext } from 'react';
import { AptosClient } from 'aptos';

const aptoContext = createContext<AptosClient>(null as never);

Expand Down
6 changes: 3 additions & 3 deletions web-app/src/modules/aptos/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext } from "react";
import aptoContext from "./context";
export { default as AptosProvider } from "./Provider";
import { useContext } from 'react';
import aptoContext from './context';
export { default as AptosProvider } from './Provider';

const useAptos = () => useContext(aptoContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ const AccountDoesntExist: FC<Props> = ({ address }) => {
This may be because the account was recently created and our system is still updating.
<br />
<br />
<span className='text-sm font-medium text-red-800 text-xl'>
Please avoid sending tokens to this address, as there's a possibility of funds being lost.
<span className="text-sm font-medium text-red-800 text-xl">
Please avoid sending tokens to this address, as there's a possibility of funds being
lost.
</span>
</p>
</div>
Expand Down
29 changes: 13 additions & 16 deletions web-app/src/modules/core/routes/Account/HistoricalBalance.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FC, useEffect, useState } from "react";
import clsx from "clsx";
import axios from "axios";
import ReactECharts from "echarts-for-react";
import { FC, useEffect, useState } from 'react';
import clsx from 'clsx';
import axios from 'axios';
import ReactECharts from 'echarts-for-react';

import { config } from "../../../../config";
import { config } from '../../../../config';

interface Props {
address: string;
Expand All @@ -15,10 +15,10 @@ const HistoricalBalance: FC<Props> = ({ address }) => {
useEffect(() => {
const load = async () => {
const res = await axios<{
timestamp: number[],
balance: number[],
unlocked: number[],
locked: number[],
timestamp: number[];
balance: number[];
unlocked: number[];
locked: number[];
}>({
url: `${config.dataApiHost}/historical-balance/${address}`,
});
Expand Down Expand Up @@ -108,15 +108,12 @@ const HistoricalBalance: FC<Props> = ({ address }) => {
{options && (
<div
className={clsx(
"w-full rounded-md shadow overflow-hidden h-[500px]",
"ring-1 ring-black ring-opacity-5",
"bg-white"
'w-full rounded-md shadow overflow-hidden h-[500px]',
'ring-1 ring-black ring-opacity-5',
'bg-white',
)}
>
<ReactECharts
option={options}
style={{ height: "100%", width: "100%" }}
/>
<ReactECharts option={options} style={{ height: '100%', width: '100%' }} />
</div>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useState } from "react";
import { Types, BCS } from "aptos";
import clsx from "clsx";
import { useWallet } from "@aptos-labs/wallet-adapter-react";
import { FC, useState } from 'react';
import { Types, BCS } from 'aptos';
import clsx from 'clsx';
import { useWallet } from '@aptos-labs/wallet-adapter-react';

interface Props {
module: Types.MoveModuleBytecode;
Expand All @@ -14,7 +14,7 @@ const ExecFunction: FC<Props> = ({ module: mod, func }) => {
const [args, setArgs] = useState<string[]>([]);
const [genericParams, setGenericParams] = useState<string[]>([]);

const params = func.params.filter((param) => !["signer", "&signer"].includes(param));
const params = func.params.filter((param) => !['signer', '&signer'].includes(param));

const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
Expand All @@ -36,7 +36,6 @@ const ExecFunction: FC<Props> = ({ module: mod, func }) => {
});
};


return (
<form onSubmit={onSubmit}>
{func.generic_type_params.length > 0 && (
Expand All @@ -47,16 +46,14 @@ const ExecFunction: FC<Props> = ({ module: mod, func }) => {
{func.generic_type_params.map((_, index) => (
<div key={index} className="py-3">
<label>
<div className="block text-sm text-gray-900">
{`Generic param #${index + 1}`}
</div>
<div className="block text-sm text-gray-900">{`Generic param #${index + 1}`}</div>
<input
type="text"
className={clsx(
"px-2",
"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm",
"ring-1 ring-inset ring-gray-300 placeholder:text-gray-400",
"focus:ring-2 focus:ring-inset focus:ring-indigo-600"
'px-2',
'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm',
'ring-1 ring-inset ring-gray-300 placeholder:text-gray-400',
'focus:ring-2 focus:ring-inset focus:ring-indigo-600',
)}
value={genericParams[index]}
onChange={(event) => {
Expand All @@ -83,16 +80,14 @@ const ExecFunction: FC<Props> = ({ module: mod, func }) => {
return (
<div key={index} className="py-3">
<label>
<div className="block text-sm font-medium leading-6 text-gray-900">
{param}
</div>
<div className="block text-sm font-medium leading-6 text-gray-900">{param}</div>
<input
type="text"
className={clsx(
"px-2",
"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm",
"ring-1 ring-inset ring-gray-300 placeholder:text-gray-400",
"focus:ring-2 focus:ring-inset focus:ring-indigo-600"
'px-2',
'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm',
'ring-1 ring-inset ring-gray-300 placeholder:text-gray-400',
'focus:ring-2 focus:ring-inset focus:ring-indigo-600',
)}
value={args[index]}
onChange={(event) => {
Expand All @@ -114,13 +109,13 @@ const ExecFunction: FC<Props> = ({ module: mod, func }) => {
<button
type="submit"
className={clsx(
"rounded bg-primary-600",
"px-2 py-1",
"text-sm font-semibold text-white",
"shadow-sm",
"hover:bg-primary-500",
"focus-visible:outline focus-visible:outline-2",
"focus-visible:outline-offset-2 focus-visible:outline-primary-600"
'rounded bg-primary-600',
'px-2 py-1',
'text-sm font-semibold text-white',
'shadow-sm',
'hover:bg-primary-500',
'focus-visible:outline focus-visible:outline-2',
'focus-visible:outline-offset-2 focus-visible:outline-primary-600',
)}
>
Exec
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from "./ExecFunction";
export { default } from './ExecFunction';
Loading

0 comments on commit 850c325

Please sign in to comment.