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
1ef90ddc
Commit
1ef90ddc
authored
Dec 22, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmp
parent
00e7f155
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
147 additions
and
50 deletions
+147
-50
Address.tsx
ui/pages/Address.tsx
+7
-8
Block.tsx
ui/pages/Block.tsx
+6
-12
Blocks.tsx
ui/pages/Blocks.tsx
+1
-1
Transaction.tsx
ui/pages/Transaction.tsx
+22
-25
Transactions.tsx
ui/pages/Transactions.tsx
+1
-1
PageTitle.pw.tsx
ui/shared/Page/PageTitle.pw.tsx
+0
-0
PageTitle.tsx
ui/shared/Page/PageTitle.tsx
+38
-3
CoinzillaTextAd.tsx
ui/shared/ad/CoinzillaTextAd.tsx
+57
-0
TextAd.tsx
ui/shared/ad/TextAd.tsx
+15
-0
No files found.
ui/pages/Address.tsx
View file @
1ef90ddc
...
@@ -40,16 +40,15 @@ const AddressPageContent = () => {
...
@@ -40,16 +40,15 @@ const AddressPageContent = () => {
{
id
:
'
blocks_validated
'
,
title
:
'
Blocks validated
'
,
component
:
<
AddressBlocksValidated
addressQuery=
{
addressQuery
}
/>
},
{
id
:
'
blocks_validated
'
,
title
:
'
Blocks validated
'
,
component
:
<
AddressBlocksValidated
addressQuery=
{
addressQuery
}
/>
},
];
];
const
tagsNode
=
tags
.
length
>
0
?
<
Flex
columnGap=
{
2
}
>
{
tags
}
</
Flex
>
:
null
;
return
(
return
(
<
Page
>
<
Page
>
<
Flex
alignItems=
"center"
columnGap=
{
3
}
>
<
PageTitle
<
PageTitle
text=
{
`${ addressQuery.data?.is_contract ? 'Contract' : 'Address' } details`
}
/>
text=
{
`${ addressQuery.data?.is_contract ? 'Contract' : 'Address' } details`
}
{
tags
.
length
>
0
&&
(
additionals=
{
tagsNode
}
<
Flex
mb=
{
6
}
columnGap=
{
2
}
>
withTextAd
{
tags
}
/>
</
Flex
>
)
}
</
Flex
>
<
AddressDetails
addressQuery=
{
addressQuery
}
/>
<
AddressDetails
addressQuery=
{
addressQuery
}
/>
<
RoutedTabs
tabs=
{
tabs
}
tabListProps=
{
{
mt
:
8
}
}
/>
<
RoutedTabs
tabs=
{
tabs
}
tabListProps=
{
{
mt
:
8
}
}
/>
</
Page
>
</
Page
>
...
...
ui/pages/Block.tsx
View file @
1ef90ddc
import
{
Flex
,
Icon
,
Link
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/RoutedTabs/types
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/RoutedTabs/types
'
;
import
eastArrowIcon
from
'
icons/arrows/east.svg
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
...
@@ -52,16 +50,12 @@ const BlockPageContent = () => {
...
@@ -52,16 +50,12 @@ const BlockPageContent = () => {
return
(
return
(
<
Page
>
<
Page
>
<
Flex
alignItems=
"center"
columnGap=
{
3
}
>
<
PageTitle
{
hasGoBackLink
&&
(
text=
{
`Block #${ router.query.id }`
}
<
Tooltip
label=
"Back to blocks list"
>
backLinkUrl=
{
hasGoBackLink
?
referrer
:
undefined
}
<
Link
mb=
{
6
}
display=
"inline-flex"
href=
{
referrer
}
>
backLinkLabel=
"Back to blocks list"
<
Icon
as=
{
eastArrowIcon
}
boxSize=
{
6
}
transform=
"rotate(180deg)"
/>
withTextAd
</
Link
>
/>
</
Tooltip
>
)
}
<
PageTitle
text=
{
`Block #${ router.query.id }`
}
/>
</
Flex
>
<
RoutedTabs
<
RoutedTabs
tabs=
{
tabs
}
tabs=
{
tabs
}
tabListProps=
{
isMobile
?
undefined
:
TAB_LIST_PROPS
}
tabListProps=
{
isMobile
?
undefined
:
TAB_LIST_PROPS
}
...
...
ui/pages/Blocks.tsx
View file @
1ef90ddc
...
@@ -42,7 +42,7 @@ const BlocksPageContent = () => {
...
@@ -42,7 +42,7 @@ const BlocksPageContent = () => {
return
(
return
(
<
Page
>
<
Page
>
<
PageTitle
text=
"Blocks"
/>
<
PageTitle
text=
"Blocks"
withTextAd
/>
<
RoutedTabs
<
RoutedTabs
tabs=
{
tabs
}
tabs=
{
tabs
}
tabListProps=
{
isMobile
?
undefined
:
TAB_LIST_PROPS
}
tabListProps=
{
isMobile
?
undefined
:
TAB_LIST_PROPS
}
...
...
ui/pages/Transaction.tsx
View file @
1ef90ddc
...
@@ -52,34 +52,31 @@ const TransactionPageContent = () => {
...
@@ -52,34 +52,31 @@ const TransactionPageContent = () => {
return
<
ExternalLink
key=
{
explorer
.
baseUrl
}
title=
{
`Open in ${ explorer.title }`
}
href=
{
url
.
toString
()
}
/>;
return
<
ExternalLink
key=
{
explorer
.
baseUrl
}
title=
{
`Open in ${ explorer.title }`
}
href=
{
url
.
toString
()
}
/>;
});
});
const
tag
=
data
?.
tx_tag
?
<
Tag
my=
{
2
}
>
{
data
.
tx_tag
}
</
Tag
>
:
undefined
;
return
(
return
(
<
Page
>
<
Page
>
<
Flex
alignItems=
"flex-start"
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
PageTitle
<
Flex
alignItems=
"center"
columnGap=
{
3
}
>
text=
"Transaction details"
{
hasGoBackLink
&&
(
additionals=
{
tag
}
<
Tooltip
label=
"Back to transactions list"
>
backLinkUrl=
{
hasGoBackLink
?
referrer
:
undefined
}
<
Link
display=
"inline-flex"
href=
{
referrer
}
mb=
{
6
}
>
backLinkLabel=
"Back to transactions list"
<
Icon
as=
{
eastArrowIcon
}
boxSize=
{
6
}
transform=
"rotate(180deg)"
/>
withTextAd
</
Link
>
/>
</
Tooltip
>
{
explorersLinks
.
length
>
0
&&
(
)
}
<
Flex
<
PageTitle
text=
"Transaction details"
/>
alignItems=
"center"
flexWrap=
"wrap"
columnGap=
{
6
}
rowGap=
{
3
}
ml=
{
{
base
:
'
initial
'
,
lg
:
'
auto
'
}
}
mb=
{
6
}
py=
{
2.5
}
mt=
"-16px"
>
{
explorersLinks
}
</
Flex
>
</
Flex
>
{
data
?.
tx_tag
&&
<
Tag
my=
{
2
}
ml=
{
3
}
>
{
data
.
tx_tag
}
</
Tag
>
}
)
}
{
explorersLinks
.
length
>
0
&&
(
<
Flex
alignItems=
"center"
flexWrap=
"wrap"
columnGap=
{
6
}
rowGap=
{
3
}
ml=
{
{
base
:
'
initial
'
,
lg
:
'
auto
'
}
}
mb=
{
{
base
:
6
,
lg
:
'
initial
'
}
}
py=
{
2.5
}
>
{
explorersLinks
}
</
Flex
>
)
}
</
Flex
>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
AdBanner
mt=
{
6
}
justifyContent=
{
{
base
:
'
center
'
,
lg
:
'
start
'
}
}
/>
<
AdBanner
mt=
{
6
}
justifyContent=
{
{
base
:
'
center
'
,
lg
:
'
start
'
}
}
/>
</
Page
>
</
Page
>
...
...
ui/pages/Transactions.tsx
View file @
1ef90ddc
...
@@ -37,7 +37,7 @@ const Transactions = () => {
...
@@ -37,7 +37,7 @@ const Transactions = () => {
return
(
return
(
<
Page
hideMobileHeaderOnScrollDown
>
<
Page
hideMobileHeaderOnScrollDown
>
<
Box
h=
"100%"
>
<
Box
h=
"100%"
>
<
PageTitle
text=
"Transactions"
/>
<
PageTitle
text=
"Transactions"
withTextAd
/>
<
RoutedTabs
<
RoutedTabs
tabs=
{
tabs
}
tabs=
{
tabs
}
tabListProps=
{
isMobile
?
undefined
:
TAB_LIST_PROPS
}
tabListProps=
{
isMobile
?
undefined
:
TAB_LIST_PROPS
}
...
...
ui/shared/Page/PageTitle.pw.tsx
0 → 100644
View file @
1ef90ddc
ui/shared/Page/PageTitle.tsx
View file @
1ef90ddc
import
{
Heading
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Heading
,
Flex
,
Tooltip
,
Link
,
Icon
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
const
PageTitle
=
({
text
,
className
}:
{
text
:
string
;
className
?:
string
})
=>
{
import
eastArrowIcon
from
'
icons/arrows/east.svg
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
type
Props
=
{
text
:
string
;
additionals
?:
React
.
ReactNode
;
withTextAd
?:
boolean
;
className
?:
string
;
backLinkLabel
?:
string
;
backLinkUrl
?:
string
;
}
const
PageTitle
=
({
text
,
additionals
,
withTextAd
,
backLinkUrl
,
backLinkLabel
,
className
}:
Props
)
=>
{
const
title
=
<
Heading
as=
"h1"
size=
"lg"
flex=
"none"
>
{
text
}
</
Heading
>;
return
(
return
(
<
Heading
as=
"h1"
size=
"lg"
marginBottom=
{
6
}
className=
{
className
}
>
{
text
}
</
Heading
>
<
Flex
columnGap=
{
3
}
rowGap=
{
3
}
alignItems=
{
{
base
:
'
start
'
,
lg
:
'
center
'
}
}
flexDirection=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
mb=
{
6
}
justifyContent=
"space-between"
className=
{
className
}
>
<
Flex
flexWrap=
"wrap"
columnGap=
{
3
}
alignItems=
"center"
>
{
backLinkUrl
&&
(
<
Tooltip
label=
{
backLinkLabel
}
>
<
Link
display=
"inline-flex"
href=
{
backLinkUrl
}
>
<
Icon
as=
{
eastArrowIcon
}
boxSize=
{
6
}
transform=
"rotate(180deg)"
/>
</
Link
>
</
Tooltip
>
)
}
{
title
}
{
additionals
}
</
Flex
>
{
withTextAd
&&
<
TextAd
flexShrink=
{
100
}
/>
}
</
Flex
>
);
);
};
};
...
...
ui/shared/ad/CoinzillaTextAd.tsx
0 → 100644
View file @
1ef90ddc
import
{
Box
,
Image
,
Link
,
Text
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
ndash
}
from
'
lib/html-entities
'
;
type
AdData
=
{
ad
:
{
name
:
string
;
description_short
:
string
;
thumbnail
:
string
;
url
:
string
;
cta_button
:
string
;
impressionUrl
:
string
;
};
}
const
CoinzillaTextAd
=
({
className
}:
{
className
?:
string
})
=>
{
const
[
adData
,
setAdData
]
=
React
.
useState
<
AdData
|
null
>
(
null
);
useEffect
(()
=>
{
fetch
(
'
https://request-global.czilladx.com/serve/native.php?z=19260bf627546ab7242
'
)
.
then
(
res
=>
res
.
status
===
200
?
res
.
json
()
:
null
)
.
then
((
data
)
=>
{
setAdData
(
data
);
if
(
data
?.
ad
?.
impressionUrl
)
{
fetch
(
data
.
ad
.
impressionUrl
);
}
});
},
[]);
if
(
!
adData
)
{
return
null
;
}
const
urlObject
=
new
URL
(
adData
.
ad
.
url
);
return
(
<
Box
className=
{
className
}
>
<
Text
as=
"span"
whiteSpace=
"pre-wrap"
fontWeight=
{
700
}
mr=
{
3
}
display=
{
{
base
:
'
none
'
,
lg
:
'
inline
'
}
}
>
ADs:
</
Text
>
{
urlObject
.
hostname
===
'
nifty.ink
'
?
<
Text
as=
"span"
mr=
{
1
}
>
🎨
</
Text
>
:
<
Image
src=
{
adData
.
ad
.
thumbnail
}
width=
"20px"
height=
"20px"
mb=
"-4px"
mr=
{
1
}
display=
"inline"
alt=
""
/>
}
<
Text
as=
"span"
whiteSpace=
"pre-wrap"
>
{
`${ adData.ad.name } ${ ndash } ${ adData.ad.description_short } `
}
</
Text
>
<
Link
href=
{
adData
.
ad
.
url
}
>
{
adData
.
ad
.
cta_button
}
</
Link
>
</
Box
>
);
};
export
default
chakra
(
CoinzillaTextAd
);
ui/shared/ad/TextAd.tsx
0 → 100644
View file @
1ef90ddc
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
isSelfHosted
from
'
lib/isSelfHosted
'
;
import
CoinzillaTextAd
from
'
./CoinzillaTextAd
'
;
const
TextAd
=
({
className
}:
{
className
?:
string
})
=>
{
if
(
!
isSelfHosted
())
{
return
null
;
}
return
<
CoinzillaTextAd
className=
{
className
}
/>;
};
export
default
chakra
(
TextAd
);
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