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
bf4f896a
Commit
bf4f896a
authored
Aug 22, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
toast styles fix
parent
e3f184d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
20 deletions
+6
-20
useToast.tsx
lib/hooks/useToast.tsx
+3
-1
index.tsx
pages/[network_type]/[network_sub_type]/index.tsx
+1
-18
PublicTags.tsx
ui/pages/PublicTags.tsx
+1
-1
Toast.tsx
ui/shared/Toast.tsx
+1
-0
No files found.
lib/hooks/useToast.tsx
View file @
bf4f896a
...
...
@@ -10,8 +10,10 @@ import Toast from 'ui/shared/Toast';
const
defaultOptions
:
UseToastOptions
&
{
toastComponent
?:
React
.
FC
<
ToastProps
>
}
=
{
toastComponent
:
Toast
,
position
:
'
top-right
'
,
duration
:
10000000
,
isClosable
:
true
,
containerStyle
:
{
margin
:
8
,
},
};
export
default
function
useToastModified
()
{
...
...
pages/[network_type]/[network_sub_type]/index.tsx
View file @
bf4f896a
import
type
{
AlertStatus
}
from
'
@chakra-ui/react
'
;
import
{
Center
,
Button
,
VStack
,
HStack
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
Center
,
VStack
,
Box
}
from
'
@chakra-ui/react
'
;
import
type
{
NextPage
}
from
'
next
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
useToast
from
'
lib/hooks/useToast
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
Home
:
NextPage
=
()
=>
{
const
router
=
useRouter
();
const
toast
=
useToast
();
const
openToast
=
(
status
:
AlertStatus
)
=>
()
=>
{
toast
({
title
:
'
Account created.
'
,
description
:
'
We
\'
ve created your account for you.
'
,
status
,
});
};
return
(
<
Page
>
<
Center
h=
"100%"
>
<
VStack
gap=
{
4
}
>
<
Box
>
home page for
{
router
.
query
.
network_type
}
{
router
.
query
.
network_sub_type
}
network
</
Box
>
<
HStack
>
<
Button
onClick=
{
openToast
(
'
info
'
)
}
>
Show Info
</
Button
>
<
Button
onClick=
{
openToast
(
'
error
'
)
}
>
Show Error
</
Button
>
<
Button
onClick=
{
openToast
(
'
warning
'
)
}
>
Show Warning
</
Button
>
<
Button
onClick=
{
openToast
(
'
success
'
)
}
>
Show Success
</
Button
>
</
HStack
>
</
VStack
>
</
Center
>
</
Page
>
...
...
ui/pages/PublicTags.tsx
View file @
bf4f896a
import
{
Box
,
useToast
,
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
{
animateScroll
}
from
'
react-scroll
'
;
import
type
{
PublicTag
}
from
'
types/api/account
'
;
import
useToast
from
'
lib/hooks/useToast
'
;
import
PublicTagsData
from
'
ui/publicTags/PublicTagsData
'
;
import
PublicTagsForm
from
'
ui/publicTags/PublicTagsForm/PublicTagsForm
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
...
...
ui/shared/Toast.tsx
View file @
bf4f896a
...
...
@@ -45,6 +45,7 @@ const Toast = ({ onClose, title, description, id, isClosable, status }: ToastPro
bgColor=
{
bgColor
}
textAlign=
"start"
width=
"auto"
maxWidth=
"400px"
>
<
chakra
.
div
flex=
"1"
maxWidth=
"100%"
>
{
title
&&
<
AlertTitle
id=
{
ids
?.
title
}
>
{
title
}
</
AlertTitle
>
}
...
...
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