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
e15a14f1
Commit
e15a14f1
authored
Nov 29, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Home page test
parent
66202d37
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
2 deletions
+48
-2
Home.pw.tsx
ui/pages/Home.pw.tsx
+44
-0
Home.pw.tsx_dark-color-mode_default-view---default-desktop-xl-mobile-dark-mode-1.png
..._default-view---default-desktop-xl-mobile-dark-mode-1.png
+0
-0
Home.pw.tsx_desktop-xl_default-view---default-desktop-xl-mobile-dark-mode-1.png
..._default-view---default-desktop-xl-mobile-dark-mode-1.png
+0
-0
Home.pw.tsx_mobile_default-view---default-desktop-xl-mobile-dark-mode-1.png
..._default-view---default-desktop-xl-mobile-dark-mode-1.png
+0
-0
UserAvatar.tsx
ui/shared/UserAvatar.tsx
+4
-2
No files found.
ui/pages/Home.pw.tsx
0 → 100644
View file @
e15a14f1
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
*
as
blockMock
from
'
mocks/blocks/block
'
;
import
*
as
dailyTxsMock
from
'
mocks/stats/daily_txs
'
;
import
*
as
statsMock
from
'
mocks/stats/index
'
;
import
*
as
txMock
from
'
mocks/txs/tx
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
Home
from
'
./Home
'
;
test
(
'
default view -@default +@desktop-xl +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
'
/node-api/stats
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
statsMock
.
base
),
}));
await
page
.
route
(
'
/node-api/index/blocks
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
([
blockMock
.
base
,
blockMock
.
base2
,
]),
}));
await
page
.
route
(
'
/node-api/index/txs
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
([
txMock
.
base
,
txMock
.
withContractCreation
,
txMock
.
withTokenTransfer
,
]),
}));
await
page
.
route
(
'
/node-api/stats/charts/transactions
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
dailyTxsMock
.
base
),
}));
const
component
=
await
mount
(
<
TestApp
>
<
Home
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/pages/__screenshots__/Home.pw.tsx_dark-color-mode_default-view---default-desktop-xl-mobile-dark-mode-1.png
0 → 100644
View file @
e15a14f1
300 KB
ui/pages/__screenshots__/Home.pw.tsx_desktop-xl_default-view---default-desktop-xl-mobile-dark-mode-1.png
0 → 100644
View file @
e15a14f1
355 KB
ui/pages/__screenshots__/Home.pw.tsx_mobile_default-view---default-desktop-xl-mobile-dark-mode-1.png
0 → 100644
View file @
e15a14f1
165 KB
ui/shared/UserAvatar.tsx
View file @
e15a14f1
...
@@ -7,10 +7,12 @@ import type { UserInfo } from 'types/api/account';
...
@@ -7,10 +7,12 @@ import type { UserInfo } from 'types/api/account';
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
const
IdenticonComponent
=
typeof
Identicon
===
'
object
'
&&
'
default
'
in
Identicon
?
Identicon
.
default
:
Identicon
;
// for those who haven't got profile
// for those who haven't got profile
// or if we cannot download the profile picture for some reasons
// or if we cannot download the profile picture for some reasons
const
FallbackImage
=
({
size
,
id
}:
{
size
:
number
;
id
:
string
})
=>
{
const
FallbackImage
=
({
size
,
id
}:
{
size
:
number
;
id
:
string
})
=>
{
const
bgColor
=
useToken
(
'
colors
'
,
useColorModeValue
(
'
blackAlpha
.100
'
,
'
white
'
));
const
bgColor
=
useToken
(
'
colors
'
,
useColorModeValue
(
'
gray
.100
'
,
'
white
'
));
return
(
return
(
<
Box
<
Box
...
@@ -19,7 +21,7 @@ const FallbackImage = ({ size, id }: { size: number; id: string }) => {
...
@@ -19,7 +21,7 @@ const FallbackImage = ({ size, id }: { size: number; id: string }) => {
maxHeight=
{
`${ size }px`
}
maxHeight=
{
`${ size }px`
}
>
>
<
Box
boxSize=
{
`${ size * 2 }px`
}
transformOrigin=
"left top"
transform=
"scale(0.5)"
borderRadius=
"full"
overflow=
"hidden"
>
<
Box
boxSize=
{
`${ size * 2 }px`
}
transformOrigin=
"left top"
transform=
"scale(0.5)"
borderRadius=
"full"
overflow=
"hidden"
>
<
Identicon
<
Identicon
Component
bg=
{
bgColor
}
bg=
{
bgColor
}
string=
{
id
}
string=
{
id
}
// the displayed size is doubled for retina displays and then scaled down
// the displayed size is doubled for retina displays and then scaled down
...
...
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