1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-02 11:30:22 +02:00

createnewmodal: change ux

This commit is contained in:
Kushagra Gour
2019-03-18 09:57:00 +05:30
parent 1b00f87002
commit 1e71020d0b
4 changed files with 213 additions and 199 deletions

View File

@@ -1,7 +1,10 @@
import { h, Component } from 'preact';
function hyphenate(text) {
return text.replace(/\s/g, '-');
if (text.replace) {
return text.replace(/\s/g, '-');
}
return '';
}
const ID_PREFIX = 'tab-panel-';
@@ -63,7 +66,7 @@ export default class Tabs extends Component {
render() {
const tabs = this.props.children;
return (
<div class="tabs">
<div class={`tabs ${this.props.horizontal ? 'tabs--horizontal' : ''}`}>
<div
class="tabs__tablist"
role="tablist"
@@ -79,8 +82,8 @@ export default class Tabs extends Component {
))}
</div>
<div class="tabs__tabpanel-wrap">
{tabs.map(
(child, index) => (this.state.selectedTab === index ? child : null)
{tabs.map((child, index) =>
this.state.selectedTab === index ? child : null
)}
</div>
</div>