Skip to content

Commit 8115520

Browse files
Ability to preview and publish media (#191)
1 parent 5c0014e commit 8115520

File tree

5 files changed

+41
-37
lines changed

5 files changed

+41
-37
lines changed

blocks/da-view/da-view.css

-1
This file was deleted.

blocks/da-view/da-view.js

-36
This file was deleted.
File renamed without changes.

blocks/media/da-media.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { LitElement, html } from '../../deps/lit/lit-core.min.js';
2+
import { getNx } from '../../../scripts/utils.js';
3+
4+
// Styles
5+
const { default: getStyle } = await import(`${getNx()}/utils/styles.js`);
6+
const STYLE = await getStyle(import.meta.url);
7+
8+
class DaMedia extends LitElement {
9+
static properties = {};
10+
11+
connectedCallback() {
12+
super.connectedCallback();
13+
this.shadowRoot.adoptedStyleSheets = [STYLE];
14+
document.title = `View ${this.details.name} - Dark Alley`;
15+
}
16+
17+
render() {
18+
return html`
19+
<div class="da-content">
20+
<img src="${this.details.contentUrl}" width="900" height="600" />
21+
</div>
22+
`;
23+
}
24+
}
25+
26+
customElements.define('da-media', DaMedia);

blocks/media/media.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import getPathDetails from '../shared/pathDetails.js';
2+
3+
import '../edit/da-title/da-title.js';
4+
import './da-media.js';
5+
6+
export default function init(el) {
7+
const details = getPathDetails();
8+
9+
const daTitle = document.createElement('da-title');
10+
const daMedia = document.createElement('da-media');
11+
12+
daTitle.details = details;
13+
daMedia.details = details;
14+
el.append(daTitle, daMedia);
15+
}

0 commit comments

Comments
 (0)