I have created a login component on which I have all the logic stuff.
The login reducer is:
const openState = {
loggedIn: null,
user: null
}
export default (state = openState, action) => {
switch (action.type) {
case LOGIN:
return { ...state, loggedIn: true, user: action.payload }
case LOGOUT:
return { ...state, loggedIn: false, user: null }
default:
return openState
}
}
The Action :
export const logIn = (user) => {
return {
type: LOGIN,
payload: user
}
}
export const logOut = () => {
return {
type: LOGOUT
}
}
everything is working just fine but I’m not sure how to pass the loggedIn
and user
props from action into the routes component in order to secure all routes:
const MainRoutes = props => {
const { loggedIn } = props;
console.log(props.loggedIn)
return (
<Router history={history}>
<Baseline />
<Menu/>
<Container maxWidth="md">
<Switch>
<Route exact path="/Login" component={Login} />
<Route exact path="/Carousel" component={Carousel} />
<Route exact path="/Stepper" component={Stepper} />
<Route component={NotFound} />
</Switch>
</Container>
</Router>
);
}
const mapStateToProps = (state) => {
return { loggedIn: state.loggedIn };
};
export default connect(mapStateToProps)(MainRoutes);
If I’ll console.log the loggedIn
props I get undefined 😐
Based on loggedIn
I can create a logic into the routes component.
generic provigil – order modafinil online modafinil 100mg
accutane generic – price for generic accutane accutane purchase
amoxicillin – buy amoxicillin online buy amoxicilina 500 mg online
levitra – vardenafil pills online vardenafil lastgeneric vardenafil
ivermectin us – price of ivermectin liquid stromectol buy
canadian mail order pharmacy – generic cialis in us purchase cialis for daily use
ivermectin 3mg for lice – ivermectin 3mg dosage stromectol price usa
accutane 40mg – accutane australia buy buy accutane in mexico
lyrica medicine price – lyrica 100 canadian online pharmacy cialis
buy amoxicilin 500 – amoxicillin brand over the counter amoxicillin price at walgreens
viagra online order usa – viagra online prescription where can i get female viagra pills
tadalafil 2.5 mg generic – tadalafil tablets tadalafil cost usa
ivermectin 1 – order stromectol ivermectin for sale
can i buy prednisone online in uk – prednisone 120 mg daily prednisone 60 mg
provigil cost – modapls.com modafinil generic
zithromax cost – zithromax 500mg dose buy generic zithromax 100mg
furosemide 10 mg – buy lasix without prescription furosemide 20 mg tab cost
purchase clomiphene – generic clomiphene 100mg where can i buy clomid
cheap viagra soft tabs – buy viagra online australia viagra professional cheap
online pharmacy drop shipping – cialis 50 mg cialis over the counter in usa
win real money online casino for free – playcasigam.com hollywood casino online
doxycycline 100mg capsules – cheap doxycycline tablets doxycycline brand in india
how to get neurontin cheap – neurontin 50 mg can you buy synthroid online
sildenafil online purchase in india – generic viagra soft female viagra pills australia
brand cialis online – discount generic cialis canada daily cialis canadian pharmacy
prednisone prescriptions – prednisone 8 pills prednisone drug
lasix 40 mg furosemide 20 mg tablet price nek nox
how to write an essay about my life – cheap essay help how to write an about me essay
lasix no prescription furosemide prescription nek nox
sildenafil 50mg price – site cheap viagra online usa
prednisone tablets india – can you buy prednisone without a prescription prednisone 200 mg price
cytotec over the counter australia – canadian pharmacy cytotec generic cytotec
doxycycline 20 mg cost – prednisolone buy online prednisolone sodium
cost of ivermectin cream ivermectin 3 mg tabs
stromectol oral – ivermecpillx.com stromectol order online
order stromectol – ivermectin 3mg dose ivermectin drug
sildenafil without doctor – buy generic sildenafil canada sildenafil
tadalafil cost – tadalafil liquid tadalafil 20
buy accutane nz – accutane price nz how to get accutane in mexico
cheap custom research papers – affordable dissertation writing order research paper online
where can i get viagra – site generic cialis for sale in canada
where to buy ivermectin ivermectin drug
ivermectin for cattle buy ivermectin canada
plaquenil and sun exposure – what is hydroxychloroquine 200 mg over the counter prednisone canada
go now – vilitra 40mg fildena 120mg
orlistat does it work – xenical orlistat 120mg capsules xenical medicine
sildenafil online – viagra 100mg england drugstore female viagra
tadalafil 5 mg – perscription drugs from canada cialis 2 mg
prednisone 2.5 mg – 400 mg prednisone prednisone canada prescription
ivermectin online pharmacy – stromectol oral stromectole online
900329 871467Wow What great details. Thank you for the time you spent on this post. 559666
cialis cost without insurance – cialis from india best tadalafil tablets in india
ivermectin 12mg online – purchase oral stromectol ivermectin medicine
can i buy ivermectin online – stromectol generic ivermectin 3mg pills
price of prednisone tablets – prednisone pill prednisone 15 mg tablet
prednisone 20mg buy online – prednisone 5mg tablets prednisone sale
accutane 30mg – isotretinoin for acne accutane sale uk
viagra 50mg pills for men – cialis 10mg over the counter tadalafil us
sildenafil 200mg en france – tadalafil 5mg pour homme tadalafil 20mg en ligne
viagra sans ordonnance en france – viagra 100mg kaufen cialis 10mg generique
ivermectin 12 mg oral – tadalafil generika rezeptfrei kaufen ivermectin 3 mg for sale
tadalafil online cheap cialis pills for sale
side effects of tadalafil buy tadalis
cialis tadalafil tadalafil generic
order lyrica online – oral ventolin 4mg oral zithromax 500mg
generic doxycycline 200mg – prednisolone 10mg uk order synthroid 100mcg sale
tadalafil cost walmart cialis tadalafil
where to get tadalafil https://cialisicp.com/
tetracycline 500mg ca – buy cyclobenzaprine 15mg online cheap citalopram 40mg oral
buy augmentin 375mg – trimethoprim ca buy generic trimethoprim
where to get tadalafil https://cialistrxy.com/
tadalafil cost in canada https://nextadalafil.com/
where to buy generic cialis online safely cheap cialis pills for sale
clomid 100mg pills – clomiphene online buy cetirizine 5mg oral
misoprostol uk – buy levothyroxine generic order synthroid 150mcg online
buy viagra pills – gabapentin tablets order generic neurontin 100mg
tadalafil daily online tadalafil goodrx
order diltiazem 180mg generic – diltiazem 180mg tablet acyclovir pills
tadalafil goodrx cialis without a prescription
atarax 10mg cheap – buy rosuvastatin 20mg online rosuvastatin 20mg oral
buy ezetimibe 10mg for sale – brand citalopram citalopram 40mg tablet
gloperba without prescription – gloperba usa atomoxetine cost
viagra for women – buy methotrexate 10mg without prescription clopidogrel canada
sildenafil 150mg brand – viagra 50mg ca sildenafil for sale online
order generic esomeprazole 20mg – nexium 40mg sale purchase phenergan
order tadalafil 10mg generic – Cialis for women order tadalafil without prescription
modafinil 100mg uk – buy generic provigil 200mg pills for erection
buy isotretinoin 40mg sale – buy generic accutane 40mg brand azithromycin 250mg
order lasix sale – furosemide pill sildenafil professional
order cialis 5mg sale – buy cialis 40mg pills viagra 100mg price
cialis 20mg generic – buy cozaar 50mg order warfarin 5mg pill
buy ed pills uk – prednisone 5mg drug prednisone 20mg without prescription
accutane 20mg price – cheap amoxicillin for sale cheap amoxicillin 500mg
order generic furosemide 100mg – furosemide 40mg generic zithromax 500mg brand
provigil 200mg over the counter – viagra 100mg pill sildenafil order online
online casino usa – free slots pay for assignments
sildenafil overnight delivery – brand viagra order vardenafil 10 pills
augmentin drug – purchase cialis online cheap tadalafil generic
stromectol 0.5 mg ivermectin uk 3mg 6mg 12mg
diltiazem generic – order azithromycin 500mg generic gabapentin 100mg canada
cozaar tablet – losartan 50mg ca promethazine buy online
buy levofloxacin 500mg pills – viagra 50mg price tadalafil online buy
stromectol for sale http://ivermectinuni.com/
cost zofran – zocor 20mg price buy valtrex 500mg online
fildena over the counter – buy trazodone 50mg generic sildenafil 50mg cost
male erection pills – tadalafil 5mg bestellen viagra 100mg fГјr frauen
prednisone 40mg us – order deltasone generic oral prednisolone 40mg
buy flexeril 15mg online colchicine usa clopidogrel 150mg over the counter
methotrexate 10mg price sildenafil pills 200mg metoclopramide drug
sildenafil 150mg tablet deltasone 10mg cheap prednisone 5mg over the counter
order generic isotretinoin 40mg suhagra 50mg generic order sildenafil 50mg online cheap
real cialis fast shipping oral levaquin 250mg avodart usa
purchase ranitidine generic flomax 0.2mg oral flomax 0.2mg generic
zofran 8mg tablet brand spironolactone 25mg order propecia 1mg generic
cialis tadalafil 20mg order modafinil online viagra 100mg generic
buy azithromycin 500mg online buy stromectol 12mg generic order metformin generic
buy clindamycin pills buy cleocin 150mg pill rhinocort pill