-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from texx00/alpha
Merging most recent alpha branch changes into master branch
- Loading branch information
Showing
51 changed files
with
1,362 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,46 @@ | ||
import { Component } from 'react'; | ||
import { Button } from 'react-bootstrap'; | ||
import { Button, OverlayTrigger, Tooltip } from 'react-bootstrap'; | ||
|
||
import "../App.scss"; | ||
|
||
class IconButton extends Component{ | ||
|
||
render(){ | ||
renderButton(){ | ||
let iconProps = this.props.iconLarge === "true" ? {width: "32", height: "32"} : {}; | ||
iconProps = this.props.iconMedium === "true" ? {width: "20", height: "20"} : iconProps; | ||
|
||
let iconExtraClass = this.props.iconLarge === "true" ? "m-2" : ""; | ||
let icon = this.props.icon !== undefined ? <this.props.icon className={"icon "+iconExtraClass} {...iconProps}/> : ""; | ||
if (this.props.children === undefined || this.props.children === "") | ||
iconExtraClass = "no-margin"; | ||
let icon = this.props.icon !== undefined ? <this.props.icon className={iconExtraClass+" icon"} {...iconProps}/> : ""; | ||
let text = this.props.children !== undefined ? <span className="align-self-center">{this.props.children}</span> : undefined; | ||
return <Button className={this.props.className} onClick={(evt) => {if (this.props.onClick !== undefined) this.props.onClick(evt);}}> | ||
if (this.props.children !== undefined && this.props.children !== "") | ||
return <Button className={this.props.className} onClick={(evt) => {if (this.props.onClick !== undefined) this.props.onClick(evt);}}> | ||
<div className="d-flex"> | ||
{icon} | ||
{text} | ||
</div> | ||
</Button> | ||
else return <Button className={this.props.className} onClick={(evt) => {if (this.props.onClick !== undefined) this.props.onClick(evt);}}> | ||
<div className="d-flex"> | ||
{icon} | ||
{text} | ||
</div> | ||
</Button> | ||
} | ||
|
||
render(){ | ||
if (this.props.tip !== undefined && this.props.tip !== "") | ||
return <OverlayTrigger overlay={ | ||
<Tooltip> | ||
{this.props.tip} | ||
</Tooltip>} | ||
delay={{ show: 3000, hide: 250 }} | ||
placement="bottom"> | ||
{this.renderButton()} | ||
</OverlayTrigger> | ||
else return this.renderButton(); | ||
} | ||
|
||
} | ||
|
||
export default IconButton; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.