Commit 98b14083 authored by tom's avatar tom

remove unnecessary scripts

parent 5ae8e290
...@@ -2,5 +2,3 @@ node_modules ...@@ -2,5 +2,3 @@ node_modules
node_modules_linux node_modules_linux
playwright/envs.js playwright/envs.js
public/static/js/jquery.mCustomScrollbar.concat.min.js
public/static/js/jquery.min.js
...@@ -40,7 +40,6 @@ class MyDocument extends Document { ...@@ -40,7 +40,6 @@ class MyDocument extends Document {
<link rel="icon" sizes="16x16" type="image/png"href="/static/favicon-16x16.png"/> <link rel="icon" sizes="16x16" type="image/png"href="/static/favicon-16x16.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"/> <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"/>
<link rel="mask-icon" href="/static/safari-pinned-tab.svg" color="#5bbad5"/> <link rel="mask-icon" href="/static/safari-pinned-tab.svg" color="#5bbad5"/>
<link rel="stylesheet" href="/static/css/jquery.mCustomScrollbar.min.css"/>
</Head> </Head>
<body> <body>
<ColorModeScript initialColorMode={ theme.config.initialColorMode }/> <ColorModeScript initialColorMode={ theme.config.initialColorMode }/>
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import { Flex, Tag } from '@chakra-ui/react'; import { Flex, Tag } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import Script from 'next/script';
import React from 'react'; import React from 'react';
import type { RoutedTab } from 'ui/shared/RoutedTabs/types'; import type { RoutedTab } from 'ui/shared/RoutedTabs/types';
...@@ -75,7 +74,6 @@ const TransactionPageContent = () => { ...@@ -75,7 +74,6 @@ const TransactionPageContent = () => {
backLinkLabel="Back to transactions list" backLinkLabel="Back to transactions list"
/> />
<RoutedTabs tabs={ TABS }/> <RoutedTabs tabs={ TABS }/>
<Script src="/static/js/jquery.min.js" strategy="beforeInteractive"/>
</Page> </Page>
); );
}; };
......
...@@ -9,10 +9,9 @@ interface Props extends Omit<HTMLChakraProps<'div'>, 'title'> { ...@@ -9,10 +9,9 @@ interface Props extends Omit<HTMLChakraProps<'div'>, 'title'> {
hint: string; hint: string;
children: React.ReactNode; children: React.ReactNode;
note?: string; note?: string;
noteDisplay?: string;
} }
const DetailsInfoItem = ({ title, hint, note, noteDisplay, children, id, ...styles }: Props) => { const DetailsInfoItem = ({ title, hint, note, children, id, ...styles }: Props) => {
return ( return (
<> <>
<GridItem py={{ base: 1, lg: 2 }} id={ id } lineHeight={ 5 } { ...styles } whiteSpace="nowrap" _notFirst={{ mt: { base: 3, lg: 0 } }}> <GridItem py={{ base: 1, lg: 2 }} id={ id } lineHeight={ 5 } { ...styles } whiteSpace="nowrap" _notFirst={{ mt: { base: 3, lg: 0 } }}>
...@@ -28,7 +27,7 @@ const DetailsInfoItem = ({ title, hint, note, noteDisplay, children, id, ...styl ...@@ -28,7 +27,7 @@ const DetailsInfoItem = ({ title, hint, note, noteDisplay, children, id, ...styl
</Tooltip> </Tooltip>
<Text fontWeight={{ base: 700, lg: 500 }}> <Text fontWeight={{ base: 700, lg: 500 }}>
{ title } { title }
{ note && <Text fontWeight={ 500 } color="gray.500" fontSize="xs" className="note" display={ noteDisplay } align="right">{ note }</Text> } { note && <Text fontWeight={ 500 } variant="secondary" fontSize="xs" className="note" align="right">{ note }</Text> }
</Text> </Text>
</Flex> </Flex>
</GridItem> </GridItem>
......
...@@ -87,7 +87,7 @@ const TxDetailsAction = ({ action, isLast }: Props) => { ...@@ -87,7 +87,7 @@ const TxDetailsAction = ({ action, isLast }: Props) => {
</Flex> </Flex>
<Flex columnGap={ 1 }> <Flex columnGap={ 1 }>
<Text as="span">To</Text> <Text as="span">To</Text>
<AddressLink hash={ data.to }/> <AddressLink hash={ data.to } type="address"/>
</Flex> </Flex>
</Flex> </Flex>
<Flex columnGap={ 1 } rowGap={ 2 } marginLeft={ 3 } flexDirection="column"> <Flex columnGap={ 1 } rowGap={ 2 } marginLeft={ 3 } flexDirection="column">
......
import { Box, Flex } from '@chakra-ui/react'; import { Flex } from '@chakra-ui/react';
import Script from 'next/script';
import React from 'react'; import React from 'react';
import type { TxAction as TTxAction } from 'types/api/txAction'; import type { TxAction } from 'types/api/txAction';
import DetailsInfoItem from 'ui/shared/DetailsInfoItem'; import DetailsInfoItem from 'ui/shared/DetailsInfoItem';
import TxDetailsAction from './TxDetailsAction'; import TxDetailsAction from './TxDetailsAction';
interface Props { interface Props {
actions: Array<TTxAction>; actions: Array<TxAction>;
}
declare global {
interface JQuery {
mCustomScrollbar(options: object): void;
}
} }
const TxDetailsActions = ({ actions }: Props) => { const TxDetailsActions = ({ actions }: Props) => {
function onScrollbarLoad() {
const customScrollBar = $('.mCustomScrollbar');
customScrollBar.mCustomScrollbar({ callbacks: {
onOverflowY: () => {
$('#txActionsTitle .note').css('display', 'block');
customScrollBar.removeClass('mCS_no_scrollbar_y');
},
onOverflowYNone: () => {
$('#txActionsTitle .note').css('display', 'none');
customScrollBar.addClass('mCS_no_scrollbar_y');
},
},
theme: 'dark',
autoHideScrollbar: true,
scrollButtons: { enable: false },
scrollbarPosition: 'outside' });
}
return ( return (
<DetailsInfoItem <DetailsInfoItem
title="Transaction Action" title="Transaction Action"
hint="Highlighted events of the transaction" hint="Highlighted events of the transaction"
note="Scroll to see more" note="Scroll to see more"
noteDisplay="none"
position="relative"
id="txActionsTitle"
> >
<Box className="mCustomScrollbar" maxH={ 36 } w="98%" overflow="hidden"> <Flex
<Flex flexDirection="column"
flexDirection="column" alignItems="flex-start"
alignItems="flex-start" rowGap={ 5 }
rowGap={ 5 } w="100%"
w="100%" fontWeight={ 500 }
fontWeight={ 500 } >
> { actions.map((action, index: number) => <TxDetailsAction key={ index } action={ action } isLast={ index === actions.length - 1 }/>) }
{ actions.map((action, index: number) => <TxDetailsAction key={ index } action={ action } isLast={ index === actions.length - 1 }/>) } </Flex>
</Flex>
</Box>
{ /* eslint-disable-next-line react/jsx-no-bind */ }
<Script src="/static/js/jquery.mCustomScrollbar.concat.min.js" strategy="afterInteractive" onLoad={ onScrollbarLoad }/>
</DetailsInfoItem> </DetailsInfoItem>
); );
}; };
......
...@@ -3936,13 +3936,6 @@ ...@@ -3936,13 +3936,6 @@
expect "^29.0.0" expect "^29.0.0"
pretty-format "^29.0.0" pretty-format "^29.0.0"
"@types/jquery@^3.5.14":
version "3.5.14"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.14.tgz#ac8e11ee591e94d4d58da602cb3a5a8320dee577"
integrity sha512-X1gtMRMbziVQkErhTQmSe2jFwwENA/Zr+PprCkF63vFq+Yt5PZ4AlKqgmeNlwgn7dhsXEK888eIW2520EpC+xg==
dependencies:
"@types/sizzle" "*"
"@types/js-cookie@^3.0.2": "@types/js-cookie@^3.0.2":
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-3.0.2.tgz#451eaeece64c6bdac8b2dde0caab23b085899e0d" resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-3.0.2.tgz#451eaeece64c6bdac8b2dde0caab23b085899e0d"
...@@ -4098,11 +4091,6 @@ ...@@ -4098,11 +4091,6 @@
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==
"@types/sizzle@*":
version "2.3.3"
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.3.tgz#ff5e2f1902969d305225a047c8a0fd5c915cebef"
integrity sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==
"@types/stack-utils@^2.0.0": "@types/stack-utils@^2.0.0":
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment