Skip to content

Commit 34356db

Browse files
committed
Icon modal ++
1 parent d9ee005 commit 34356db

30 files changed

+830
-198
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
3+
export default class extends Controller {
4+
5+
static targets = [ "count" ]
6+
7+
initialize() {
8+
// const icons = (localStorage.getItem('icon-set') ?? '').split(',');
9+
// this.iconSet = new Set(icons);
10+
console.log('sdf');
11+
}
12+
13+
connect() {
14+
console.log('connect');
15+
if (this.countTarget) {
16+
this.countTarget.textContent = Math.round(Math.random() * 10);
17+
}
18+
}
19+
20+
disconnect() {
21+
console.log('disconnect');
22+
}
23+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
import { getComponent } from '@symfony/ux-live-component';
3+
4+
export default class extends Controller {
5+
6+
async initialize() {
7+
this.component = await getComponent(this.element);
8+
9+
this.component.on('render:finished', (component) => {
10+
// do something after the component re-renders
11+
console.log('render:finished');
12+
13+
this.element.showModal();
14+
15+
});
16+
}
17+
18+
close() {
19+
this.element.close();
20+
}
21+
22+
connect() {
23+
24+
// e.g. set some live property called "mode" on your component
25+
// this.component.set('mode', 'editing');
26+
// then, trigger a re-render to get the fresh HTML
27+
//this.component.render();
28+
29+
// this.element.showModal();
30+
31+
// this.component.on('render:finished', (component) => {
32+
// // do something after the component re-renders
33+
// console.log('render:finished');
34+
// });
35+
36+
}
37+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
3+
export default class extends Controller {
4+
5+
connect() {
6+
document.body.dataset.iconSize = localStorage.getItem('icon-size') === 'large' ? 'large' : 'small';
7+
}
8+
9+
large() {
10+
document.body.dataset.iconSize = 'large';
11+
localStorage.setItem('icon-size', 'large');
12+
}
13+
14+
small() {
15+
document.body.dataset.iconSize = 'small';
16+
localStorage.setItem('icon-size', 'small');
17+
}
18+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

ux.symfony.com/assets/styles/app.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
@import "components/Icon";
7171
@import "components/IconGrid";
7272
@import "components/IconCard";
73+
@import "components/IconModal";
7374
@import "components/IconSearch";
7475
@import "components/IconSetCard";
7576
@import "components/PackageHeader";
@@ -106,10 +107,10 @@
106107
left: 0;
107108
width: 100%;
108109
color: rgb(156 163 175);
109-
background-color: rgb(55 65 81);
110+
background-color: rgb(9, 10, 11);
110111
}
111112
.btn-expand-code:hover, .btn-expand-code:active {
112-
background-color: rgb(55 65 81) !important;
113+
background-color: rgb(9, 10, 11) !important;
113114
color: #fff !important;
114115
}
115116
.code-description a {

0 commit comments

Comments
 (0)