-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* comrpessFullOrderERC20 function setup * compressFullORderERC20 file * makeOtcStore Zustand file, appError types * SignedOrderScreen component * ReviewScreen template * fix zustand store in SwapWidget and ReviewScreen * convertToUnixTimestamp function
- Loading branch information
1 parent
e98301b
commit 4bb92df
Showing
27 changed files
with
1,931 additions
and
181 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
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
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
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
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
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,27 @@ | ||
import styled from 'styled-components'; | ||
|
||
type SwapButtonProps = { | ||
label: string; | ||
onClick: () => void; | ||
}; | ||
|
||
const StyledSwapButton = styled.button` | ||
display: flex; | ||
color: white; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
background: #2c70ff; | ||
text-transform: uppercase; | ||
border-radius: 2px; | ||
border: none; | ||
&:hover { | ||
background-color: #0c5cff; | ||
border: solid 1px #3779f7; | ||
} | ||
`; | ||
|
||
export const SwapButton = ({ label, onClick }: SwapButtonProps) => { | ||
return <StyledSwapButton onClick={onClick}>{label}</StyledSwapButton>; | ||
}; |
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
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
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,32 @@ | ||
import type { AppError } from 'src/types/AppError'; | ||
import { AppErrorType } from 'src/types/AppError'; | ||
|
||
// eslint-disable-next-line id-length | ||
export const isAppError = (x: any): x is AppError => { | ||
return ( | ||
typeof x === 'object' && | ||
x !== null && | ||
'type' in x && | ||
Object.values(AppErrorType).includes(x.type) | ||
); | ||
}; | ||
|
||
/** | ||
* Transforms the given arguments into an `AppError` object. | ||
* | ||
* @param type - The type of the error, based on `AppErrorType`. | ||
* @param error - An optional underlying error (e.g., `RpcError`, `EthersProjectError`). | ||
* @param argument - An optional string argument providing additional context for the error. | ||
* @returns An `AppError` object containing the provided details. | ||
*/ | ||
export function transformToAppError( | ||
type: AppErrorType, | ||
error?: AppError['error'], | ||
argument?: string, | ||
): AppError { | ||
return { | ||
...(argument !== undefined && { argument }), | ||
...(error !== undefined && { error }), | ||
type, | ||
}; | ||
} |
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
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,71 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
flex: 1; | ||
margin-top: 7.6rem; | ||
margin-bottom: 7.6rem; | ||
${({ theme }) => theme.mediaQueries.small} { | ||
padding-left: 2.4rem; | ||
padding-right: 2.4rem; | ||
margin-top: 2rem; | ||
margin-bottom: 2rem; | ||
width: auto; | ||
} | ||
`; | ||
|
||
export const Heading = styled.h1` | ||
margin-top: 0; | ||
margin-bottom: 2.4rem; | ||
text-align: center; | ||
`; | ||
|
||
export const CardContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
max-width: 64.8rem; | ||
width: 100%; | ||
height: 100%; | ||
margin-top: 1.5rem; | ||
`; | ||
|
||
export const Notice = styled.div` | ||
background-color: ${({ theme }) => theme.colors.background?.alternative}; | ||
border: 1px solid ${({ theme }) => theme.colors.border?.default}; | ||
color: ${({ theme }) => theme.colors.text?.alternative}; | ||
border-radius: ${({ theme }) => theme.radii.default}; | ||
padding: 2.4rem; | ||
margin-top: 2.4rem; | ||
max-width: 60rem; | ||
width: 100%; | ||
& > * { | ||
margin: 0; | ||
} | ||
${({ theme }) => theme.mediaQueries.small} { | ||
margin-top: 1.2rem; | ||
padding: 1.6rem; | ||
} | ||
`; | ||
|
||
export const ErrorMessage = styled.div` | ||
background-color: ${({ theme }) => theme.colors.error?.muted}; | ||
border: 1px solid ${({ theme }) => theme.colors.error?.default}; | ||
color: ${({ theme }) => theme.colors.error?.alternative}; | ||
border-radius: ${({ theme }) => theme.radii.default}; | ||
padding: 2.4rem; | ||
margin-bottom: 2.4rem; | ||
margin-top: 2.4rem; | ||
max-width: 60rem; | ||
width: 100%; | ||
${({ theme }) => theme.mediaQueries.small} { | ||
padding: 1.6rem; | ||
margin-bottom: 1.2rem; | ||
margin-top: 1.2rem; | ||
max-width: 100%; | ||
} | ||
`; |
Oops, something went wrong.