This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #591 from hermeznetwork/develop
Develop
- Loading branch information
Showing
21 changed files
with
190 additions
and
62 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,13 @@ | ||
export const tokenSwapActionTypes = { | ||
RESET_STATE: '[TOKEN SWAP] RESET STATE' | ||
} | ||
|
||
function resetState () { | ||
return { | ||
type: tokenSwapActionTypes.RESET_STATE | ||
} | ||
} | ||
|
||
export { | ||
resetState | ||
} |
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,16 @@ | ||
import { tokenSwapActionTypes } from './token-swap.actions' | ||
|
||
const initialTokenSwapState = {} | ||
|
||
function tokenSwapReducer (state = initialTokenSwapState, action) { | ||
switch (action.type) { | ||
case tokenSwapActionTypes.RESET_STATE: { | ||
return { ...initialTokenSwapState } | ||
} | ||
default: { | ||
return state | ||
} | ||
} | ||
} | ||
|
||
export default tokenSwapReducer |
Empty file.
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
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,11 @@ | ||
import { createUseStyles } from 'react-jss' | ||
|
||
const useTokenSwapStyles = createUseStyles(() => ({ | ||
root: { | ||
width: '100%', | ||
display: 'flex', | ||
flexDirection: 'column' | ||
} | ||
})) | ||
|
||
export default useTokenSwapStyles |
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,42 @@ | ||
import { push } from 'connected-react-router' | ||
import React from 'react' | ||
import { connect } from 'react-redux' | ||
|
||
import useTokenSwapStyles from './token-swap.styles' | ||
import * as globalActions from '../../store/global/global.actions' | ||
import * as tokenSwapActions from '../../store/token-swap/token-swap.actions' | ||
import Container from '../shared/container/container.view' | ||
|
||
function TokenSwap ({ onChangeHeader, onCleanup }) { | ||
const classes = useTokenSwapStyles() | ||
|
||
React.useEffect(() => { | ||
onChangeHeader() | ||
}, []) | ||
|
||
React.useEffect(() => onCleanup, [onCleanup]) | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Container addHeaderPadding disableTopGutter> | ||
<p>It works</p> | ||
</Container> | ||
</div> | ||
) | ||
} | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
onChangeHeader: () => | ||
dispatch( | ||
globalActions.changeHeader({ | ||
type: 'page', | ||
data: { | ||
title: 'Swap', | ||
closeAction: push('/') | ||
} | ||
}) | ||
), | ||
onCleanup: () => dispatch(tokenSwapActions.resetState()) | ||
}) | ||
|
||
export default connect(null, mapDispatchToProps)(TokenSwap) |
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
Oops, something went wrong.