not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. import React, { Component } from 'react';
  2. import App from '../App'
  3. export default class activeButton extends Component {
  4. render(){
  5. switch (this.props.type) {
  6. case 'register':
  7. if(this.props.input != ''){
  8. return(
  9. <button className="button__top">Let's play!</button>
  10. )
  11. } else {
  12. return(
  13. <button className="button__top" disabled>Enter a nickname to play.</button>
  14. )
  15. }
  16. case 'createRoom':
  17. if(this.props.capacityInput !== '' && this.props.capacityInput <= 25 && this.props.capacityInput>=2 && this.props.capacityInput.length <= 2){
  18. return(
  19. <button>Create Room</button>
  20. )
  21. } else {
  22. return(
  23. <button disabled>Enter password (optional) and capacity to create a room.</button>
  24. )
  25. }
  26. case 'inputWord':
  27. if(this.props.input != '' && this.props.input <= 20){
  28. return(
  29. <button>Submit my answer!</button>
  30. )
  31. } else {
  32. return(
  33. <button disabled>Enter a term!</button>
  34. )
  35. }
  36. }
  37. }
  38. }