Skip to content

Commit

Permalink
feat(app): ui improvements (#1330)
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly authored Oct 10, 2024
1 parent 86f48b6 commit a3faff4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/TableTxsInfinite/TableTxsInfinite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function TableTxsInfinite({
const { data, loading, error } = response;

return (
<Display noPaddingX>
<Display noPadding>
<InfiniteScroll
dataLength={(data?.messages_by_address || []).length}
next={fetchMoreData}
Expand Down
1 change: 1 addition & 0 deletions src/components/TableTxsInfinite/component/TableDataTxs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function TableDataTxs({ data, loading, accountUser }: Props) {
columns={Object.values(ColumnsTable).map((item) => ({
header: item,
accessorKey: item,
enableSorting: ![ColumnsTable.action, ColumnsTable.tx].includes(item),
cell: (info) => info.getValue(),
}))}
/>
Expand Down
22 changes: 8 additions & 14 deletions src/containers/application/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useEffect, useMemo } from 'react';
import { useEffect } from 'react';
import { Link, Outlet, matchPath, useLocation } from 'react-router-dom';

import { initPocket } from 'src/redux/features/pocket';
import MainLayout from 'src/layouts/Main';

import { getPassport } from 'src/features/passport/passports.redux';
import { useQueryClient } from 'src/contexts/queryClient';
import { useAdviser } from 'src/features/adviser/context';
import { routes } from 'src/routes';
import { AdviserColors } from 'src/features/adviser/Adviser/Adviser';
Expand All @@ -14,7 +13,6 @@ import { useBackend } from 'src/contexts/backend/backend';
import { useAppDispatch } from 'src/redux/hooks';
import useSenseManager from 'src/features/sense/ui/useSenseManager';

// eslint-disable-next-line unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars
import { initCyblog } from 'src/utils/logging/bootstrap';

import { setTimeHistoryRoute } from 'src/features/TimeHistory/redux/TimeHistory.redux';
Expand All @@ -33,7 +31,6 @@ initCyblog();

function App() {
const dispatch = useAppDispatch();
const queryClient = useQueryClient();
const address = useCurrentAddress();

// const { community, communityLoaded } = useGetCommunity(address || null, {
Expand All @@ -51,17 +48,16 @@ function App() {
}, []);

useEffect(() => {
if (!address || !queryClient) {
if (!address) {
return;
}

dispatch(
getPassport({
address,
queryClient,
})
);
}, [address, queryClient, dispatch]);
}, [address, dispatch]);

// reset
// useEffect(() => {
Expand All @@ -70,6 +66,10 @@ function App() {
// }
// }, [communityLoaded, community, dispatch]);

useAdviserTexts({
defaultText: 'indexer is in sync now, some data may be not fully available',
});

useEffect(() => {
// tabs
if (
Expand Down Expand Up @@ -135,13 +135,7 @@ function App() {
<div id={PORTAL_ID} className={styles.portal} />
)}

{![
/* routes.home.path, */
/* routes.teleport.path, */
// cybernetRoutes.verse.path,
].some((path) => {
return matchPath(path, location.pathname);
}) && <AdviserContainer />}
<AdviserContainer />

<Outlet />
</>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/teleport/Layout/Layout.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$mobile-breakpoint: 480px;

.header {
margin: 10px auto 30px;
margin: 20px auto 30px;
width: 420px;

@media (width <=$mobile-breakpoint) {
width: unset;

>div {
> div {
width: 100vw;
}
}
}
}
5 changes: 5 additions & 0 deletions src/pages/teleport/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import { Outlet } from 'react-router-dom';
import styles from './Layout.module.scss';
import TabListTeleport from '../components/tabList/TabList';
import { Stars } from 'src/containers/portal/components';
import useAdviserTexts from 'src/features/adviser/useAdviserTexts';

function Layout() {
useAdviserTexts({
defaultText: 'welcome to teleport',
});

return (
<div>
<Stars />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Props = {
validAmountMessage?: boolean;
validAmountMessageText?: string;
autoFocus?: boolean;
availableAmount?: number;
onValueChange: $TsFixMeFunc;
};

Expand All @@ -26,6 +27,7 @@ function InputNumberDecimalScale({
onValueChange,
title,
validAmountMessage,
availableAmount,
validAmountMessageText,
...props
}: Props) {
Expand Down Expand Up @@ -55,8 +57,9 @@ function InputNumberDecimalScale({

return (
<InputNumber
maxValue={availableAmount}
value={value}
onValueChange={onValueChange}
onChange={onValueChange}
title={title}
color={validAmount || value.length === 0 ? Color.Red : Color.Green}
fixedDecimalScale={fixed}
Expand Down
1 change: 1 addition & 0 deletions src/pages/teleport/send/send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ function Send() {
<Col>
<InputNumberDecimalScale
value={tokenAmount}
availableAmount={tokenABalance}
onValueChange={(value) => setTokenAmount(value)}
title="choose amount to send"
validAmount={validInputAmountToken}
Expand Down

0 comments on commit a3faff4

Please sign in to comment.