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
206d2e9c
Commit
206d2e9c
authored
Jul 20, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make request on page load
parent
d6294509
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
20 deletions
+9
-20
hello.ts
pages/api/hello.ts
+0
-13
private-tags.tsx
pages/private-tags.tsx
+9
-0
PrivateTags.tsx
ui/pages/PrivateTags.tsx
+0
-7
No files found.
pages/api/hello.ts
deleted
100644 → 0
View file @
d6294509
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import
type
{
NextApiRequest
,
NextApiResponse
}
from
'
next
'
type
Data
=
{
name
:
string
;
}
export
default
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
<
Data
>
,
)
{
res
.
status
(
200
).
json
({
name
:
'
John Doe
'
})
}
pages/private-tags.tsx
View file @
206d2e9c
...
@@ -2,8 +2,17 @@ import React from 'react';
...
@@ -2,8 +2,17 @@ import React from 'react';
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
import
Head
from
'
next/head
'
import
fetch
from
'
api/utils/fetch
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
export
async
function
getServerSideProps
()
{
const
response
=
await
fetch
(
'
/account/v1/user/tags/address
'
)
const
data
=
await
response
.
json
()
return
{
props
:
{
data
}
}
}
const
PrivateTagsPage
:
NextPage
=
()
=>
{
const
PrivateTagsPage
:
NextPage
=
()
=>
{
return
(
return
(
<>
<>
...
...
ui/pages/PrivateTags.tsx
View file @
206d2e9c
...
@@ -8,7 +8,6 @@ import {
...
@@ -8,7 +8,6 @@ import {
TabList
,
TabList
,
TabPanel
,
TabPanel
,
TabPanels
,
TabPanels
,
Button
,
}
from
'
@chakra-ui/react
'
;
}
from
'
@chakra-ui/react
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
...
@@ -16,16 +15,10 @@ import PrivateAddressTags from 'ui/privateTags/PrivateAddressTags';
...
@@ -16,16 +15,10 @@ import PrivateAddressTags from 'ui/privateTags/PrivateAddressTags';
import
PrivateTransactionTags
from
'
ui/privateTags/PrivateTransactionTags
'
;
import
PrivateTransactionTags
from
'
ui/privateTags/PrivateTransactionTags
'
;
const
PrivateTags
:
React
.
FC
=
()
=>
{
const
PrivateTags
:
React
.
FC
=
()
=>
{
const
handleClick
=
React
.
useCallback
(
async
()
=>
{
await
fetch
(
'
/api/account/private-tags/address
'
);
},
[])
return
(
return
(
<
Page
>
<
Page
>
<
Box
h=
"100%"
>
<
Box
h=
"100%"
>
<
Heading
as=
"h1"
size=
"lg"
marginBottom=
{
8
}
>
Private tags
</
Heading
>
<
Heading
as=
"h1"
size=
"lg"
marginBottom=
{
8
}
>
Private tags
</
Heading
>
<
Button
onClick=
{
handleClick
}
>
click
</
Button
>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
>
<
TabList
marginBottom=
{
8
}
>
<
TabList
marginBottom=
{
8
}
>
<
Tab
>
Address
</
Tab
>
<
Tab
>
Address
</
Tab
>
...
...
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