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
Alexx Martínez
@AlexxMart
Thanks @piteto that did the trick
CamperBot
@camperbot
alexxmart sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 146 | @piteto |http://www.freecodecamp.com/piteto
Alexx Martínez
@AlexxMart
I never stopped to realize that there was a different method for jquery or JS, I always used the one I had there at first but I never had jQuery in my document before
piteto
@piteto
It can get confusing switching between the two - usually best to use one or the other :)
Julian Rios
@riosj
public void setOperands(int op1, int op2) {
       operand1 = op1;
       operand2 = op2;
    }

public void divide(int quotient, int remainder) {
        if(operand2 == 0){
           System.out.println("You cannot divide by zero!");
           return setOperands;
        }

Is there away to use a return to prompt a user to input new parameters in java? I can't figure this one out.
Pete Givens
@petegivens
@JanShah I'm using the Dialog component as a login modal. and I want the title to be a mix of text and another React component, but i can't figure out how to do it
return (
      <div>
        <RaisedButton label="Login" onClick={this.handleOpen} />
        <Dialog
          title={<CreateAccountLink />} // When I insert a component here, the title text styles are overritten
          actions={actions}
          modal={true}
          open={this.state.open}
        >
          <div style={{textAlign: 'center'}}>
            <form>
              <TextField
                hintText="Username"
                floatingLabelText="Username"
              /><br />
              <TextField
                hintText="Password"
                floatingLabelText="Password"
                type="password"
              /><br />
              <TextField
                hintText="Confirm Password"
                floatingLabelText="Confirm Password"
                type="password"
                errorText="Passwords don't match"
              /><br />
            </form>
          </div>
        </Dialog>
      </div>
    );
Jan Shah
@JanShah
whats the content of createAccountLink component? @petegivens
<Dialog
  actions={actions}
  modal={true}
  open={this.state.open}
>
  <CreateAccountLink />
 //other content
</Dialog>
have you tried this?
Pete Givens
@petegivens
const CreateAccountLink = () => (
  <span>Login or <a href="#">Create Account!</a></span>
)
No..I like the styling of the Dialog title and I'd like to preserve it
just not sure if I have to copy the styles manually or if there is some easier way
Jan Shah
@JanShah
if you want to retain the style try removing the span tag
Pete Givens
@petegivens
like this?
const CreateAccountLink = () => (
  Login or <a href="#">Create Account!</a>
)
It won't compile that way
doesn't every react component have to return a single html element?
Jan Shah
@JanShah
@petegivens sorry mate, give me sec to write some stuff out and see what comes back
Pete Givens
@petegivens
@JanShah thank you :)
CamperBot
@camperbot
petegivens sends brownie points to @janshah :sparkles: :thumbsup: :sparkles:
:cookie: 545 | @janshah |http://www.freecodecamp.com/janshah
Jan Shah
@JanShah
@petegivens I've tried, it retains the style with your original code
have you tried calling createAccountLink as a function
I've tried that and it works the same way, keeps the original style of the heading
Pete Givens
@petegivens
weird
can i do pictures in here?
Jan Shah
@JanShah
@petegivens now I get what you mean about the style changing, it takes the margins away and makes it look compact
use a div instead of span
Pete Givens
@petegivens
div doesn't work for me either :\
Jan Shah
@JanShah
image.png
@petegivens
Pete Givens
@petegivens
:[
Jan Shah
@JanShah
        const createAccountLink =()=>{
            return <div>Login or <a href="#">Create Account!</a></div>
        }
//then
         title={createAccountLink()}
@petegivens is that not right?
Pete Givens
@petegivens
ohh I didn't invoke the function
I was using it like a component
Jan Shah
@JanShah
I mentioned that earlier
Pete Givens
@petegivens
<CreateAccountLink />
hrm
Jan Shah
@JanShah
sorry, I didn't, I must have been just thinking out loud or somethin
Pete Givens
@petegivens
no you did actually
my bad
thanks for the help :)
Zara Otamias
@zotamias
Almost done with my Wikipedia Viewer project, but I would love to have any suggestions & feedback to improve https://codepen.io/zotamias/pen/KXzZyQ
especially having the search results open in a new tab, that's definitely the problem that I'm still struggling to figure out
Jan Shah
@JanShah
This message was deleted
Allister
@AlyxMoon

@zotamias Looks good so far!
Some design suggestions I would have:
1) Add some margin between the search bar and the buttons, having them touching just feels a little weird. Alternatively, put them all on the same line.
2) Make the individual search results more distinct, like say having a background/padding/border or something, so they stand out a bit more.

And about the new tab, you don't need a function for that. You're on the right idea in your HTML where you are already doing this (with the Random button), to open in a new tab an anchor elements needs an attribute target="_blank" to open in a new tab. Just add that in to the JS code where you create the entries, and you're golden!

Jan Shah
@JanShah
    $("#result").click(function(event) {
      window.open(event.target);
    });
@zotamias
Allister
@AlyxMoon
But you don't really need that. No need to write JS when good ol' hardy HTML does the trick :)
Jan Shah
@JanShah
I really like javascript