Compare commits
5 commits
add-topic-
...
dev
Author | SHA1 | Date | |
---|---|---|---|
ff046ef49a | |||
f0fa49c291 | |||
373cceadfd | |||
344e225ff4 | |||
7e1b747a37 |
9 changed files with 54 additions and 16 deletions
4
captain-definition
Normal file
4
captain-definition
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"schemaVersion": 2,
|
||||
"dockerfilePath": "./Dockerfile"
|
||||
}
|
|
@ -102,6 +102,6 @@
|
|||
<audio id="inviteSound">
|
||||
<source src="./public/sound/invite.ogg" type="audio/ogg" />
|
||||
</audio>
|
||||
<script type="module" src="./src/index.jsx"></script>
|
||||
<script type="module" src="./src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
22
package-lock.json
generated
22
package-lock.json
generated
|
@ -14,6 +14,7 @@
|
|||
"@khanacademy/simple-markdown": "0.8.6",
|
||||
"@matrix-org/olm": "3.2.14",
|
||||
"@tippyjs/react": "4.2.6",
|
||||
"@types/flux": "3.1.11",
|
||||
"blurhash": "2.0.4",
|
||||
"browser-encrypt-attachment": "0.3.0",
|
||||
"dateformat": "5.0.3",
|
||||
|
@ -43,6 +44,7 @@
|
|||
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
|
||||
"@rollup/plugin-inject": "5.0.3",
|
||||
"@rollup/plugin-wasm": "6.1.1",
|
||||
"@types/dateformat": "5.0.0",
|
||||
"@types/node": "18.11.18",
|
||||
"@types/react": "18.0.26",
|
||||
"@types/react-dom": "18.0.9",
|
||||
|
@ -1115,6 +1117,12 @@
|
|||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/dateformat": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/dateformat/-/dateformat-5.0.0.tgz",
|
||||
"integrity": "sha512-SZg4JdHIWHQGEokbYGZSDvo5wA4TLYPXaqhigs/wH+REDOejcJzgH+qyY+HtEUtWOZxEUkbhbdYPqQDiEgrXeA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
|
||||
|
@ -1126,6 +1134,20 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g=="
|
||||
},
|
||||
"node_modules/@types/fbemitter": {
|
||||
"version": "2.0.32",
|
||||
"resolved": "https://registry.npmjs.org/@types/fbemitter/-/fbemitter-2.0.32.tgz",
|
||||
"integrity": "sha512-Hwq28bBlbmfCgLnNJvjl5ssTrbZCTSblI4vqPpqZrbbEL8vn5l2UivxhlMYfUY7a4SR8UB6RKoLjOZfljqAa6g=="
|
||||
},
|
||||
"node_modules/@types/flux": {
|
||||
"version": "3.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/flux/-/flux-3.1.11.tgz",
|
||||
"integrity": "sha512-Aq4UB1ZqAKcPbhB0GpgMw2sntvOh71he9tjz53TLKrI7rw3Y3LxCW5pTYY9IV455hQapm4pmxFjpqlWOs308Yg==",
|
||||
"dependencies": {
|
||||
"@types/fbemitter": "*",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "yarn check:eslint && yarn check:prettier",
|
||||
"lint": "npm run check:eslint && npm run check:prettier",
|
||||
"check:eslint": "eslint src/*",
|
||||
"check:prettier": "prettier --check .",
|
||||
"fix:prettier": "prettier --write .",
|
||||
|
@ -24,6 +24,7 @@
|
|||
"@khanacademy/simple-markdown": "0.8.6",
|
||||
"@matrix-org/olm": "3.2.14",
|
||||
"@tippyjs/react": "4.2.6",
|
||||
"@types/flux": "3.1.11",
|
||||
"blurhash": "2.0.4",
|
||||
"browser-encrypt-attachment": "0.3.0",
|
||||
"dateformat": "5.0.3",
|
||||
|
@ -53,6 +54,7 @@
|
|||
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
|
||||
"@rollup/plugin-inject": "5.0.3",
|
||||
"@rollup/plugin-wasm": "6.1.1",
|
||||
"@types/dateformat": "5.0.0",
|
||||
"@types/node": "18.11.18",
|
||||
"@types/react": "18.0.26",
|
||||
"@types/react-dom": "18.0.9",
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import dateFormat from "dateformat";
|
||||
import { isInSameDay } from "../../../util/common";
|
||||
|
||||
function Time({ timestamp, fullTime }) {
|
||||
export interface TimeProps {
|
||||
timestamp: number;
|
||||
fullTime?: boolean;
|
||||
}
|
||||
|
||||
function Time({ timestamp, fullTime }: TimeProps) {
|
||||
const date = new Date(timestamp);
|
||||
|
||||
const formattedFullTime = dateFormat(date, "dd mmmm yyyy, hh:MM TT");
|
||||
let formattedDate = formattedFullTime;
|
||||
let formattedDateTime = formattedFullTime;
|
||||
|
||||
if (!fullTime) {
|
||||
const compareDate = new Date();
|
||||
|
@ -16,18 +20,21 @@ function Time({ timestamp, fullTime }) {
|
|||
compareDate.setDate(compareDate.getDate() - 1);
|
||||
const isYesterday = isInSameDay(date, compareDate);
|
||||
|
||||
formattedDate = dateFormat(
|
||||
const dtf = new Intl.DateTimeFormat();
|
||||
const formattedDate = dtf.format(date);
|
||||
|
||||
formattedDateTime = dateFormat(
|
||||
date,
|
||||
isToday || isYesterday ? "hh:MM TT" : "dd/mm/yyyy"
|
||||
isToday || isYesterday ? "hh:MM TT" : formattedDate
|
||||
);
|
||||
if (isYesterday) {
|
||||
formattedDate = `Yesterday, ${formattedDate}`;
|
||||
formattedDateTime = `Yesterday, ${formattedDateTime}`;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<time dateTime={date.toISOString()} title={formattedFullTime}>
|
||||
{formattedDate}
|
||||
{formattedDateTime}
|
||||
</time>
|
||||
);
|
||||
}
|
||||
|
@ -36,9 +43,4 @@ Time.defaultProps = {
|
|||
fullTime: false,
|
||||
};
|
||||
|
||||
Time.propTypes = {
|
||||
timestamp: PropTypes.number.isRequired,
|
||||
fullTime: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default Time;
|
|
@ -97,6 +97,14 @@ function Home({ spaceId }) {
|
|||
/>
|
||||
)}
|
||||
|
||||
{roomIds.length !== 0 && (
|
||||
<RoomsCategory
|
||||
name="Rooms"
|
||||
roomIds={roomIds.sort(roomIdByAtoZ)}
|
||||
drawerPostie={drawerPostie}
|
||||
/>
|
||||
)}
|
||||
|
||||
{directIds.length !== 0 && (
|
||||
<RoomsCategory
|
||||
name="People"
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
}
|
||||
|
||||
& .room-selector {
|
||||
width: calc(100% - var(--sp-extra-tight));
|
||||
@include dir.side(margin, auto, 0);
|
||||
width: calc(100% - 2 * var(--sp-extra-tight));
|
||||
@include dir.side(margin, auto, auto);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue