-
-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(accounts): basic accounts to react
- Loading branch information
Showing
28 changed files
with
943 additions
and
182 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* . .o8 oooo | ||
* .o8 "888 `888 | ||
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo | ||
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' | ||
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888. | ||
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b. | ||
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o | ||
* ======================================================================== | ||
* Author: Chris Brame | ||
* Updated: 2/24/19 2:46 AM | ||
* Copyright (c) 2014-2019. All rights reserved. | ||
*/ | ||
|
||
import { createAction } from 'redux-actions' | ||
import { FETCH_ACCOUNTS, SAVE_EDIT_ACCOUNT, UNLOAD_ACCOUNTS } from 'actions/types' | ||
|
||
export const fetchAccounts = createAction(FETCH_ACCOUNTS.ACTION, payload => payload, () => ({ thunk: true })) | ||
export const saveEditAccount = createAction(SAVE_EDIT_ACCOUNT.ACTION) | ||
export const unloadAccounts = createAction(UNLOAD_ACCOUNTS.ACTION, payload => payload, () => ({ thunk: true })) |
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,62 @@ | ||
/* | ||
* . .o8 oooo | ||
* .o8 "888 `888 | ||
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo | ||
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' | ||
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888. | ||
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b. | ||
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o | ||
* ======================================================================== | ||
* Author: Chris Brame | ||
* Updated: 2/24/19 2:05 AM | ||
* Copyright (c) 2014-2019. All rights reserved. | ||
*/ | ||
|
||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import $ from 'jquery' | ||
import helpers from 'lib/helpers' | ||
|
||
class MultiSelect extends React.Component { | ||
componentDidMount () { | ||
const $select = $(this.select) | ||
helpers.UI.multiSelect() | ||
|
||
if (this.props.initialSelected) { | ||
$select.multiSelect('select', this.props.initialSelected) | ||
$select.multiSelect('refresh') | ||
} | ||
} | ||
|
||
getSelected () { | ||
const $select = $(this.select) | ||
if (!$select) return [] | ||
return $select.val() | ||
} | ||
|
||
render () { | ||
const { id, items } = this.props | ||
return ( | ||
<select id={id} multiple={'multiple'} className={'multiselect'} ref={r => (this.select = r)}> | ||
{items && | ||
items.map((item, i) => { | ||
return ( | ||
<option key={i} value={item.value}> | ||
{item.text} | ||
</option> | ||
) | ||
})} | ||
</select> | ||
) | ||
} | ||
} | ||
|
||
MultiSelect.propTypes = { | ||
id: PropTypes.string, | ||
items: PropTypes.array.isRequired, | ||
initialSelected: PropTypes.array, | ||
onChange: PropTypes.func.isRequired | ||
} | ||
|
||
export default MultiSelect |
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,40 @@ | ||
/* | ||
* . .o8 oooo | ||
* .o8 "888 `888 | ||
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo | ||
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' | ||
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888. | ||
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b. | ||
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o | ||
* ======================================================================== | ||
* Author: Chris Brame | ||
* Updated: 2/22/19 11:40 PM | ||
* Copyright (c) 2014-2019. All rights reserved. | ||
*/ | ||
|
||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import helpers from 'lib/helpers' | ||
|
||
class PageContent extends React.Component { | ||
componentDidMount () { | ||
helpers.resizeFullHeight() | ||
helpers.setupScrollers() | ||
} | ||
|
||
render () { | ||
return ( | ||
<div id={this.props.id} className={'page-content no-border-top full-height scrollable p-25'}> | ||
<div className={'pb-100'}>{this.props.children}</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
PageContent.propTypes = { | ||
id: PropTypes.string, | ||
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired | ||
} | ||
|
||
export default PageContent |
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 @@ | ||
/* | ||
* . .o8 oooo | ||
* .o8 "888 `888 | ||
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo | ||
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' | ||
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888. | ||
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b. | ||
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o | ||
* ======================================================================== | ||
* Author: Chris Brame | ||
* Updated: 2/22/19 11:32 PM | ||
* Copyright (c) 2014-2019. All rights reserved. | ||
*/ | ||
|
||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
class PageTitle extends React.Component { | ||
render () { | ||
const { title, rightComponent, shadow } = this.props | ||
return ( | ||
<div className={'nopadding'}> | ||
<div className={'uk-width-1-1 page-title dt-borderBottom pl-25 uk-clearfix' + (!shadow ? ' noshadow' : '')}> | ||
<p className={'uk-float-left'}>{title}</p> | ||
<div className={'uk-float-right uk-clearfix uk-width-1-2'}>{rightComponent}</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
PageTitle.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
shadow: PropTypes.bool, | ||
rightComponent: PropTypes.element | ||
} | ||
|
||
PageTitle.defaultProps = { | ||
shadow: false | ||
} | ||
|
||
export default PageTitle |
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,56 @@ | ||
/* | ||
* . .o8 oooo | ||
* .o8 "888 `888 | ||
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo | ||
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' | ||
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888. | ||
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b. | ||
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o | ||
* ======================================================================== | ||
* Author: Chris Brame | ||
* Updated: 2/22/19 11:19 PM | ||
* Copyright (c) 2014-2019. All rights reserved. | ||
*/ | ||
|
||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import DropdownTrigger from 'components/Drowdown/DropdownTrigger' | ||
import Dropdown from 'components/Drowdown' | ||
|
||
class TruCard extends React.Component { | ||
render () { | ||
return ( | ||
<div className={'tru-card-wrapper'}> | ||
<div className={'tru-card tru-card-hover'}> | ||
<div className={'tru-card-head ' + (this.props.extraHeadClass || '')}> | ||
{this.props.menu && ( | ||
<div className={'tru-card-head-menu'}> | ||
<DropdownTrigger pos={'bottom-right'} mode={'click'}> | ||
<i className='material-icons tru-icon'>more_vert</i> | ||
<Dropdown small={true}> | ||
{this.props.menu.map(child => { | ||
return child | ||
})} | ||
</Dropdown> | ||
</DropdownTrigger> | ||
</div> | ||
)} | ||
{/* HEADER TEXT */} | ||
<div className={'uk-text-center'}>{this.props.header}</div> | ||
</div> | ||
{/* Tru Card Content */} | ||
<div className={'tru-card-content'}>{this.props.content}</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
TruCard.propTypes = { | ||
menu: PropTypes.arrayOf(PropTypes.element), | ||
header: PropTypes.element.isRequired, | ||
extraHeadClass: PropTypes.string, | ||
content: PropTypes.element.isRequired | ||
} | ||
|
||
export default TruCard |
Oops, something went wrong.