-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
2,485 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# VITE_NETWORK=0x5afd | ||
# VITE_WEB3_GATEWAY=http://localhost:8545 | ||
VITE_NETWORK=0x5aff | ||
VITE_WEB3_GATEWAY=https://testnet.sapphire.oasis.dev | ||
VITE_MESSAGE_BOX_ADDR=0x2dE080e97B0caE9825375D31f5D0eD5751fDf16D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
VITE_NETWORK=0x5aff | ||
VITE_WEB3_GATEWAY=https://testnet.sapphire.oasis.dev | ||
VITE_MESSAGE_BOX_ADDR=0xca5B5E9371e6AedD850a74554a53BA91D2D3508d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
import { FC } from 'react' | ||
import { Layout } from './components/Layout' | ||
import { createHashRouter, RouterProvider } from 'react-router-dom' | ||
import { HomePage } from './pages/HomePage' | ||
import { EIP1193ContextProvider } from './providers/EIP1193Provider' | ||
import { Web3ContextProvider } from './providers/Web3Provider' | ||
import { AppStateContextProvider } from './providers/AppStateProvider' | ||
import { ErrorBoundary } from './components/ErrorBoundary' | ||
import { RouterErrorBoundary } from './components/RouterErrorBoundary' | ||
|
||
const router = createHashRouter([ | ||
{ | ||
path: '/', | ||
element: <Layout />, | ||
errorElement: <RouterErrorBoundary />, | ||
children: [ | ||
{ | ||
path: '*', | ||
element: <HomePage />, | ||
}, | ||
], | ||
}, | ||
]) | ||
|
||
export const App: FC = () => { | ||
return <>Demo starter</> | ||
return ( | ||
<ErrorBoundary> | ||
<EIP1193ContextProvider> | ||
<Web3ContextProvider> | ||
<AppStateContextProvider> | ||
<RouterProvider router={router} /> | ||
</AppStateContextProvider> | ||
</Web3ContextProvider> | ||
</EIP1193ContextProvider> | ||
</ErrorBoundary> | ||
) | ||
} | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.card.card { | ||
min-height: 450px; | ||
padding: 0 4.6875rem 0; | ||
margin-bottom: 0; | ||
place-self: center; | ||
margin-top: -2.5rem; | ||
} | ||
|
||
.alert { | ||
text-align: center; | ||
|
||
h2 { | ||
color: var(--brand-blue); | ||
margin-top: 4.5rem; | ||
margin-bottom: 1.625rem; | ||
} | ||
|
||
> p { | ||
color: var(--brand-extra-dark); | ||
} | ||
|
||
.icon { | ||
margin: 2rem auto 1.6875rem; | ||
} | ||
|
||
.actions { | ||
&:empty { | ||
display: none; | ||
} | ||
|
||
span { | ||
text-align: center; | ||
color: var(--brand-extra-dark); | ||
} | ||
} | ||
|
||
.cancelIcon { | ||
fill: var(--red); | ||
} | ||
|
||
.checkIcon { | ||
fill: var(--green); | ||
} | ||
} | ||
|
||
@media screen and (max-width: 1000px) { | ||
.card.card { | ||
margin-top: 2.375rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { FC, PropsWithChildren, ReactElement } from 'react' | ||
import classes from './index.module.css' | ||
import { Card } from '../Card' | ||
import { StringUtils } from '../../utils/string.utils' | ||
import { CheckIcon } from '../icons/CheckIcon' | ||
import { CancelIcon } from '../icons/CancelIcon' | ||
|
||
type AlertType = 'error' | 'success' | ||
|
||
interface AlertTypeValues { | ||
header: string | ||
icon: ReactElement | ||
} | ||
|
||
const alertTypeValuesMap: Record<AlertType, AlertTypeValues> = { | ||
error: { | ||
header: 'Something went wrong', | ||
icon: <CancelIcon className={classes.cancelIcon} width={106} height={106} />, | ||
}, | ||
success: { | ||
header: 'Success', | ||
icon: <CheckIcon className={classes.checkIcon} width={106} height={106} />, | ||
}, | ||
} | ||
|
||
const alertTypeClassMap: Record<AlertType, string> = { | ||
error: classes.alertError, | ||
success: classes.alertSuccess, | ||
} | ||
|
||
interface Props extends PropsWithChildren { | ||
type: AlertType | ||
actions?: ReactElement | ||
headerText?: string | ||
className?: string | ||
} | ||
|
||
export const Alert: FC<Props> = ({ children, className, type, actions, headerText }) => { | ||
const { header, icon } = alertTypeValuesMap[type] | ||
|
||
return ( | ||
<Card className={StringUtils.clsx(classes.card, className, alertTypeClassMap[type])}> | ||
<div className={classes.alert}> | ||
<h2>{headerText ?? header}</h2> | ||
<p className="body">{children}</p> | ||
<div className={classes.icon}>{icon}</div> | ||
<div className={classes.actions}>{actions}</div> | ||
</div> | ||
</Card> | ||
) | ||
} |
Oops, something went wrong.