diff options
author | muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> | 2022-11-21 20:31:49 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 20:31:49 +0530 |
commit | 009813cbc40bfd186037ccb7f327225357ef34e9 (patch) | |
tree | 1fcbee64b0b10256d694ba0cf687d968ae7d8da1 /src/components/ui/Tabs/Tabs.js | |
parent | 6.2.1-nightly.48 [skip ci] (diff) | |
download | ferdium-app-009813cbc40bfd186037ccb7f327225357ef34e9.tar.gz ferdium-app-009813cbc40bfd186037ccb7f327225357ef34e9.tar.zst ferdium-app-009813cbc40bfd186037ccb7f327225357ef34e9.zip |
Fix for services self hosted url / Team Id / Include pre-releases not updating (#785)
* fix: self hosted team/url options not working properly in edit service form
* fix: Include pre-releases toggle not working
Diffstat (limited to 'src/components/ui/Tabs/Tabs.js')
-rw-r--r-- | src/components/ui/Tabs/Tabs.js | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/components/ui/Tabs/Tabs.js b/src/components/ui/Tabs/Tabs.js deleted file mode 100644 index 5d2da6293..000000000 --- a/src/components/ui/Tabs/Tabs.js +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | import { Children, Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import classnames from 'classnames'; | ||
5 | |||
6 | import { oneOrManyChildElements } from '../../../prop-types'; | ||
7 | |||
8 | class Tab extends Component { | ||
9 | constructor(props) { | ||
10 | super(props); | ||
11 | this.state = { active: this.props.active }; | ||
12 | } | ||
13 | |||
14 | static propTypes = { | ||
15 | children: oneOrManyChildElements.isRequired, | ||
16 | active: PropTypes.number, | ||
17 | }; | ||
18 | |||
19 | static defaultProps = { | ||
20 | active: 0, | ||
21 | }; | ||
22 | |||
23 | switchTab(index) { | ||
24 | this.setState({ active: index }); | ||
25 | } | ||
26 | |||
27 | render() { | ||
28 | const { children: childElements } = this.props; | ||
29 | const children = childElements.filter(c => !!c); | ||
30 | |||
31 | if (children.length === 1) { | ||
32 | return <div>{children}</div>; | ||
33 | } | ||
34 | |||
35 | return ( | ||
36 | <div className="content-tabs"> | ||
37 | <div className="content-tabs__tabs"> | ||
38 | {Children.map(children, (child, i) => ( | ||
39 | <button | ||
40 | key="{i}" | ||
41 | className={classnames({ | ||
42 | 'content-tabs__item': true, | ||
43 | 'is-active': this.state.active === i, | ||
44 | })} | ||
45 | onClick={() => this.switchTab(i)} | ||
46 | type="button" | ||
47 | > | ||
48 | {child.props.title} | ||
49 | </button> | ||
50 | ))} | ||
51 | </div> | ||
52 | <div className="content-tabs__content"> | ||
53 | {Children.map(children, (child, i) => ( | ||
54 | <div | ||
55 | key="{i}" | ||
56 | className={classnames({ | ||
57 | 'content-tabs__item': true, | ||
58 | 'is-active': this.state.active === i, | ||
59 | })} | ||
60 | type="button" | ||
61 | > | ||
62 | {child} | ||
63 | </div> | ||
64 | ))} | ||
65 | </div> | ||
66 | </div> | ||
67 | ); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | export default observer(Tab); | ||