Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
c200de2c
Commit
c200de2c
authored
Dec 20, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
txn ad banner
parent
1ef90ddc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
43 deletions
+60
-43
Transaction.tsx
ui/pages/Transaction.tsx
+0
-2
AdbutlerBanner.tsx
ui/shared/ad/AdbutlerBanner.tsx
+9
-11
CoinzillaBanner.tsx
ui/shared/ad/CoinzillaBanner.tsx
+14
-10
adbutler.html
ui/shared/ad/adbutler.html
+0
-17
TxDetails.tsx
ui/tx/TxDetails.tsx
+37
-3
No files found.
ui/pages/Transaction.tsx
View file @
c200de2c
...
@@ -9,7 +9,6 @@ import useApiQuery from 'lib/api/useApiQuery';
...
@@ -9,7 +9,6 @@ import useApiQuery from 'lib/api/useApiQuery';
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
import
networkExplorers
from
'
lib/networks/networkExplorers
'
;
import
networkExplorers
from
'
lib/networks/networkExplorers
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
...
@@ -78,7 +77,6 @@ const TransactionPageContent = () => {
...
@@ -78,7 +77,6 @@ const TransactionPageContent = () => {
</
Flex
>
</
Flex
>
)
}
)
}
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
AdBanner
mt=
{
6
}
justifyContent=
{
{
base
:
'
center
'
,
lg
:
'
start
'
}
}
/>
</
Page
>
</
Page
>
);
);
};
};
...
...
ui/shared/ad/AdbutlerBanner.tsx
View file @
c200de2c
/* eslint-disable max-len */
/* eslint-disable max-len */
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
Script
from
'
next/script
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const
scriptText1
=
`if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'https://servedbyadbutler.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}`
;
// const adbutlerHTML = require('ui/shared/ad/adbutler.html');
const
scriptText2
=
`
var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
// didn't find a way to raw-load html that works both for webpack (app build) and vite (playwright build)
const
adbutlerHTML
=
`
<div id="ad-banner"></div>
<script type="text/javascript">if (!window.AdButler){(function(){var s = document.createElement("script"); s.async = true; s.type = "text/javascript";s.src = 'https://servedbyadbutler.com/app.js';var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(s, n);}());}</script>
<script type="text/javascript">
var AdButler = AdButler || {}; AdButler.ads = AdButler.ads || [];
var abkw = window.abkw || '';
var abkw = window.abkw || '';
const isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;
const isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;
if (isMobile) {
if (isMobile) {
...
@@ -23,12 +18,15 @@ const adbutlerHTML = `
...
@@ -23,12 +18,15 @@ const adbutlerHTML = `
document.getElementById('ad-banner').innerHTML += '<'+'div id="placement_523705_'+plc523705+'"></'+'div>';
document.getElementById('ad-banner').innerHTML += '<'+'div id="placement_523705_'+plc523705+'"></'+'div>';
AdButler.ads.push({handler: function(opt){ AdButler.register(182226, 523705, [728,90], 'placement_523705_'+opt.place, opt); }, opt: { place: plc523705++, keywords: abkw, domain: 'servedbyadbutler.com', click:'CLICK_MACRO_PLACEHOLDER' }});
AdButler.ads.push({handler: function(opt){ AdButler.register(182226, 523705, [728,90], 'placement_523705_'+opt.place, opt); }, opt: { place: plc523705++, keywords: abkw, domain: 'servedbyadbutler.com', click:'CLICK_MACRO_PLACEHOLDER' }});
}
}
</script>
`
;
`
;
const
AdbutlerBanner
=
({
className
}:
{
className
?:
string
})
=>
{
const
AdbutlerBanner
=
({
className
}:
{
className
?:
string
})
=>
{
return
(
return
(
<
Flex
className=
{
className
}
dangerouslySetInnerHTML=
{
{
__html
:
adbutlerHTML
}
}
/>
<
Flex
className=
{
className
}
>
<
div
id=
"ad-banner"
></
div
>
<
Script
id=
"ad-butler-1"
>
{
scriptText1
}
</
Script
>
<
Script
id=
"ad-butler-2"
>
{
scriptText2
}
</
Script
>
</
Flex
>
);
);
};
};
...
...
ui/shared/ad/CoinzillaBanner.tsx
View file @
c200de2c
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
Script
from
'
next/script
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
...
@@ -18,18 +19,21 @@ type CPreferences = {
...
@@ -18,18 +19,21 @@ type CPreferences = {
const
CoinzillaBanner
=
({
className
}:
{
className
?:
string
})
=>
{
const
CoinzillaBanner
=
({
className
}:
{
className
?:
string
})
=>
{
const
isInBrowser
=
isBrowser
();
const
isInBrowser
=
isBrowser
();
if
(
isInBrowser
)
{
window
.
coinzilla_display
=
window
.
coinzilla_display
||
[];
React
.
useEffect
(()
=>
{
const
cDisplayPreferences
=
{}
as
CPreferences
;
if
(
isInBrowser
)
{
cDisplayPreferences
.
zone
=
'
26660bf627543e46851
'
;
window
.
coinzilla_display
=
window
.
coinzilla_display
||
[];
cDisplayPreferences
.
width
=
'
728
'
;
const
cDisplayPreferences
=
{}
as
CPreferences
;
cDisplayPreferences
.
height
=
'
90
'
;
cDisplayPreferences
.
zone
=
'
26660bf627543e46851
'
;
window
.
coinzilla_display
.
push
(
cDisplayPreferences
);
cDisplayPreferences
.
width
=
'
728
'
;
}
cDisplayPreferences
.
height
=
'
90
'
;
window
.
coinzilla_display
.
push
(
cDisplayPreferences
);
}
},
[
isInBrowser
]);
return
(
return
(
<
Flex
className=
{
className
}
>
<
Flex
className=
{
className
}
id=
"adBanner"
>
<
script
async
src=
"https://coinzillatag.com/lib/display.js"
></
script
>
<
Script
src=
"https://coinzillatag.com/lib/display.js"
/
>
<
div
className=
"coinzilla"
data
-
zone=
"C-26660bf627543e46851"
></
div
>
<
div
className=
"coinzilla"
data
-
zone=
"C-26660bf627543e46851"
></
div
>
</
Flex
>
</
Flex
>
);
);
...
...
ui/shared/ad/adbutler.html
deleted
100644 → 0
View file @
1ef90ddc
<div
id=
"ad-banner"
></div>
<script
type=
"text/javascript"
>
if
(
!
window
.
AdButler
){(
function
(){
var
s
=
document
.
createElement
(
"
script
"
);
s
.
async
=
true
;
s
.
type
=
"
text/javascript
"
;
s
.
src
=
'
https://servedbyadbutler.com/app.js
'
;
var
n
=
document
.
getElementsByTagName
(
"
script
"
)[
0
];
n
.
parentNode
.
insertBefore
(
s
,
n
);}());}
</script>
<script
type=
"text/javascript"
>
var
AdButler
=
AdButler
||
{};
AdButler
.
ads
=
AdButler
.
ads
||
[];
var
abkw
=
window
.
abkw
||
''
;
const
isMobile
=
window
.
matchMedia
(
"
only screen and (max-width: 760px)
"
).
matches
;
if
(
isMobile
)
{
var
plc539876
=
window
.
plc539876
||
0
;
document
.
getElementById
(
'
ad-banner
'
).
innerHTML
+=
'
<
'
+
'
div id="placement_539876_
'
+
plc539876
+
'
"></
'
+
'
div>
'
;
document
.
getElementById
(
"
ad-banner
"
).
className
=
"
ad-container mb-3
"
;
AdButler
.
ads
.
push
({
handler
:
function
(
opt
){
AdButler
.
register
(
182226
,
539876
,
[
320
,
100
],
'
placement_539876_
'
+
opt
.
place
,
opt
);
},
opt
:
{
place
:
plc539876
++
,
keywords
:
abkw
,
domain
:
'
servedbyadbutler.com
'
,
click
:
'
CLICK_MACRO_PLACEHOLDER
'
}});
}
else
{
var
plc523705
=
window
.
plc523705
||
0
;
document
.
getElementById
(
'
ad-banner
'
).
innerHTML
+=
'
<
'
+
'
div id="placement_523705_
'
+
plc523705
+
'
"></
'
+
'
div>
'
;
AdButler
.
ads
.
push
({
handler
:
function
(
opt
){
AdButler
.
register
(
182226
,
523705
,
[
728
,
90
],
'
placement_523705_
'
+
opt
.
place
,
opt
);
},
opt
:
{
place
:
plc523705
++
,
keywords
:
abkw
,
domain
:
'
servedbyadbutler.com
'
,
click
:
'
CLICK_MACRO_PLACEHOLDER
'
}});
}
</script>
\ No newline at end of file
ui/tx/TxDetails.tsx
View file @
c200de2c
import
{
Grid
,
GridItem
,
Text
,
Box
,
Icon
,
Link
,
Spinner
,
Tag
,
Flex
,
Tooltip
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
GridItem
,
Text
,
Box
,
Icon
,
Link
,
Spinner
,
Tag
,
Flex
,
Tooltip
,
chakra
,
useColorModeValue
,
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
scroller
,
Element
}
from
'
react-scroll
'
;
import
{
scroller
,
Element
}
from
'
react-scroll
'
;
...
@@ -11,6 +24,7 @@ import successIcon from 'icons/status/success.svg';
...
@@ -11,6 +24,7 @@ import successIcon from 'icons/status/success.svg';
import
{
WEI
,
WEI_IN_GWEI
}
from
'
lib/consts
'
;
import
{
WEI
,
WEI_IN_GWEI
}
from
'
lib/consts
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
getConfirmationDuration
from
'
lib/tx/getConfirmationDuration
'
;
import
getConfirmationDuration
from
'
lib/tx/getConfirmationDuration
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
...
@@ -34,6 +48,8 @@ import useFetchTxInfo from 'ui/tx/useFetchTxInfo';
...
@@ -34,6 +48,8 @@ import useFetchTxInfo from 'ui/tx/useFetchTxInfo';
const
TxDetails
=
()
=>
{
const
TxDetails
=
()
=>
{
const
{
data
,
isLoading
,
isError
,
socketStatus
}
=
useFetchTxInfo
();
const
{
data
,
isLoading
,
isError
,
socketStatus
}
=
useFetchTxInfo
();
const
borderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
);
const
[
isExpanded
,
setIsExpanded
]
=
React
.
useState
(
false
);
const
[
isExpanded
,
setIsExpanded
]
=
React
.
useState
(
false
);
const
handleCutClick
=
React
.
useCallback
(()
=>
{
const
handleCutClick
=
React
.
useCallback
(()
=>
{
...
@@ -140,7 +156,19 @@ const TxDetails = () => {
...
@@ -140,7 +156,19 @@ const TxDetails = () => {
<
Text
variant=
"secondary"
>
{
getConfirmationDuration
(
data
.
confirmation_duration
)
}
</
Text
>
<
Text
variant=
"secondary"
>
{
getConfirmationDuration
(
data
.
confirmation_duration
)
}
</
Text
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
3
,
lg
:
8
}
}
/>
<
DetailsInfoItem
title=
"Sponsored"
hint=
"Sponsored banner advertisement"
>
<
AdBanner
/>
</
DetailsInfoItem
>
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
2
,
lg
:
3
}
}
mb=
{
{
base
:
0
,
lg
:
3
}
}
borderBottom=
"1px solid"
borderColor=
{
borderColor
}
/>
<
DetailsInfoItem
<
DetailsInfoItem
title=
"From"
title=
"From"
hint=
"Address (external or contract) sending the transaction."
hint=
"Address (external or contract) sending the transaction."
...
@@ -191,7 +219,13 @@ const TxDetails = () => {
...
@@ -191,7 +219,13 @@ const TxDetails = () => {
</
DetailsInfoItem
>
</
DetailsInfoItem
>
{
data
.
token_transfers
&&
<
TxDetailsTokenTransfers
data=
{
data
.
token_transfers
}
txHash=
{
data
.
hash
}
/>
}
{
data
.
token_transfers
&&
<
TxDetailsTokenTransfers
data=
{
data
.
token_transfers
}
txHash=
{
data
.
hash
}
/>
}
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
3
,
lg
:
8
}
}
/>
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
2
,
lg
:
3
}
}
mb=
{
{
base
:
0
,
lg
:
3
}
}
borderBottom=
"1px solid"
borderColor=
{
borderColor
}
/>
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Value"
title=
"Value"
hint=
"Value sent in the native token (and USD) if applicable."
hint=
"Value sent in the native token (and USD) if applicable."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment