Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Teo
@Teo03
Can someone take a look. I created a modal but when I click on the "Add recipe" button it shows nothing. Here is my code:
import React from 'react';
import Modal from 'react-bootstrap-modal';
import ReactDOM from 'react-dom';
export class AddRecipe extends React.Component {
    constructor(){
        super();
        this.state = {
            show: false
        }
        this.closeModal = this.closeModal.bind(this);
        this.showModal = this.showModal.bind(this);
    }
    showModal(){
        this.setState({
            show: true
        });
    }
    closeModal(){
        this.setState({
            show: false
        });
    } 
       render(){
        return (
        <div>
           <button onClick={this.showModal}>Add Recipe</button>

           <Modal show={this.state.show} onHide={this.closeModal}>
           <Modal.Header>
               <Modal.Title>Add Recipe:</Modal.Title>
           </Modal.Header>
           <Modal.Body>
               <h2>Name:</h2>
             <input />
                <hr />
           <h3>Instructions</h3>
             <textarea></textarea>
           </Modal.Body>
           <Modal.Footer>GG</Modal.Footer>
       </Modal>
        </div>
        );
    }
}
ReactDOM.render(<AddRecipe />, document.getElementById('app'));
Spacetime
@justinemar
Why are you calling the function for the modal ? do you want the modal to close once a recipe is added?
Oh nevermind, i never than this project you meant to open the modal.
Teo
@Teo03
The problem is that when I click it doesen't open
Spacetime
@justinemar
can you inspect the page and see if the modal is there ? there's some cases that it's just out of the viewport.
Teo
@Teo03
I checked it's ok
Still when I click nothing appears
Sweet Coding :)
@SweetCodingInc
@Teo03 any errors on console?
Teo
@Teo03
Only this: TypeError: Cannot read property 'createClass' of undefined
Sweet Coding :)
@SweetCodingInc
That means react is not loaded correctly
How did you create this app?
Using create-react-app?
Teo
@Teo03
No, should I send you my package.json?
Sweet Coding :)
@SweetCodingInc
share you build file instead
is it webpack?
no worries...
Teo
@Teo03
yes it's webpack
Sweet Coding :)
@SweetCodingInc
is it there on github?
Teo
@Teo03
I haven't still pushed it
I can do it now if you need
Sweet Coding :)
@SweetCodingInc
yes please
Teo
@Teo03
@SweetCodingInc Here is a link: https://github.com/Teo03/recipe_box
Sweet Coding :)
@SweetCodingInc
@Teo03 hold on
Teo
@Teo03
@SweetCodingInc Ok no problem
Sweet Coding :)
@SweetCodingInc
@Teo03 just a note.. never push your node_modules to the repo
is it okay if I fork and submit pull request?
Teo
@Teo03
@SweetCodingIn Yes of course
Ghost
@ghost~5a4a80acd73408ce4f859755
how can i align something to the center? not just the text, i mean an element
in html*
A. J. Bozdar
@moajday

@MuhammedKarim

< YourElement style = text-align: center; >  </YourElement>

The grammar is same for whatever you want to align to the center of your page.

Ghost
@ghost~5a4a80acd73408ce4f859755
thanks bro but its not working for me :( ill send it to you privately
Luc Martin
@fmartin5
@ajbozdar Your capitalize function looks correct, but it will only change the first letter of user input
And maybe you should add a check for the empty string
A. J. Bozdar
@moajday
@MuhammedKarim You can sure contact me via private messages, but if you paste your code here, someone will help you out in case I am not available.
@fmartin5 Check for the empty string? Could you please explain this more?
Luc Martin
@fmartin5
Yes because text[0] will be undefined if textis empty @ajbozdar
Example if(text == "") return "";
Sweet Coding :)
@SweetCodingInc
@Teo03 looks like there is some issue with the library itself
Ghost
@ghost~5a4a80acd73408ce4f859755
how can i center that iframe with the youtube vid?
Sweet Coding :)
@SweetCodingInc
@Teo03 jquense/react-bootstrap-modal#54 known issue with react v16 +
Ken Haduch
@khaduch
@MuhammedKarim - one way that it works is to wrap it in a div, and set a class on the div with the CSS property text-align: center;
Ghost
@ghost~5a4a80acd73408ce4f859755
just got it bro @khaduch iframe {margin:auto; display:block}
Ken Haduch
@khaduch
@MuhammedKarim :+1:
Apollo
@enigmacipher
Is there a better way to validate email other than type validation
With the type validation, I can enter apollo@gmail to submit the email. Is there a way to make entering the domain name required so I'd have to type apollo@gmail.com?
Sweet Coding :)
@SweetCodingInc
@enigmacipher regular expression
Apollo
@enigmacipher
@SweetCodingInc cool. Thanks :smile:
CamperBot
@camperbot
enigmacipher sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 229 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc