Added chat tile

This commit is contained in:
Logan Allen 2019-06-04 15:46:36 -07:00
parent 6d70237663
commit 18aa876bd8
7 changed files with 2344 additions and 10 deletions

View File

@ -40,6 +40,14 @@ gulp.task('jsx-transform', function(cb) {
.pipe(gulp.dest('dist'));
});
gulp.task('tile-jsx-transform', function(cb) {
return gulp.src('tile/**/*.js')
.pipe(sucrase({
transforms: ['jsx']
}))
.pipe(gulp.dest('dist'));
});
gulp.task('js-imports', function(cb) {
return gulp.src('dist/index.js')
.pipe(rollup({
@ -72,6 +80,35 @@ gulp.task('js-imports', function(cb) {
.on('end', cb);
});
gulp.task('tile-js-imports', function(cb) {
return gulp.src('dist/tile.js')
.pipe(rollup({
plugins: [
commonjs({
namedExports: {
'node_modules/react/index.js': [ 'Component' ],
}
}),
rootImport({
root: `${__dirname}/dist/js`,
useEntry: 'prepend',
extensions: '.js'
}),
json(),
globals(),
builtins(),
resolve()
]
}, 'umd'))
.on('error', function(e){
console.log(e);
cb();
})
.pipe(gulp.dest('./urbit/app/chat/js/'))
.on('end', cb);
});
gulp.task('js-minify', function () {
return gulp.src('./urbit/app/chat/js/index.js')
.pipe(minify())
@ -101,13 +138,15 @@ gulp.task('urbit-copy', function () {
});
gulp.task('js-bundle-dev', gulp.series('jsx-transform', 'js-imports'));
gulp.task('tile-js-bundle-dev', gulp.series('tile-jsx-transform', 'tile-js-imports'));
gulp.task('js-bundle-prod', gulp.series('jsx-transform', 'js-imports', 'js-minify', 'js-cachebust'))
gulp.task('bundle-dev',
gulp.series(
gulp.parallel(
'css-bundle',
'js-bundle-dev'
'js-bundle-dev',
'tile-js-bundle-dev'
),
'urbit-copy'
)
@ -124,7 +163,10 @@ gulp.task('bundle-prod',
);
gulp.task('default', gulp.series('bundle-dev'));
gulp.task('watch', gulp.series('default', function() {
gulp.watch('tile/**/*.js', gulp.parallel('tile-js-bundle-dev'));
gulp.watch('src/**/*.js', gulp.parallel('js-bundle-dev'));
gulp.watch('src/**/*.css', gulp.parallel('css-bundle'));

36
apps/chat/tile/tile.js Normal file
View File

@ -0,0 +1,36 @@
import React, { Component } from 'react';
import classnames from 'classnames';
export default class ChatTile extends Component {
constructor(props) {
super(props);
}
renderWrapper(child) {
return (
<div className="bg-dark-gray w-100 h-100">
{child}
</div>
);
}
render() {
return this.renderWrapper((
<a className="w-100 h-100 db" style={{
paddingTop: 68,
paddingBottom: 68,
paddingLeft: 64,
paddingRight: 64
}}
href="/~chat">
<img src="/~chat/img/Tile.png" width={106} height={98} />
</a>
));
}
}
window.chatTile = ChatTile;

View File

@ -7,6 +7,14 @@
/| /html/
/~ ~
==
/= tile-js
/^ octs
/; as-octs:mimes:html
/: /===/app/chat/js/tile
/| /js/
/~ ~
==
/= script
/^ octs
/; as-octs:mimes:html
@ -55,8 +63,17 @@
[ost.bol %peer circlespat [our.bol %hall] circlespat]
[ost.bol %connect / [~ /'~chat'] %chat]
[ost.bol %poke /chat [our.bol %hall] inboxi]
[ost.bol %poke /chat [our.bol %launch] [%noun [%chat /tile]]]
==
[~ this(sta u.old)]
:- [ost.bol %poke /chat [our.bol %launch] [%noun [%chat /tile]]]~
this(sta u.old)
::
::
::
++ peer-tile
|= wir=wire
^- (quip move _this)
[~ this]
::
:: +peer-messages: subscribe to subset of messages and updates
::
@ -417,6 +434,8 @@
?~ back-path
''
i.back-path
?: =(name 'tile')
[[ost.bol %http-response (js-response:app tile-js)]~ this]
?+ site.request-line
:_ this
[ost.bol %http-response not-found:app]~

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -17,10 +17,6 @@
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
function getCjsExportFromNamespace (n) {
return n && n.default || n;
}
/*
object-assign
(c) Sindre Sorhus
@ -45892,7 +45888,7 @@
class IconHome extends react_1 {
render() {
return (
react.createElement('img', { src: "/~chat/img/Home.png", width: 32, height: 32, __self: this, __source: {fileName: _jsxFileName, lineNumber: 6}} )
react.createElement('img', { src: "/~launch/img/Home.png", width: 32, height: 32, __self: this, __source: {fileName: _jsxFileName, lineNumber: 6}} )
);
}
}
@ -53222,8 +53218,6 @@
isBuffer: isBuffer
});
var require$$0 = getCjsExportFromNamespace(bufferEs6);
var bn = createCommonjsModule(function (module) {
(function (module, exports) {
@ -53276,7 +53270,7 @@
var Buffer;
try {
Buffer = require$$0.Buffer;
Buffer = bufferEs6.Buffer;
} catch (e) {
}

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
::
+$ poke
$% [%hall-action action:hall]
[%noun [@tas path]]
==
::
+$ state