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
e2da56b5
Commit
e2da56b5
authored
Jan 16, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback all debugs
parent
79cb82d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
24 deletions
+32
-24
playwright-ct.config.ts
playwright-ct.config.ts
+0
-2
ContractCode.pw.tsx
ui/address/contract/ContractCode.pw.tsx
+5
-5
ContractCode.tsx
ui/address/contract/ContractCode.tsx
+2
-11
CodeEditor.tsx
ui/shared/CodeEditor.tsx
+25
-6
No files found.
playwright-ct.config.ts
View file @
e2da56b5
import
type
{
PlaywrightTestConfig
}
from
'
@playwright/experimental-ct-react
'
;
import
{
devices
}
from
'
@playwright/experimental-ct-react
'
;
import
react
from
'
@vitejs/plugin-react
'
;
import
dynamicImport
from
'
vite-plugin-dynamic-import
'
;
import
svgr
from
'
vite-plugin-svgr
'
;
import
tsconfigPaths
from
'
vite-tsconfig-paths
'
;
...
...
@@ -51,7 +50,6 @@ const config: PlaywrightTestConfig = {
svgr
({
exportAsDefault
:
true
,
}),
dynamicImport
(),
],
},
},
...
...
ui/address/contract/ContractCode.pw.tsx
View file @
e2da56b5
...
...
@@ -15,7 +15,7 @@ const hooksConfig = {
},
};
test
.
skip
(
'
verified with changed byte code +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
test
(
'
verified with changed byte code +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
contractMock
.
withChangedByteCode
),
...
...
@@ -31,7 +31,7 @@ test.skip('verified with changed byte code +@mobile +@dark-mode', async({ mount,
await
expect
(
component
).
toHaveScreenshot
();
});
test
.
skip
(
'
verified with multiple sources
'
,
async
({
mount
,
page
})
=>
{
test
(
'
verified with multiple sources
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
contractMock
.
withMultiplePaths
),
...
...
@@ -65,7 +65,7 @@ test('verified via sourcify', async({ mount, page }) => {
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
1200
,
height
:
110
}
});
});
test
.
skip
(
'
self destructed
'
,
async
({
mount
,
page
})
=>
{
test
(
'
self destructed
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
contractMock
.
selfDestructed
),
...
...
@@ -82,7 +82,7 @@ test.skip('self destructed', async({ mount, page }) => {
await
expect
(
section
).
toHaveScreenshot
();
});
test
.
skip
(
'
with twin address alert +@mobile
'
,
async
({
mount
,
page
})
=>
{
test
(
'
with twin address alert +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
contractMock
.
withTwinAddress
),
...
...
@@ -98,7 +98,7 @@ test.skip('with twin address alert +@mobile', async({ mount, page }) => {
await
expect
(
component
.
getByRole
(
'
alert
'
)).
toHaveScreenshot
();
});
test
.
skip
(
'
non verified
'
,
async
({
mount
,
page
})
=>
{
test
(
'
non verified
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
contractMock
.
nonVerified
),
...
...
ui/address/contract/ContractCode.tsx
View file @
e2da56b5
...
...
@@ -11,7 +11,7 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert';
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
import
RawDataSnippet
from
'
ui/shared/RawDataSnippet
'
;
import
type
T
ContractSourceCode
from
'
./ContractSourceCode
'
;
import
ContractSourceCode
from
'
./ContractSourceCode
'
;
const
InfoItem
=
({
label
,
value
}:
{
label
:
string
;
value
:
string
})
=>
(
<
GridItem
display=
"flex"
columnGap=
{
6
}
>
...
...
@@ -22,15 +22,6 @@ const InfoItem = ({ label, value }: { label: string; value: string }) => (
const
ContractCode
=
()
=>
{
const
router
=
useRouter
();
const
[
ContractSourceCode
,
setContractSourceCode
]
=
React
.
useState
<
typeof
TContractSourceCode
|
null
>
(
null
);
React
.
useEffect
(()
=>
{
import
(
'
./ContractSourceCode
'
).
then
((
component
)
=>
setContractSourceCode
(
component
.
default
));
return
()
=>
{
setContractSourceCode
(
null
);
};
},
[]);
const
addressHash
=
router
.
query
.
id
?.
toString
();
const
{
data
,
isLoading
,
isError
}
=
useApiQuery
(
'
contract
'
,
{
...
...
@@ -158,7 +149,7 @@ const ContractCode = () => {
textareaMaxHeight=
"200px"
/>
)
}
{
data
.
source_code
&&
ContractSourceCode
&&
(
{
data
.
source_code
&&
(
<
ContractSourceCode
data=
{
data
.
source_code
}
hasSol2Yml=
{
Boolean
(
data
.
can_be_visualized_via_sol2uml
)
}
...
...
ui/shared/CodeEditor.tsx
View file @
e2da56b5
import
{
chakra
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
AceEditor
from
'
react-ace
'
;
import
'
ace-builds/src-noconflict/mode-csharp
'
;
import
'
ace-builds/src-noconflict/theme-tomorrow
'
;
import
'
ace-builds/src-noconflict/theme-tomorrow_night
'
;
import
'
ace-builds/src-noconflict/ext-language_tools
'
;
import
type
ReactAce
from
'
react-ace/lib/ace
'
;
interface
Props
{
id
:
string
;
...
...
@@ -14,10 +10,33 @@ interface Props {
const
CodeEditorBase
=
chakra
(({
id
,
value
,
className
}:
Props
)
=>
{
const
[
AceEditor
,
setAceEditor
]
=
React
.
useState
<
{
default
:
typeof
ReactAce
}
|
null
>
(
null
);
React
.
useEffect
(()
=>
{
const
load
=
async
()
=>
{
const
component
=
await
import
(
'
react-ace
'
);
await
import
(
'
ace-builds/src-noconflict/mode-csharp
'
);
await
import
(
'
ace-builds/src-noconflict/theme-tomorrow
'
);
await
import
(
'
ace-builds/src-noconflict/theme-tomorrow_night
'
);
await
import
(
'
ace-builds/src-noconflict/ext-language_tools
'
);
setAceEditor
(
component
);
};
load
();
return
()
=>
{
setAceEditor
(
null
);
};
},
[]);
const
theme
=
useColorModeValue
(
'
tomorrow
'
,
'
tomorrow_night
'
);
if
(
!
AceEditor
)
{
return
null
;
}
return
(
<
AceEditor
<
AceEditor
.
default
className=
{
className
}
mode=
"csharp"
// TODO need to find mode for solidity
theme=
{
theme
}
...
...
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