mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 01:08:54 +03:00
Updated all the apps except publish
This commit is contained in:
parent
39a4fe1b0a
commit
468920c87f
@ -3,7 +3,6 @@ p, h1, h2, h3, h4, h5, h6, a, input, textarea, button {
|
||||
margin-block-start: unset;
|
||||
-webkit-margin-before: unset;
|
||||
-webkit-margin-after: unset;
|
||||
|
||||
font-family: Inter, sans-serif;
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,13 @@ export class ChatScreen extends Component {
|
||||
scrollLocked: false,
|
||||
};
|
||||
|
||||
this.messageLength = 0;
|
||||
this.hasAskedForMessages = false;
|
||||
this.topMessage = {};
|
||||
this.buildMessage = this.buildMessage.bind(this);
|
||||
this.onScroll = this.onScroll.bind(this);
|
||||
|
||||
this.scrollClosure = false;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@ -37,31 +40,26 @@ export class ChatScreen extends Component {
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { props } = this;
|
||||
|
||||
if (prevProps.messages.length < props.messages.length - 300) {
|
||||
this.hasAskedForMessages = false;
|
||||
this.forceUpdate();
|
||||
this.topMessage = {};
|
||||
} else if (prevProps.match.params.ship !== props.match.params.ship ||
|
||||
if (prevProps.match.params.ship !== props.match.params.ship ||
|
||||
prevProps.match.params.station !== props.match.params.station
|
||||
) {
|
||||
console.log('switched circle');
|
||||
this.hasAskedForMessages = false;
|
||||
this.scrollClosure = false;
|
||||
this.topMessage = {};
|
||||
|
||||
this.setState({
|
||||
station: props.match.params.ship + "/" + props.match.params.station,
|
||||
circle: props.match.params.station,
|
||||
host: props.match.params.ship,
|
||||
numPeople: 0,
|
||||
scrollLocked: false
|
||||
}, () => {
|
||||
this.updateReadNumber();
|
||||
this.updateNumPeople();
|
||||
this.scrollToBottom();
|
||||
});
|
||||
|
||||
this.hasAskedForMessages = false;
|
||||
this.topMessage = {};
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
this.updateReadNumber();
|
||||
this.updateNumPeople();
|
||||
this.updateNumMessagesLoaded(prevProps, prevState);
|
||||
this.scrollToBottom();
|
||||
}
|
||||
|
||||
askForMessages() {
|
||||
@ -114,18 +112,27 @@ export class ChatScreen extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
updateReadNumber() {
|
||||
const { props, state } = this;
|
||||
|
||||
let messages = props.messages[state.station] || [];
|
||||
let config = props.configs[state.station] || false;
|
||||
|
||||
let internalCircle = 'hall-internal-' + state.circle;
|
||||
let internalStation = `~${window.ship}/${internalCircle}`;
|
||||
|
||||
let internalConfig = props.configs[internalStation] || false;
|
||||
let regularConfig = props.configs[state.station] || false;
|
||||
|
||||
let config = internalConfig || regularConfig;
|
||||
let messages = props.messages;
|
||||
|
||||
let lastMsgNum = (messages.length > 0) ?
|
||||
messages[messages.length - 1].num : 0;
|
||||
|
||||
if (config && config.red < lastMsgNum) {
|
||||
props.api.read(state.circle, lastMsgNum);
|
||||
if (internalConfig) {
|
||||
props.api.read(internalCircle, lastMsgNum);
|
||||
} else {
|
||||
props.api.read(state.circle, lastMsgNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,17 +145,6 @@ export class ChatScreen extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
updateNumMessagesLoaded(prevProps, prevState) {
|
||||
let station = prevProps.messages[this.state.station] || [];
|
||||
let numMessages = station.length;
|
||||
|
||||
if (numMessages > prevState.numMessages) {
|
||||
this.setState({
|
||||
numMessages: numMessages
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
buildMessage(msg, index) {
|
||||
let details = msg.printship ? null : getMessageContent(msg.gam);
|
||||
|
||||
@ -184,8 +180,20 @@ export class ChatScreen extends Component {
|
||||
render() {
|
||||
const { props, state } = this;
|
||||
|
||||
let messages = props.messages;
|
||||
if (props.messages.length !== this.messageLength && !this.scrollClosure) {
|
||||
this.scrollClosure = true;
|
||||
setTimeout(() => {
|
||||
this.scrollToBottom();
|
||||
this.updateReadNumber();
|
||||
this.scrollClosure = null;
|
||||
}, 200);
|
||||
}
|
||||
this.messageLength = props.messages.length;
|
||||
|
||||
let lastMsgNum = (messages.length > 0) ?
|
||||
messages[messages.length - 1].num : 0;
|
||||
|
||||
let messages = props.messages.slice(0);
|
||||
if (messages.length > 50 * state.numPages) {
|
||||
messages = messages
|
||||
.slice(messages.length - (50 * state.numPages), messages.length);
|
||||
@ -212,7 +220,7 @@ export class ChatScreen extends Component {
|
||||
</div>
|
||||
<ChatInput
|
||||
api={props.api}
|
||||
configs={props.configs}
|
||||
numMsgs={lastMsgNum}
|
||||
station={state.station}
|
||||
circle={state.circle}
|
||||
placeholder='Message...' />
|
||||
|
@ -20,8 +20,6 @@ export class ChatInput extends Component {
|
||||
let wen = Date.now();
|
||||
let aut = window.ship;
|
||||
|
||||
let config = props.configs[props.station];
|
||||
|
||||
aud = [props.station];
|
||||
sep = {
|
||||
lin: {
|
||||
@ -113,8 +111,6 @@ export class ChatInput extends Component {
|
||||
let uid = uuid();
|
||||
let aut = window.ship;
|
||||
|
||||
let config = this.props.configs[this.props.station];
|
||||
|
||||
aud = [this.props.station];
|
||||
if (isUrl(this.state.message)) {
|
||||
sep = {
|
||||
@ -134,20 +130,25 @@ export class ChatInput extends Component {
|
||||
aut,
|
||||
wen,
|
||||
aud,
|
||||
sep,
|
||||
sep
|
||||
};
|
||||
|
||||
let readNom = this.props.circle;
|
||||
if (this.props.host !== `~${window.ship}`) {
|
||||
readNom = 'hall-internal-' + this.props.circle;
|
||||
}
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: [
|
||||
{
|
||||
read: {
|
||||
nom: this.props.circle,
|
||||
red: config.red + 1
|
||||
nom: readNom,
|
||||
red: this.props.numMsgs + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
convey: [message],
|
||||
convey: [message]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -172,7 +173,9 @@ export class ChatInput extends Component {
|
||||
ref={this.textareaRef}
|
||||
placeholder={props.placeholder}
|
||||
value={state.message}
|
||||
onChange={this.messageChange} />
|
||||
onChange={this.messageChange}
|
||||
autoFocus={true}
|
||||
/>
|
||||
<div className="pointer" onClick={this.messageSubmit}>
|
||||
<IconSend />
|
||||
</div>
|
||||
|
@ -29,39 +29,63 @@ export class SidebarInvite extends Component {
|
||||
updateInvite(uid, cir, resp) {
|
||||
let tagstring = resp ? "Accept" : "Reject";
|
||||
|
||||
console.log(this.props.config);
|
||||
let circleName = cir.split('/')[1];
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: [{
|
||||
let lis = [];
|
||||
|
||||
if (resp) {
|
||||
lis = [
|
||||
{
|
||||
create: {
|
||||
nom: 'hall-internal-' + circleName,
|
||||
des: "chatroom",
|
||||
sec: "channel"
|
||||
}
|
||||
},
|
||||
{
|
||||
source: {
|
||||
nom: "inbox",
|
||||
sub: resp,
|
||||
sub: true,
|
||||
srs: [cir]
|
||||
}
|
||||
},
|
||||
{
|
||||
phrase: {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
source: {
|
||||
nom: "inbox",
|
||||
sub: true,
|
||||
srs: [`~${window.ship}/hall-internal-${circleName}`]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: lis.concat([
|
||||
{
|
||||
phrase: {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
read: {
|
||||
nom: 'i',
|
||||
red: this.props.config.red + 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
read: {
|
||||
nom: 'i',
|
||||
red: this.props.config.red + 2
|
||||
}
|
||||
}]
|
||||
])
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -59,8 +59,14 @@ export class Root extends Component {
|
||||
|
||||
let unreads = {};
|
||||
circles.forEach((cir) => {
|
||||
if (cir in messagePreviews && !!messagePreviews[cir]) {
|
||||
unreads[cir] = state.configs[cir].red < messagePreviews[cir].num;
|
||||
if (cir in messages) {
|
||||
if (messages[cir].length === 0) {
|
||||
unreads[cir] = false;
|
||||
} else {
|
||||
unreads[cir] =
|
||||
state.configs[cir].red <
|
||||
messages[cir][messages[cir].length - 1].num;
|
||||
}
|
||||
} else {
|
||||
unreads[cir] = false;
|
||||
}
|
||||
|
@ -18,32 +18,44 @@ export class Sidebar extends Component {
|
||||
const { props } = this;
|
||||
let station = props.match.params.ship + '/' + props.match.params.station;
|
||||
|
||||
let sidebarItems = props.circles.map((cir) => {
|
||||
let msg = props.messagePreviews[cir];
|
||||
let parsed = !!msg ? getMessageContent(msg.gam) : {
|
||||
content: 'No messages yet'
|
||||
};
|
||||
let aut = !!msg ? msg.gam.aut : '';
|
||||
let wen = !!msg ? msg.gam.wen : 0;
|
||||
let datetime =
|
||||
!!msg ?
|
||||
moment.unix(wen / 1000).from(moment.utc())
|
||||
: '';
|
||||
return {
|
||||
msg,
|
||||
datetime,
|
||||
wen,
|
||||
aut,
|
||||
parsed,
|
||||
cir,
|
||||
title: cir.split('/')[1],
|
||||
selected: station === cir
|
||||
};
|
||||
})
|
||||
let sidebarItems = props.circles
|
||||
.filter((cir) => {
|
||||
return !cir.includes('hall-internal-');
|
||||
})
|
||||
.map((cir) => {
|
||||
let msg = props.messagePreviews[cir];
|
||||
let parsed = !!msg ? getMessageContent(msg.gam) : {
|
||||
content: 'No messages yet'
|
||||
};
|
||||
let aut = !!msg ? msg.gam.aut : '';
|
||||
let wen = !!msg ? msg.gam.wen : 0;
|
||||
let datetime =
|
||||
!!msg ?
|
||||
moment.unix(wen / 1000).from(moment.utc())
|
||||
: '';
|
||||
return {
|
||||
msg,
|
||||
datetime,
|
||||
wen,
|
||||
aut,
|
||||
parsed,
|
||||
cir,
|
||||
title: cir.split('/')[1],
|
||||
selected: station === cir
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
return b.wen - a.wen;
|
||||
})
|
||||
.map((obj) => {
|
||||
let host = `~${window.ship}`;
|
||||
let circle = obj.cir.split('/')[1];
|
||||
|
||||
let unread = props.unreads[obj.cir];
|
||||
if (host + '/hall-internal-' + circle in props.unreads) {
|
||||
unread = props.unreads[host + '/hall-internal-' + circle];
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarItem
|
||||
key={obj.cir}
|
||||
@ -53,7 +65,7 @@ export class Sidebar extends Component {
|
||||
datetime={obj.datetime}
|
||||
ship={obj.aut}
|
||||
selected={obj.selected}
|
||||
unread={props.unreads[obj.cir]}
|
||||
unread={unread}
|
||||
history={props.history}
|
||||
/>
|
||||
);
|
||||
|
@ -6,11 +6,8 @@ import { UpdateReducer } from '/reducers/update';
|
||||
|
||||
class Store {
|
||||
constructor() {
|
||||
//let state = localStorage.getItem('store');
|
||||
|
||||
this.start = performance.now();
|
||||
|
||||
//if (!state) {
|
||||
this.state = {
|
||||
inbox: {},
|
||||
messages: {},
|
||||
@ -19,10 +16,6 @@ class Store {
|
||||
peers: {},
|
||||
local: false
|
||||
};
|
||||
/* } else {
|
||||
this.state = JSON.parse(state);
|
||||
this.state.local = true;
|
||||
}*/
|
||||
|
||||
this.initialReducer = new InitialReducer();
|
||||
this.configReducer = new ConfigReducer();
|
||||
@ -36,8 +29,6 @@ class Store {
|
||||
|
||||
handleEvent(data) {
|
||||
let json = data.data;
|
||||
console.log(data);
|
||||
console.log(json);
|
||||
|
||||
this.initialReducer.reduce(json, this.state);
|
||||
this.configReducer.reduce(json, this.state);
|
||||
@ -47,8 +38,6 @@ class Store {
|
||||
|
||||
this.end = performance.now();
|
||||
console.log('performance.now(): ', this.end - this.start);
|
||||
|
||||
//localStorage.setItem('store', JSON.stringify(this.state));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,17 +18,6 @@ export class Subscription {
|
||||
api.bind('/primary', 'PUT', api.authTokens.ship, 'chat',
|
||||
this.handleEvent.bind(this),
|
||||
this.handleError.bind(this));
|
||||
|
||||
/*window.addEventListener('beforeunload', (event) => {
|
||||
// Cancel the event as stated by the standard.
|
||||
event.preventDefault();
|
||||
// Chrome requires returnValue to be set.
|
||||
event.returnValue = '';
|
||||
|
||||
if (window.subscriptionId) {
|
||||
window.urb.unsubscribe(window.subscriptionId);
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
fetchMessages(circle, start, end) {
|
||||
@ -48,7 +37,7 @@ export class Subscription {
|
||||
|
||||
handleError(err) {
|
||||
console.error(err);
|
||||
api.bind('/', "PUT", api.authTokens.ship, 'chat',
|
||||
api.bind('/primary', "PUT", api.authTokens.ship, 'chat',
|
||||
this.handleEvent.bind(this),
|
||||
this.handleError.bind(this));
|
||||
}
|
||||
|
@ -42,30 +42,38 @@ export default class ChatTile extends Component {
|
||||
|
||||
state.numbers.forEach((num) => {
|
||||
numbers[num.circle] = num.length;
|
||||
if (num.circle === inviteCircle) {
|
||||
inviteNum = inviteNum + num.length;
|
||||
} else {
|
||||
msgNum = msgNum + num.length;
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(state.configs).forEach((key) => {
|
||||
let con = state.configs[key];
|
||||
|
||||
if (key in numbers) {
|
||||
console.log(key, con.red, numbers[key]);
|
||||
if (key === inviteCircle) {
|
||||
if (con.red < numbers[key]) {
|
||||
inviteNum = msgNum + numbers[key] - con.red;
|
||||
}
|
||||
} else {
|
||||
if (con.red < numbers[key]) {
|
||||
msgNum = msgNum + numbers[key] - con.red;
|
||||
}
|
||||
}
|
||||
let host = key.split('/')[0];
|
||||
if (host !== `~${window.ship}`) { return; }
|
||||
if (!state.configs[key]) { return; }
|
||||
let red = state.configs[key].red;
|
||||
if (key === inviteCircle) {
|
||||
inviteNum = inviteNum - red;
|
||||
} else {
|
||||
msgNum = msgNum - red;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (inviteNum === -1) {
|
||||
inviteNum = 0;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="w-100 h-100 relative" style={{ background: '#1a1a1a' }}>
|
||||
<a className="w-100 h-100 db pa2 no-underline" href="/~chat">
|
||||
<p className="gray">Chat</p>
|
||||
<p className="gray" style={{
|
||||
fontWeight: 'bold',
|
||||
fontSize: 14,
|
||||
lineHeight: '24px'
|
||||
}}>Chat</p>
|
||||
<img
|
||||
className="absolute"
|
||||
style={{ left: 68, top: 65 }}
|
||||
|
@ -76,7 +76,10 @@
|
||||
%+ turn ~(tap by messages.str)
|
||||
|= [cir=circle:hall lis=(list envelope:hall)]
|
||||
^- [circle:hall @ud]
|
||||
[cir (lent lis)]
|
||||
?~ lis
|
||||
[cir 0]
|
||||
=/ last (snag (dec (lent lis)) `(list envelope:hall)`lis)
|
||||
[cir num.last]
|
||||
=/ maptjson *(map @t json)
|
||||
=. maptjson
|
||||
(~(put by maptjson) 'config' (config-to-json str))
|
||||
|
@ -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
|
||||
@ -45862,11 +45858,8 @@
|
||||
|
||||
class Store {
|
||||
constructor() {
|
||||
//let state = localStorage.getItem('store');
|
||||
|
||||
this.start = performance.now();
|
||||
|
||||
//if (!state) {
|
||||
this.state = {
|
||||
inbox: {},
|
||||
messages: {},
|
||||
@ -45875,10 +45868,6 @@
|
||||
peers: {},
|
||||
local: false
|
||||
};
|
||||
/* } else {
|
||||
this.state = JSON.parse(state);
|
||||
this.state.local = true;
|
||||
}*/
|
||||
|
||||
this.initialReducer = new InitialReducer();
|
||||
this.configReducer = new ConfigReducer();
|
||||
@ -45892,8 +45881,6 @@
|
||||
|
||||
handleEvent(data) {
|
||||
let json = data.data;
|
||||
console.log(data);
|
||||
console.log(json);
|
||||
|
||||
this.initialReducer.reduce(json, this.state);
|
||||
this.configReducer.reduce(json, this.state);
|
||||
@ -45903,8 +45890,6 @@
|
||||
|
||||
this.end = performance.now();
|
||||
console.log('performance.now(): ', this.end - this.start);
|
||||
|
||||
//localStorage.setItem('store', JSON.stringify(this.state));
|
||||
}
|
||||
}
|
||||
|
||||
@ -47896,8 +47881,6 @@
|
||||
isBuffer: isBuffer
|
||||
});
|
||||
|
||||
var require$$0 = getCjsExportFromNamespace(bufferEs6);
|
||||
|
||||
var bn = createCommonjsModule(function (module) {
|
||||
(function (module, exports) {
|
||||
|
||||
@ -47950,7 +47933,7 @@
|
||||
|
||||
var Buffer;
|
||||
try {
|
||||
Buffer = require$$0.Buffer;
|
||||
Buffer = bufferEs6.Buffer;
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@ -51997,17 +51980,6 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
api.bind('/primary', 'PUT', api.authTokens.ship, 'chat',
|
||||
this.handleEvent.bind(this),
|
||||
this.handleError.bind(this));
|
||||
|
||||
/*window.addEventListener('beforeunload', (event) => {
|
||||
// Cancel the event as stated by the standard.
|
||||
event.preventDefault();
|
||||
// Chrome requires returnValue to be set.
|
||||
event.returnValue = '';
|
||||
|
||||
if (window.subscriptionId) {
|
||||
window.urb.unsubscribe(window.subscriptionId);
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
fetchMessages(circle, start, end) {
|
||||
@ -52027,7 +51999,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
handleError(err) {
|
||||
console.error(err);
|
||||
api.bind('/', "PUT", api.authTokens.ship, 'chat',
|
||||
api.bind('/primary', "PUT", api.authTokens.ship, 'chat',
|
||||
this.handleEvent.bind(this),
|
||||
this.handleError.bind(this));
|
||||
}
|
||||
@ -56652,39 +56624,63 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
updateInvite(uid, cir, resp) {
|
||||
let tagstring = resp ? "Accept" : "Reject";
|
||||
|
||||
console.log(this.props.config);
|
||||
let circleName = cir.split('/')[1];
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: [{
|
||||
let lis = [];
|
||||
|
||||
if (resp) {
|
||||
lis = [
|
||||
{
|
||||
create: {
|
||||
nom: 'hall-internal-' + circleName,
|
||||
des: "chatroom",
|
||||
sec: "channel"
|
||||
}
|
||||
},
|
||||
{
|
||||
source: {
|
||||
nom: "inbox",
|
||||
sub: resp,
|
||||
sub: true,
|
||||
srs: [cir]
|
||||
}
|
||||
},
|
||||
{
|
||||
phrase: {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
source: {
|
||||
nom: "inbox",
|
||||
sub: true,
|
||||
srs: [`~${window.ship}/hall-internal-${circleName}`]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: lis.concat([
|
||||
{
|
||||
phrase: {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
read: {
|
||||
nom: 'i',
|
||||
red: this.props.config.red + 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
read: {
|
||||
nom: 'i',
|
||||
red: this.props.config.red + 2
|
||||
}
|
||||
}]
|
||||
])
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -56697,31 +56693,31 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
if (!aut || !cir || !props.config) {
|
||||
return (
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$4, lineNumber: 77}})
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$4, lineNumber: 101}})
|
||||
);
|
||||
}
|
||||
|
||||
cir = cir.split('/')[1];
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "pa3", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 84}}
|
||||
, react.createElement('div', { className: "w-100 v-mid" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 85}}
|
||||
react.createElement('div', { className: "pa3", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 108}}
|
||||
, react.createElement('div', { className: "w-100 v-mid" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 109}}
|
||||
, react.createElement('div', { className: "dib mr2 bg-nice-green" , style: {
|
||||
borderRadius: 12,
|
||||
width: 12,
|
||||
height: 12
|
||||
}, __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 86}})
|
||||
, react.createElement('p', { className: "dib body-regular fw-normal" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 91}}, "Invite to "
|
||||
, react.createElement('span', { className: "fw-bold", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 92}}
|
||||
}, __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 110}})
|
||||
, react.createElement('p', { className: "dib body-regular fw-normal" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 115}}, "Invite to "
|
||||
, react.createElement('span', { className: "fw-bold", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 116}}
|
||||
, cir
|
||||
)
|
||||
)
|
||||
)
|
||||
, react.createElement('div', { className: "w-100", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 97}}
|
||||
, react.createElement('p', { className: "dib gray label-small-mono" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 98}}, "Hosted by " , aut)
|
||||
, react.createElement('div', { className: "w-100", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 121}}
|
||||
, react.createElement('p', { className: "dib gray label-small-mono" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 122}}, "Hosted by " , aut)
|
||||
)
|
||||
, react.createElement('a', { className: "dib w-50 pointer btn-font nice-green underline" , onClick: this.onAccept.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 100}}, "Accept")
|
||||
, react.createElement('a', { className: "dib w-50 tr pointer btn-font nice-red underline" , onClick: this.onReject.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 101}}, "Reject")
|
||||
, react.createElement('a', { className: "dib w-50 pointer btn-font nice-green underline" , onClick: this.onAccept.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 124}}, "Accept")
|
||||
, react.createElement('a', { className: "dib w-50 tr pointer btn-font nice-red underline" , onClick: this.onReject.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 125}}, "Reject")
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -56739,32 +56735,44 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
const { props } = this;
|
||||
let station = props.match.params.ship + '/' + props.match.params.station;
|
||||
|
||||
let sidebarItems = props.circles.map((cir) => {
|
||||
let msg = props.messagePreviews[cir];
|
||||
let parsed = !!msg ? getMessageContent(msg.gam) : {
|
||||
content: 'No messages yet'
|
||||
};
|
||||
let aut = !!msg ? msg.gam.aut : '';
|
||||
let wen = !!msg ? msg.gam.wen : 0;
|
||||
let datetime =
|
||||
!!msg ?
|
||||
moment.unix(wen / 1000).from(moment.utc())
|
||||
: '';
|
||||
return {
|
||||
msg,
|
||||
datetime,
|
||||
wen,
|
||||
aut,
|
||||
parsed,
|
||||
cir,
|
||||
title: cir.split('/')[1],
|
||||
selected: station === cir
|
||||
};
|
||||
})
|
||||
let sidebarItems = props.circles
|
||||
.filter((cir) => {
|
||||
return !cir.includes('hall-internal-');
|
||||
})
|
||||
.map((cir) => {
|
||||
let msg = props.messagePreviews[cir];
|
||||
let parsed = !!msg ? getMessageContent(msg.gam) : {
|
||||
content: 'No messages yet'
|
||||
};
|
||||
let aut = !!msg ? msg.gam.aut : '';
|
||||
let wen = !!msg ? msg.gam.wen : 0;
|
||||
let datetime =
|
||||
!!msg ?
|
||||
moment.unix(wen / 1000).from(moment.utc())
|
||||
: '';
|
||||
return {
|
||||
msg,
|
||||
datetime,
|
||||
wen,
|
||||
aut,
|
||||
parsed,
|
||||
cir,
|
||||
title: cir.split('/')[1],
|
||||
selected: station === cir
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
return b.wen - a.wen;
|
||||
})
|
||||
.map((obj) => {
|
||||
let host = `~${window.ship}`;
|
||||
let circle = obj.cir.split('/')[1];
|
||||
|
||||
let unread = props.unreads[obj.cir];
|
||||
if (host + '/hall-internal-' + circle in props.unreads) {
|
||||
unread = props.unreads[host + '/hall-internal-' + circle];
|
||||
}
|
||||
|
||||
return (
|
||||
react.createElement(SidebarItem, {
|
||||
key: obj.cir,
|
||||
@ -56774,8 +56782,8 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
datetime: obj.datetime,
|
||||
ship: obj.aut,
|
||||
selected: obj.selected,
|
||||
unread: props.unreads[obj.cir],
|
||||
history: props.history, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 48}}
|
||||
unread: unread,
|
||||
history: props.history, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 60}}
|
||||
)
|
||||
);
|
||||
});
|
||||
@ -56800,20 +56808,20 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
key: inv.uid,
|
||||
msg: inv,
|
||||
api: props.api,
|
||||
config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 78}}
|
||||
config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 90}}
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 88}}
|
||||
, react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 89}}
|
||||
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 90}}, "Chat")
|
||||
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 100}}
|
||||
, react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 101}}
|
||||
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 102}}, "Chat")
|
||||
, react.createElement('a', {
|
||||
className: "dib tr w-50 pointer plus-font" ,
|
||||
onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 91}}, "+")
|
||||
onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 103}}, "+")
|
||||
)
|
||||
, react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 95}}
|
||||
, react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 107}}
|
||||
, inviteItems
|
||||
, sidebarItems
|
||||
)
|
||||
@ -57135,8 +57143,6 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
let uid = uuid();
|
||||
let aut = window.ship;
|
||||
|
||||
let config = this.props.configs[this.props.station];
|
||||
|
||||
aud = [this.props.station];
|
||||
if (isUrl(this.state.message)) {
|
||||
sep = {
|
||||
@ -57156,20 +57162,25 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
aut,
|
||||
wen,
|
||||
aud,
|
||||
sep,
|
||||
sep
|
||||
};
|
||||
|
||||
let readNom = this.props.circle;
|
||||
if (this.props.host !== `~${window.ship}`) {
|
||||
readNom = 'hall-internal-' + this.props.circle;
|
||||
}
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: [
|
||||
{
|
||||
read: {
|
||||
nom: this.props.circle,
|
||||
red: config.red + 1
|
||||
nom: readNom,
|
||||
red: this.props.numMsgs + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
convey: [message],
|
||||
convey: [message]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -57184,19 +57195,21 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
const { props, state } = this;
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "mt2 pa3 cf flex black bt" , __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 165}}
|
||||
, react.createElement('div', { className: "fl", style: { flexBasis: 35, height: 40 }, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 166}}
|
||||
, react.createElement(Sigil, { ship: window.ship, size: 32, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 167}} )
|
||||
react.createElement('div', { className: "mt2 pa3 cf flex black bt" , __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 166}}
|
||||
, react.createElement('div', { className: "fl", style: { flexBasis: 35, height: 40 }, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 167}}
|
||||
, react.createElement(Sigil, { ship: window.ship, size: 32, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 168}} )
|
||||
)
|
||||
, react.createElement('div', { className: "fr h-100 flex" , style: { flexGrow: 1, height: 40 }, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 169}}
|
||||
, react.createElement('div', { className: "fr h-100 flex" , style: { flexGrow: 1, height: 40 }, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 170}}
|
||||
, react.createElement('input', { className: "ml2 bn" ,
|
||||
style: { flexGrow: 1 },
|
||||
ref: this.textareaRef,
|
||||
placeholder: props.placeholder,
|
||||
value: state.message,
|
||||
onChange: this.messageChange, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 170}} )
|
||||
, react.createElement('div', { className: "pointer", onClick: this.messageSubmit, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 176}}
|
||||
, react.createElement(IconSend, {__self: this, __source: {fileName: _jsxFileName$b, lineNumber: 177}} )
|
||||
onChange: this.messageChange,
|
||||
autoFocus: true, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 171}}
|
||||
)
|
||||
, react.createElement('div', { className: "pointer", onClick: this.messageSubmit, __self: this, __source: {fileName: _jsxFileName$b, lineNumber: 179}}
|
||||
, react.createElement(IconSend, {__self: this, __source: {fileName: _jsxFileName$b, lineNumber: 180}} )
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -57218,10 +57231,13 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
scrollLocked: false,
|
||||
};
|
||||
|
||||
this.messageLength = 0;
|
||||
this.hasAskedForMessages = false;
|
||||
this.topMessage = {};
|
||||
this.buildMessage = this.buildMessage.bind(this);
|
||||
this.onScroll = this.onScroll.bind(this);
|
||||
|
||||
this.scrollClosure = false;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@ -57234,31 +57250,26 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { props } = this;
|
||||
|
||||
if (prevProps.messages.length < props.messages.length - 300) {
|
||||
this.hasAskedForMessages = false;
|
||||
this.forceUpdate();
|
||||
this.topMessage = {};
|
||||
} else if (prevProps.match.params.ship !== props.match.params.ship ||
|
||||
if (prevProps.match.params.ship !== props.match.params.ship ||
|
||||
prevProps.match.params.station !== props.match.params.station
|
||||
) {
|
||||
console.log('switched circle');
|
||||
this.hasAskedForMessages = false;
|
||||
this.scrollClosure = false;
|
||||
this.topMessage = {};
|
||||
|
||||
this.setState({
|
||||
station: props.match.params.ship + "/" + props.match.params.station,
|
||||
circle: props.match.params.station,
|
||||
host: props.match.params.ship,
|
||||
numPeople: 0,
|
||||
scrollLocked: false
|
||||
}, () => {
|
||||
this.updateReadNumber();
|
||||
this.updateNumPeople();
|
||||
this.scrollToBottom();
|
||||
});
|
||||
|
||||
this.hasAskedForMessages = false;
|
||||
this.topMessage = {};
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
this.updateReadNumber();
|
||||
this.updateNumPeople();
|
||||
this.updateNumMessagesLoaded(prevProps, prevState);
|
||||
this.scrollToBottom();
|
||||
}
|
||||
|
||||
askForMessages() {
|
||||
@ -57311,18 +57322,27 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
updateReadNumber() {
|
||||
const { props, state } = this;
|
||||
|
||||
let messages = props.messages[state.station] || [];
|
||||
let config = props.configs[state.station] || false;
|
||||
|
||||
let internalCircle = 'hall-internal-' + state.circle;
|
||||
let internalStation = `~${window.ship}/${internalCircle}`;
|
||||
|
||||
let internalConfig = props.configs[internalStation] || false;
|
||||
let regularConfig = props.configs[state.station] || false;
|
||||
|
||||
let config = internalConfig || regularConfig;
|
||||
let messages = props.messages;
|
||||
|
||||
let lastMsgNum = (messages.length > 0) ?
|
||||
messages[messages.length - 1].num : 0;
|
||||
|
||||
if (config && config.red < lastMsgNum) {
|
||||
props.api.read(state.circle, lastMsgNum);
|
||||
if (internalConfig) {
|
||||
props.api.read(internalCircle, lastMsgNum);
|
||||
} else {
|
||||
props.api.read(state.circle, lastMsgNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -57335,17 +57355,6 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
}
|
||||
}
|
||||
|
||||
updateNumMessagesLoaded(prevProps, prevState) {
|
||||
let station = prevProps.messages[this.state.station] || [];
|
||||
let numMessages = station.length;
|
||||
|
||||
if (numMessages > prevState.numMessages) {
|
||||
this.setState({
|
||||
numMessages: numMessages
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
buildMessage(msg, index) {
|
||||
let details = msg.printship ? null : getMessageContent(msg.gam);
|
||||
|
||||
@ -57353,7 +57362,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
return (
|
||||
react.createElement('a', {
|
||||
className: "vanilla hoverline text-600 text-mono" ,
|
||||
href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 157}}
|
||||
href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 153}}
|
||||
, prettyShip(`~${msg.gam.aut}`)[0]
|
||||
)
|
||||
);
|
||||
@ -57364,8 +57373,8 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
return (
|
||||
react.createElement('div', {
|
||||
key: msg.gam.uid + "key" + Math.random() + "key" + msg.num,
|
||||
ref: el => { this.topMessage[pageNum] = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 168}}
|
||||
, react.createElement(Message, { msg: msg.gam, details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 171}} )
|
||||
ref: el => { this.topMessage[pageNum] = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 164}}
|
||||
, react.createElement(Message, { msg: msg.gam, details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 167}} )
|
||||
)
|
||||
);
|
||||
} else {
|
||||
@ -57373,7 +57382,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
react.createElement(Message, {
|
||||
key: msg.gam.uid + Math.random(),
|
||||
msg: msg.gam,
|
||||
details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 176}} )
|
||||
details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 172}} )
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -57381,8 +57390,20 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
render() {
|
||||
const { props, state } = this;
|
||||
|
||||
let messages = props.messages;
|
||||
if (props.messages.length !== this.messageLength && !this.scrollClosure) {
|
||||
this.scrollClosure = true;
|
||||
setTimeout(() => {
|
||||
this.scrollToBottom();
|
||||
this.updateReadNumber();
|
||||
this.scrollClosure = null;
|
||||
}, 200);
|
||||
}
|
||||
this.messageLength = props.messages.length;
|
||||
|
||||
let lastMsgNum = (messages.length > 0) ?
|
||||
messages[messages.length - 1].num : 0;
|
||||
|
||||
let messages = props.messages.slice(0);
|
||||
if (messages.length > 50 * state.numPages) {
|
||||
messages = messages
|
||||
.slice(messages.length - (50 * state.numPages), messages.length);
|
||||
@ -57393,26 +57414,26 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
return (
|
||||
react.createElement('div', { key: state.station,
|
||||
className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 198}}
|
||||
, react.createElement('div', { className: "pl2 pt2 bb mb3" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 200}}
|
||||
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 201}}, state.circle)
|
||||
className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 206}}
|
||||
, react.createElement('div', { className: "pl2 pt2 bb mb3" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 208}}
|
||||
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 209}}, state.circle)
|
||||
, react.createElement(ChatTabBar, { ...props,
|
||||
station: state.station,
|
||||
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 202}} )
|
||||
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 210}} )
|
||||
)
|
||||
, react.createElement('div', {
|
||||
className: "overflow-y-scroll",
|
||||
style: { flexGrow: 1 },
|
||||
onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 206}}
|
||||
onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 214}}
|
||||
, chatMessages
|
||||
, react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 211}})
|
||||
, react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 219}})
|
||||
)
|
||||
, react.createElement(ChatInput, {
|
||||
api: props.api,
|
||||
configs: props.configs,
|
||||
numMsgs: lastMsgNum,
|
||||
station: state.station,
|
||||
circle: state.circle,
|
||||
placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 213}} )
|
||||
placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 221}} )
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -57785,8 +57806,14 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
let unreads = {};
|
||||
circles.forEach((cir) => {
|
||||
if (cir in messagePreviews && !!messagePreviews[cir]) {
|
||||
unreads[cir] = state.configs[cir].red < messagePreviews[cir].num;
|
||||
if (cir in messages) {
|
||||
if (messages[cir].length === 0) {
|
||||
unreads[cir] = false;
|
||||
} else {
|
||||
unreads[cir] =
|
||||
state.configs[cir].red <
|
||||
messages[cir][messages[cir].length - 1].num;
|
||||
}
|
||||
} else {
|
||||
unreads[cir] = false;
|
||||
}
|
||||
@ -57805,8 +57832,8 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
}
|
||||
|
||||
return (
|
||||
react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 82}}
|
||||
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 83}}
|
||||
react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 88}}
|
||||
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 89}}
|
||||
, react.createElement(Route, { exact: true, path: "/~chat",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57819,19 +57846,19 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 89}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 95}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 87}}
|
||||
, react.createElement('div', { className: "w-100 h-100 fr" , style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 99}}
|
||||
, react.createElement('div', { className: "dt w-100 h-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 100}}
|
||||
, react.createElement('div', { className: "dtc center v-mid w-100 h-100 bg-white" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 101}}
|
||||
, react.createElement('p', { className: "tc", __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 102}}, "Cmd + N to start a new chat" )
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 93}}
|
||||
, react.createElement('div', { className: "w-100 h-100 fr" , style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 105}}
|
||||
, react.createElement('div', { className: "dt w-100 h-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 106}}
|
||||
, react.createElement('div', { className: "dtc center v-mid w-100 h-100 bg-white" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 107}}
|
||||
, react.createElement('p', { className: "tc", __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 108}}, "Cmd + N to start a new chat" )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 84}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 90}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/new",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57844,16 +57871,16 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 114}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 120}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 112}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 118}}
|
||||
, react.createElement(NewScreen, {
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 124}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 130}}
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 109}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 115}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station",
|
||||
render: (props) => {
|
||||
let station =
|
||||
@ -57871,20 +57898,20 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 141}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 147}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 139}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 145}}
|
||||
, react.createElement(ChatScreen, {
|
||||
api: api,
|
||||
configs: configs,
|
||||
messages: messages,
|
||||
peers: state.peers,
|
||||
subscription: subscription,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 151}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 157}}
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 131}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 137}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/members",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57897,17 +57924,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 167}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 173}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 165}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 171}}
|
||||
, react.createElement(MemberScreen, {
|
||||
...props,
|
||||
api: api,
|
||||
peers: state.peers, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 177}}
|
||||
peers: state.peers, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 183}}
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 162}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 168}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/settings",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57920,17 +57947,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 190}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 196}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 188}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 194}}
|
||||
, react.createElement(SettingsScreen, {
|
||||
...props,
|
||||
api: api,
|
||||
peers: state.peers,
|
||||
store: store, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 200}} )
|
||||
store: store, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 206}} )
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 185}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 191}} )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -19333,36 +19333,44 @@
|
||||
|
||||
state.numbers.forEach((num) => {
|
||||
numbers[num.circle] = num.length;
|
||||
if (num.circle === inviteCircle) {
|
||||
inviteNum = inviteNum + num.length;
|
||||
} else {
|
||||
msgNum = msgNum + num.length;
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(state.configs).forEach((key) => {
|
||||
let con = state.configs[key];
|
||||
|
||||
if (key in numbers) {
|
||||
console.log(key, con.red, numbers[key]);
|
||||
if (key === inviteCircle) {
|
||||
if (con.red < numbers[key]) {
|
||||
inviteNum = msgNum + numbers[key] - con.red;
|
||||
}
|
||||
} else {
|
||||
if (con.red < numbers[key]) {
|
||||
msgNum = msgNum + numbers[key] - con.red;
|
||||
}
|
||||
}
|
||||
let host = key.split('/')[0];
|
||||
if (host !== `~${window.ship}`) { return; }
|
||||
if (!state.configs[key]) { return; }
|
||||
let red = state.configs[key].red;
|
||||
if (key === inviteCircle) {
|
||||
inviteNum = inviteNum - red;
|
||||
} else {
|
||||
msgNum = msgNum - red;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (inviteNum === -1) {
|
||||
inviteNum = 0;
|
||||
}
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 66}}
|
||||
, react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 67}}
|
||||
, react.createElement('p', { className: "gray", __self: this, __source: {fileName: _jsxFileName, lineNumber: 68}}, "Chat")
|
||||
react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 70}}
|
||||
, react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 71}}
|
||||
, react.createElement('p', { className: "gray", style: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: 14,
|
||||
lineHeight: '24px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 72}}, "Chat")
|
||||
, react.createElement('img', {
|
||||
className: "absolute",
|
||||
style: { left: 68, top: 65 },
|
||||
src: "/~chat/img/Tile.png",
|
||||
width: 106,
|
||||
height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 69}} )
|
||||
height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 77}} )
|
||||
, react.createElement('p', {
|
||||
className: "absolute white" ,
|
||||
style: {
|
||||
@ -19370,7 +19378,7 @@
|
||||
fontWeight: 600,
|
||||
fontSize: 16,
|
||||
lineHeight: '20px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 75}}, inviteNum, " invites" )
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 83}}, inviteNum, " invites" )
|
||||
, react.createElement('p', {
|
||||
className: "absolute white" ,
|
||||
style: {
|
||||
@ -19378,7 +19386,7 @@
|
||||
fontWeight: 600,
|
||||
fontSize: 16,
|
||||
lineHeight: '20px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 83}}, msgNum, " new messages" )
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 91}}, msgNum, " new messages" )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -149,7 +149,11 @@ export default class ClockTile extends Component {
|
||||
|
||||
renderWrapper(child) {
|
||||
return (
|
||||
<div className="pa2 bg-dark-gray" style={{ width: outerSize, height: outerSize }}>
|
||||
<div className="pa2" style={{
|
||||
width: outerSize,
|
||||
height: outerSize,
|
||||
background: '#1a1a1a'
|
||||
}}>
|
||||
{child}
|
||||
</div>
|
||||
);
|
||||
|
@ -2351,7 +2351,11 @@
|
||||
|
||||
renderWrapper(child) {
|
||||
return (
|
||||
react.createElement('div', { className: "pa2 bg-dark-gray" , style: { width: outerSize, height: outerSize }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 152}}
|
||||
react.createElement('div', { className: "pa2", style: {
|
||||
width: outerSize,
|
||||
height: outerSize,
|
||||
background: '#1a1a1a'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 152}}
|
||||
, child
|
||||
)
|
||||
);
|
||||
@ -2361,7 +2365,7 @@
|
||||
let data = !!this.props.data ? this.props.data : {};
|
||||
|
||||
return this.renderWrapper((
|
||||
react.createElement(Clock, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 162}})
|
||||
react.createElement(Clock, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 166}})
|
||||
));
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
p, h1, h2, h3, h4, h5, h6, a, input, textarea, button {
|
||||
margin-block-end: unset;
|
||||
margin-block-start: unset;
|
||||
-webkit-margin-before: unset;
|
||||
-webkit-margin-after: unset;
|
||||
font-family: Inter, sans-serif;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,6 @@ export default class Header extends Component {
|
||||
return (
|
||||
<header className="w-100 h2 cf">
|
||||
<div className="fl h2 bg-black">
|
||||
<Dropdown />
|
||||
</div>
|
||||
<div className="fr h2 bg-black">
|
||||
<p className="white v-mid h2 sans-serif dtc pr2">{this.state.moment.format("MMM DD")}</p>
|
||||
|
File diff suppressed because one or more lines are too long
@ -49027,48 +49027,7 @@
|
||||
})));
|
||||
});
|
||||
|
||||
const _jsxFileName = "/Users/logan/Dev/interface/apps/launch/src/js/components/dropdown.js";
|
||||
let style = {
|
||||
circle: {
|
||||
width: '2em',
|
||||
height: '2em',
|
||||
background: '#000000',
|
||||
border: '4px solid #333333',
|
||||
'borderRadius': '2em'
|
||||
},
|
||||
triangle: {
|
||||
width: '0px',
|
||||
height: '0px',
|
||||
'borderTop': '8px solid #FFFFFF',
|
||||
'borderLeft': '8px solid transparent',
|
||||
'borderRight': '8px solid transparent',
|
||||
'fontSize': 0,
|
||||
'lineHeight': 0,
|
||||
'marginLeft': 'auto',
|
||||
'marginRight': 'auto',
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Dropdown extends react_1 {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 36}}
|
||||
, react.createElement('div', { className: "ml2", style: style.circle, __self: this, __source: {fileName: _jsxFileName, lineNumber: 37}}
|
||||
, react.createElement('div', { className: "mt2", style: style.triangle, __self: this, __source: {fileName: _jsxFileName, lineNumber: 38}})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const _jsxFileName$1 = "/Users/logan/Dev/interface/apps/launch/src/js/components/header.js";
|
||||
const _jsxFileName = "/Users/logan/Dev/interface/apps/launch/src/js/components/header.js";
|
||||
class Header extends react_1 {
|
||||
|
||||
constructor(props) {
|
||||
@ -49103,13 +49062,12 @@
|
||||
|
||||
render() {
|
||||
return (
|
||||
react.createElement('header', { className: "w-100 h2 cf" , __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 43}}
|
||||
, react.createElement('div', { className: "fl h2 bg-black" , __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 44}}
|
||||
, react.createElement(Dropdown, {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 45}} )
|
||||
react.createElement('header', { className: "w-100 h2 cf" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 43}}
|
||||
, react.createElement('div', { className: "fl h2 bg-black" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 44}}
|
||||
)
|
||||
, react.createElement('div', { className: "fr h2 bg-black" , __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 47}}
|
||||
, react.createElement('p', { className: "white v-mid h2 sans-serif dtc pr2" , __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 48}}, this.state.moment.format("MMM DD"))
|
||||
, react.createElement('p', { className: "white v-mid h2 sans-serif dtc pr2" , __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 49}}, this.state.moment.format("hh:mm a"))
|
||||
, react.createElement('div', { className: "fr h2 bg-black" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 46}}
|
||||
, react.createElement('p', { className: "white v-mid h2 sans-serif dtc pr2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 47}}, this.state.moment.format("MMM DD"))
|
||||
, react.createElement('p', { className: "white v-mid h2 sans-serif dtc pr2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 48}}, this.state.moment.format("hh:mm a"))
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -49117,7 +49075,7 @@
|
||||
|
||||
}
|
||||
|
||||
const _jsxFileName$2 = "/Users/logan/Dev/interface/apps/launch/src/js/components/tile.js";
|
||||
const _jsxFileName$1 = "/Users/logan/Dev/interface/apps/launch/src/js/components/tile.js";
|
||||
class Tile extends react_1 {
|
||||
|
||||
constructor(props) {
|
||||
@ -49129,10 +49087,10 @@
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "fl ma2 bg-white overflow-hidden" ,
|
||||
style: { height: '234px', width: '234px' }, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 16}}
|
||||
style: { height: '234px', width: '234px' }, __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 16}}
|
||||
, !!SpecificTile ?
|
||||
react.createElement(SpecificTile, { data: this.props.data, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 19}} )
|
||||
: react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$2, lineNumber: 20}})
|
||||
react.createElement(SpecificTile, { data: this.props.data, __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 19}} )
|
||||
: react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 20}})
|
||||
|
||||
)
|
||||
);
|
||||
@ -49140,7 +49098,7 @@
|
||||
|
||||
}
|
||||
|
||||
const _jsxFileName$3 = "/Users/logan/Dev/interface/apps/launch/src/js/components/home.js";
|
||||
const _jsxFileName$2 = "/Users/logan/Dev/interface/apps/launch/src/js/components/home.js";
|
||||
|
||||
class Home extends react_1 {
|
||||
|
||||
@ -49153,14 +49111,14 @@
|
||||
let keys = [...this.props.keys];
|
||||
let tileElems = keys.map((tile) => {
|
||||
return (
|
||||
react.createElement(Tile, { key: tile, type: tile, data: this.props.data[tile], __self: this, __source: {fileName: _jsxFileName$3, lineNumber: 21}} )
|
||||
react.createElement(Tile, { key: tile, type: tile, data: this.props.data[tile], __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 21}} )
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "fl w-100 vh-100 bg-black center" , __self: this, __source: {fileName: _jsxFileName$3, lineNumber: 26}}
|
||||
, react.createElement(Header, {__self: this, __source: {fileName: _jsxFileName$3, lineNumber: 27}} )
|
||||
, react.createElement('div', { className: "v-mid pa2 dtc" , __self: this, __source: {fileName: _jsxFileName$3, lineNumber: 28}}
|
||||
react.createElement('div', { className: "fl w-100 vh-100 bg-black center" , __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 26}}
|
||||
, react.createElement(Header, {__self: this, __source: {fileName: _jsxFileName$2, lineNumber: 27}} )
|
||||
, react.createElement('div', { className: "v-mid pa2 dtc" , __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 28}}
|
||||
, tileElems
|
||||
)
|
||||
)
|
||||
@ -49169,7 +49127,7 @@
|
||||
|
||||
}
|
||||
|
||||
const _jsxFileName$4 = "/Users/logan/Dev/interface/apps/launch/src/js/app.js";
|
||||
const _jsxFileName$3 = "/Users/logan/Dev/interface/apps/launch/src/js/app.js";
|
||||
class App extends react_1 {
|
||||
|
||||
constructor() {
|
||||
@ -49182,18 +49140,18 @@
|
||||
|
||||
render() {
|
||||
return (
|
||||
react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$4, lineNumber: 19}}
|
||||
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$4, lineNumber: 20}}
|
||||
react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$3, lineNumber: 19}}
|
||||
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$3, lineNumber: 20}}
|
||||
, react.createElement(Route, { exact: true, path: "/",
|
||||
render: (props) => {
|
||||
return (
|
||||
react.createElement(Home, {
|
||||
...props,
|
||||
data: this.state,
|
||||
keys: new Set(Object.keys(this.state)), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 24}}
|
||||
keys: new Set(Object.keys(this.state)), __self: this, __source: {fileName: _jsxFileName$3, lineNumber: 24}}
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 21}}
|
||||
}, __self: this, __source: {fileName: _jsxFileName$3, lineNumber: 21}}
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -49203,12 +49161,12 @@
|
||||
|
||||
window.app = App;
|
||||
|
||||
const _jsxFileName$5 = "/Users/logan/Dev/interface/apps/launch/src/index.js";
|
||||
const _jsxFileName$4 = "/Users/logan/Dev/interface/apps/launch/src/index.js";
|
||||
|
||||
subscription.setAuthTokens({
|
||||
ship: window.ship
|
||||
});
|
||||
|
||||
reactDom.render(react.createElement(App, {__self: undefined, __source: {fileName: _jsxFileName$5, lineNumber: 12}} ), document.querySelectorAll("#root")[0]);
|
||||
reactDom.render(react.createElement(App, {__self: undefined, __source: {fileName: _jsxFileName$4, lineNumber: 12}} ), document.querySelectorAll("#root")[0]);
|
||||
|
||||
}));
|
||||
|
@ -203,7 +203,11 @@ export default class TimerTile extends Component {
|
||||
|
||||
renderWrapper(child) {
|
||||
return (
|
||||
<div className="bg-dark-gray" style={{ width: outerSize, height: outerSize }}>
|
||||
<div style={{
|
||||
width: outerSize,
|
||||
height: outerSize,
|
||||
background: '#1a1a1a'
|
||||
}}>
|
||||
{child}
|
||||
</div>
|
||||
);
|
||||
|
@ -2505,7 +2505,11 @@
|
||||
|
||||
renderWrapper(child) {
|
||||
return (
|
||||
react.createElement('div', { className: "bg-dark-gray", style: { width: outerSize, height: outerSize }, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 206}}
|
||||
react.createElement('div', { style: {
|
||||
width: outerSize,
|
||||
height: outerSize,
|
||||
background: '#1a1a1a'
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 206}}
|
||||
, child
|
||||
)
|
||||
);
|
||||
@ -2518,21 +2522,21 @@
|
||||
var interaction;
|
||||
var interactionStyle = "link underline black hover-white";
|
||||
if(this.state.mode == "running") {
|
||||
interaction = react.createElement('a', { className: interactionStyle, onClick: this.stopTimer, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 219}}, "Stop");
|
||||
interaction = react.createElement('a', { className: interactionStyle, onClick: this.stopTimer, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 223}}, "Stop");
|
||||
}
|
||||
else if(this.state.mode == "alarm") {
|
||||
interaction = react.createElement('a', { className: interactionStyle, onClick: this.stopTimer, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 222}}, "Shhh");
|
||||
interaction = react.createElement('a', { className: interactionStyle, onClick: this.stopTimer, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 226}}, "Shhh");
|
||||
}
|
||||
else {
|
||||
interaction = react.createElement('a', { className: interactionStyle, onClick: this.startTimer, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 225}}, "Start");
|
||||
interaction = react.createElement('a', { className: interactionStyle, onClick: this.startTimer, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 229}}, "Start");
|
||||
|
||||
}
|
||||
|
||||
return this.renderWrapper((
|
||||
react.createElement('div', { style: { position: "relative",
|
||||
fontFamily: "-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif"
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 230}}
|
||||
, react.createElement('canvas', { id: "timer-canvas", width: outerSize, height: outerSize, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 233}})
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 234}}
|
||||
, react.createElement('canvas', { id: "timer-canvas", width: outerSize, height: outerSize, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 237}})
|
||||
|
||||
, react.createElement('div', { id: "timer-display", style: {
|
||||
width: "100%",
|
||||
@ -2542,15 +2546,15 @@
|
||||
left: "0px",
|
||||
fontSize:"28px",
|
||||
fontWeight:"300"
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 235}}
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 239}}
|
||||
, this.state.mode == "running" ? this.formatTime(this.state.time) :
|
||||
this.state.mode == "alarm" ?
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$2, lineNumber: 246}}
|
||||
, react.createElement(Flashing, {__self: this, __source: {fileName: _jsxFileName$2, lineNumber: 247}}, "00:00")
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$2, lineNumber: 250}}
|
||||
, react.createElement(Flashing, {__self: this, __source: {fileName: _jsxFileName$2, lineNumber: 251}}, "00:00")
|
||||
,
|
||||
this.state.playSound
|
||||
?
|
||||
react.createElement('audio', { src: "http://maxwellsfoley.com/ding.mp3", loop: true, autoPlay: true, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 251}})
|
||||
react.createElement('audio', { src: "http://maxwellsfoley.com/ding.mp3", loop: true, autoPlay: true, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 255}})
|
||||
:
|
||||
null
|
||||
|
||||
@ -2565,15 +2569,15 @@
|
||||
top: "170px",
|
||||
left: "0px",
|
||||
fontSize:"16px"
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 259}}
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 263}}
|
||||
, interaction
|
||||
)
|
||||
, react.createElement('div', { id: "volume-container", style: {
|
||||
position: "absolute",
|
||||
top: "200px",
|
||||
left: "5px"
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 269}}
|
||||
, react.createElement(VolumeIcon, { parent: this, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 274}})
|
||||
}, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 273}}
|
||||
, react.createElement(VolumeIcon, { parent: this, __self: this, __source: {fileName: _jsxFileName$2, lineNumber: 278}})
|
||||
)
|
||||
)
|
||||
));
|
||||
|
@ -45,7 +45,11 @@ export default class WeatherTile extends Component {
|
||||
|
||||
renderWrapper(child) {
|
||||
return (
|
||||
<div className="pa2 bg-dark-gray" style={{ width: 234, height: 234 }}>
|
||||
<div className="pa2" style={{
|
||||
width: 234,
|
||||
height: 234,
|
||||
background: '#1a1a1a'
|
||||
}}>
|
||||
{child}
|
||||
</div>
|
||||
);
|
||||
@ -68,7 +72,11 @@ export default class WeatherTile extends Component {
|
||||
|
||||
return this.renderWrapper((
|
||||
<div>
|
||||
<p className="white">Weather</p>
|
||||
<p className="gray" style={{
|
||||
fontWeight: 'bold',
|
||||
fontSize: 14,
|
||||
lineHeight: '24px'
|
||||
}}>Weather</p>
|
||||
<div className="w-100 mb2 mt2">
|
||||
<img
|
||||
src={'/~weather/img/' + c.icon + '.png'}
|
||||
|
@ -6852,7 +6852,11 @@
|
||||
|
||||
renderWrapper(child) {
|
||||
return (
|
||||
react.createElement('div', { className: "pa2 bg-dark-gray" , style: { width: 234, height: 234 }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 48}}
|
||||
react.createElement('div', { className: "pa2", style: {
|
||||
width: 234,
|
||||
height: 234,
|
||||
background: '#1a1a1a'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 48}}
|
||||
, child
|
||||
)
|
||||
);
|
||||
@ -6860,9 +6864,9 @@
|
||||
|
||||
renderNoData() {
|
||||
return this.renderWrapper((
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 56}}
|
||||
, react.createElement('p', { className: "white sans-serif" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 57}}, "Weather")
|
||||
, react.createElement('button', { onClick: this.locationSubmit.bind(this), __self: this, __source: {fileName: _jsxFileName, lineNumber: 58}}, "Set location" )
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 60}}
|
||||
, react.createElement('p', { className: "white sans-serif" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 61}}, "Weather")
|
||||
, react.createElement('button', { onClick: this.locationSubmit.bind(this), __self: this, __source: {fileName: _jsxFileName, lineNumber: 62}}, "Set location" )
|
||||
)
|
||||
));
|
||||
}
|
||||
@ -6874,45 +6878,49 @@
|
||||
let da = moment.unix(d.sunsetTime).format('h:mm a') || '';
|
||||
|
||||
return this.renderWrapper((
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 70}}
|
||||
, react.createElement('p', { className: "white", __self: this, __source: {fileName: _jsxFileName, lineNumber: 71}}, "Weather")
|
||||
, react.createElement('div', { className: "w-100 mb2 mt2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 72}}
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 74}}
|
||||
, react.createElement('p', { className: "gray", style: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: 14,
|
||||
lineHeight: '24px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 75}}, "Weather")
|
||||
, react.createElement('div', { className: "w-100 mb2 mt2" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 80}}
|
||||
, react.createElement('img', {
|
||||
src: '/~weather/img/' + c.icon + '.png',
|
||||
width: 64,
|
||||
height: 64,
|
||||
className: "dib", __self: this, __source: {fileName: _jsxFileName, lineNumber: 73}} )
|
||||
className: "dib", __self: this, __source: {fileName: _jsxFileName, lineNumber: 81}} )
|
||||
, react.createElement('h2', {
|
||||
className: "dib ml2 white" ,
|
||||
style: {
|
||||
fontSize: 72,
|
||||
lineHeight: '64px',
|
||||
fontWeight: 400
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 78}}
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 86}}
|
||||
, Math.round(c.temperature), "°")
|
||||
)
|
||||
, react.createElement('div', { className: "w-100 cf" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 87}}
|
||||
, react.createElement('div', { className: "fl w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 88}}
|
||||
, react.createElement('div', { className: "w-100 cf" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 95}}
|
||||
, react.createElement('div', { className: "fl w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 96}}
|
||||
, react.createElement(IconWithData, {
|
||||
icon: "winddirection",
|
||||
text: c.windBearing + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 89}} )
|
||||
text: c.windBearing + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 97}} )
|
||||
, react.createElement(IconWithData, {
|
||||
icon: "chancerain",
|
||||
text: c.precipProbability + '%', __self: this, __source: {fileName: _jsxFileName, lineNumber: 92}} )
|
||||
text: c.precipProbability + '%', __self: this, __source: {fileName: _jsxFileName, lineNumber: 100}} )
|
||||
, react.createElement(IconWithData, {
|
||||
icon: "windspeed",
|
||||
text: Math.round(c.windSpeed) + ' mph', __self: this, __source: {fileName: _jsxFileName, lineNumber: 95}} )
|
||||
text: Math.round(c.windSpeed) + ' mph', __self: this, __source: {fileName: _jsxFileName, lineNumber: 103}} )
|
||||
)
|
||||
, react.createElement('div', { className: "fr w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 99}}
|
||||
, react.createElement('div', { className: "fr w-50" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 107}}
|
||||
, react.createElement(IconWithData, {
|
||||
icon: "sunset",
|
||||
text: da, __self: this, __source: {fileName: _jsxFileName, lineNumber: 100}} )
|
||||
text: da, __self: this, __source: {fileName: _jsxFileName, lineNumber: 108}} )
|
||||
, react.createElement(IconWithData, {
|
||||
icon: "low",
|
||||
text: Math.round(d.temperatureLow) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 103}} )
|
||||
text: Math.round(d.temperatureLow) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 111}} )
|
||||
, react.createElement(IconWithData, {
|
||||
icon: "high",
|
||||
text: Math.round(d.temperatureHigh) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 106}} )
|
||||
text: Math.round(d.temperatureHigh) + '°', __self: this, __source: {fileName: _jsxFileName, lineNumber: 114}} )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user