@giveth/commons-components
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -1,8 +0,13 @@ | ||
/** | ||
* Created by will on 13/04/19. | ||
*/ | ||
import React from 'react'; | ||
import React from "react"; | ||
import UserProfileNav from './UserProfileNav'; | ||
import CommonsContext from '../context/Commons'; | ||
import ViewContext from '../context/View'; | ||
import { viewActions, views } from '../state/viewState'; | ||
var givethImageUrl = process.env.PUBLIC_URL + '/images/giveth-logo.svg'; | ||
var CommonsNavHeader = function CommonsNavHeader() { | ||
var _React$useContext = React.useContext(CommonsContext), | ||
state = _React$useContext.state; | ||
var viewContext = React.useContext(ViewContext); | ||
return React.createElement("div", { | ||
@@ -13,3 +18,3 @@ className: "eco-main-navbar" | ||
}, React.createElement("img", { | ||
src: process.env.PUBLIC_URL + '/images/giveth-logo.svg' | ||
src: givethImageUrl | ||
})), React.createElement("div", { | ||
@@ -19,5 +24,19 @@ className: "commons-dropdown" | ||
className: "selected" | ||
}, "Reforestation Indonesia")), React.createElement("div", { | ||
}, state.name)), React.createElement("div", { | ||
className: "nav-content" | ||
}, React.createElement("p", null, "Campaigns"), React.createElement("p", null, "Voting"), React.createElement("p", null, "FAQ"), React.createElement("p", { | ||
}, React.createElement("p", { | ||
onClick: function onClick() { | ||
return viewContext.dispatch({ | ||
type: viewActions.changeView, | ||
view: views.createCommons | ||
}); | ||
} | ||
}, "Create Commons"), React.createElement("p", { | ||
onClick: function onClick() { | ||
return viewContext.dispatch({ | ||
type: viewActions.changeView, | ||
view: views.allCommons | ||
}); | ||
} | ||
}, "All Commons"), React.createElement("p", null, "Voting"), React.createElement("p", null, "FAQ"), React.createElement("p", { | ||
className: "support" | ||
@@ -24,0 +43,0 @@ }, "Support us")), React.createElement(UserProfileNav, null)); |
18
index.js
import { StateWrapper as CommonsStateWrapper } from './state/StateWrapper'; | ||
import CampaignHeader from './components/CampaignHeader'; | ||
import SelectedCommonsHeader from './components/SelectedCommonsHeader'; | ||
import DaiAction from './components/DaiAction'; | ||
@@ -8,17 +8,23 @@ import PrimaryButton from './stateless-components/PrimaryButton'; | ||
import UserContext, { UserProvider } from './context/User'; | ||
import ViewContext from './context/View'; | ||
import { viewActions, views } from './state/viewState'; | ||
import { userActions } from './state/userState'; | ||
import { getConviction } from './state/convictionlib'; | ||
import AugmentedCurveContext, { AugmentedCurveProvider } from './context/AugmentedCurve'; | ||
import ConvictionVotingCurveContext, { ConvictionVotingCurveProvider } from './context/ConvictionVotingCurve'; | ||
import { curveActions } from './state/augmentedCurveState'; | ||
import { cvActions } from './state/convictionVotingCurveState'; | ||
import CommonsContext from './context/Commons'; | ||
import { commonsActions, commonsViews } from './state/commonsState'; | ||
import Card from './components/Card'; | ||
import CommonsNavHeader from './components/CommonsNavHeader'; | ||
import CommonsCard from './components/CommonsCard'; | ||
export { CommonsStateWrapper }; | ||
export { CampaignHeader }; | ||
export { SelectedCommonsHeader }; | ||
export { DaiAction }; | ||
export { UserContext, UserProvider, userActions }; | ||
export { AugmentedCurveContext, AugmentedCurveProvider, curveActions }; | ||
export { CommonsContext, commonsActions, commonsViews }; | ||
export { ConvictionVotingCurveContext, ConvictionVotingCurveProvider, cvActions }; | ||
export { PrimaryButton, SecondaryButton, FormField }; | ||
export { getConviction }; | ||
export { CommonsNavHeader }; | ||
export { CommonsNavHeader }; | ||
export { Card, CommonsCard }; | ||
export { ViewContext, viewActions, views }; |
{ | ||
"name": "@giveth/commons-components", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
@@ -6,7 +6,8 @@ /** | ||
import { UserProvider } from '../context/User'; | ||
import { AugmentedCurveProvider } from '../context/AugmentedCurve'; | ||
import { CommonsProvider } from '../context/Commons'; | ||
import { ConvictionVotingCurveProvider } from '../context/ConvictionVotingCurve'; | ||
import { ViewProvider } from '../context/View'; | ||
export var StateWrapper = function StateWrapper(_ref) { | ||
var children = _ref.children; | ||
return React.createElement(UserProvider, null, React.createElement(AugmentedCurveProvider, null, React.createElement(ConvictionVotingCurveProvider, null, children))); | ||
return React.createElement(UserProvider, null, React.createElement(CommonsProvider, null, React.createElement(ConvictionVotingCurveProvider, null, React.createElement(ViewProvider, null, children)))); | ||
}; // export default StateWrapper; |
@@ -5,12 +5,16 @@ /** | ||
import React from 'react'; | ||
var daiUrl = process.env.PUBLIC_URL + '/images/dai.png'; | ||
var PrimaryButton = function PrimaryButton(_ref) { | ||
var onClick = _ref.onClick, | ||
children = _ref.children; | ||
children = _ref.children, | ||
showDai = _ref.showDai; | ||
return React.createElement("button", { | ||
className: "eco primary", | ||
onClick: onClick | ||
}, children); | ||
}, showDai && React.createElement("img", { | ||
src: daiUrl | ||
}), children); | ||
}; | ||
export default PrimaryButton; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
27614
34
587
7