File tree Expand file tree Collapse file tree 4 files changed +62
-7
lines changed
packages/uikit-workshop/src
components/pl-toggle-info Expand file tree Collapse file tree 4 files changed +62
-7
lines changed Original file line number Diff line number Diff line change 61
61
62
62
< ul class ="pl-c-tools__list pl-js-acc-panel ">
63
63
< li class ="pl-c-tools__item ">
64
- < button class ="pl-c-tools__action pl-js-pattern-info-toggle "> Show Pattern Info</ button >
65
- <!-- WIP - commenting out for now -->
66
- <!-- <pl-info-toggle></pl-info-toggle> -->
64
+ < pl-toggle-info > </ pl-toggle-info >
67
65
</ li >
68
66
< li class ="pl-c-tools__item ">
69
67
< pl-toggle-layout text ="Switch Layout "> < pl-toggle-layout >
Original file line number Diff line number Diff line change
1
+ import { define , props } from 'skatejs' ;
2
+ import { h } from 'preact' ;
3
+
4
+ import { store } from '../../store.js' ; // connect to the Redux store.
5
+ import { updateDrawerState } from '../../actions/app.js' ; // redux actions
6
+ import { BaseComponent } from '../base-component.js' ;
7
+
8
+ @define
9
+ class InfoToggle extends BaseComponent {
10
+ static is = 'pl-toggle-info' ;
11
+
12
+ constructor ( self ) {
13
+ self = super ( self ) ;
14
+ return self ;
15
+ }
16
+
17
+ static props = {
18
+ _drawerOpened : props . boolean ,
19
+ } ;
20
+
21
+ _stateChanged ( state ) {
22
+ this . _drawerOpened = state . app . drawerOpened ;
23
+ this . isViewallPage = state . app . isViewallPage ;
24
+ }
25
+
26
+ render ( { _drawerOpened, isViewallPage } ) {
27
+ return (
28
+ < button
29
+ class = "pl-c-tools__action"
30
+ onClick = { _ => store . dispatch ( updateDrawerState ( ! _drawerOpened ) ) }
31
+ >
32
+ { _drawerOpened
33
+ ? `Hide ${ isViewallPage ? 'all ' : '' } Pattern Info`
34
+ : `Show ${ isViewallPage ? 'all ' : '' } Pattern Info` }
35
+ </ button >
36
+ ) ;
37
+ }
38
+ }
39
+
40
+ export { InfoToggle } ;
Original file line number Diff line number Diff line change
1
+ @import ' ../../../sass/scss/core.scss' ;
2
+
3
+ pl-toggle-info {
4
+ display : flex ;
5
+ align-self : center ;
6
+ justify-content : center ;
7
+ align-items : center ;
8
+ z-index : 10 ;
9
+ width : 100% ;
10
+ cursor : pointer ;
11
+ }
12
+
13
+ .pl-c-toggle-info ,
14
+ .pl-c-toggle-info__action {
15
+ width : 100% ;
16
+ }
Original file line number Diff line number Diff line change 1
1
import { loadPolyfills } from './utils/polyfills' ;
2
2
3
3
loadPolyfills . then ( res => {
4
- import ( /* webpackMode: 'eager ', webpackChunkName: 'pl-layout' */ './components/pl-layout/pl-layout' ) . then (
4
+ import ( /* webpackMode: 'lazy ', webpackChunkName: 'pl-layout' */ './components/pl-layout/pl-layout' ) . then (
5
5
( ) => {
6
6
// this ensures that the old-school way the styleguide JS binds to the page isn't thrown off by the <pl-layout> component rendering -- temp workaround till the logic in styleguide.js gets broken down and refactored.
7
7
import ( /* webpackMode: 'lazy', webpackChunkName: 'pl-styleguide' */ './components/styleguide' ) ;
8
8
import ( /* webpackMode: 'lazy', webpackChunkName: 'pl-modal-viewer' */ './components/modal-viewer' ) ;
9
9
}
10
10
) ;
11
- import ( /* webpackMode: 'eager', webpackChunkName: 'pl-toggle-theme' */ './components/pl-toggle-theme/pl-toggle-theme' ) ;
12
- import ( /* webpackMode: 'eager', webpackChunkName: 'pl-toggle-layout' */ './components/pl-toggle-layout/pl-toggle-layout' ) ;
13
- import ( /* webpackMode: 'eager', webpackChunkName: 'pl-search' */ './components/pl-search/pl-search' ) ;
11
+ import ( /* webpackMode: 'lazy', webpackChunkName: 'pl-search' */ './components/pl-search/pl-search' ) ;
12
+ import ( /* webpackMode: 'lazy', webpackChunkName: 'pl-toggle-info' */ './components/pl-toggle-info/pl-toggle-info' ) ;
13
+ import ( /* webpackMode: 'lazy', webpackChunkName: 'pl-toggle-layout' */ './components/pl-toggle-layout/pl-toggle-layout' ) ;
14
+ import ( /* webpackMode: 'lazy', webpackChunkName: 'pl-toggle-theme' */ './components/pl-toggle-theme/pl-toggle-theme' ) ;
14
15
} ) ;
15
16
16
17
import './components/panels' ;
You can’t perform that action at this time.
0 commit comments