Compare commits
3 commits
dev
...
settings-s
Author | SHA1 | Date | |
---|---|---|---|
12b5d754fd | |||
973c7dea8f | |||
0bd6b25979 |
9 changed files with 16 additions and 54 deletions
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"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.tsx"></script>
|
||||
<script type="module" src="./src/index.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
22
package-lock.json
generated
22
package-lock.json
generated
|
@ -14,7 +14,6 @@
|
|||
"@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",
|
||||
|
@ -44,7 +43,6 @@
|
|||
"@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",
|
||||
|
@ -1117,12 +1115,6 @@
|
|||
"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",
|
||||
|
@ -1134,20 +1126,6 @@
|
|||
"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": "npm run check:eslint && npm run check:prettier",
|
||||
"lint": "yarn check:eslint && yarn check:prettier",
|
||||
"check:eslint": "eslint src/*",
|
||||
"check:prettier": "prettier --check .",
|
||||
"fix:prettier": "prettier --write .",
|
||||
|
@ -24,7 +24,6 @@
|
|||
"@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",
|
||||
|
@ -54,7 +53,6 @@
|
|||
"@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,18 +1,14 @@
|
|||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import dateFormat from "dateformat";
|
||||
import { isInSameDay } from "../../../util/common";
|
||||
|
||||
export interface TimeProps {
|
||||
timestamp: number;
|
||||
fullTime?: boolean;
|
||||
}
|
||||
|
||||
function Time({ timestamp, fullTime }: TimeProps) {
|
||||
function Time({ timestamp, fullTime }) {
|
||||
const date = new Date(timestamp);
|
||||
|
||||
const formattedFullTime = dateFormat(date, "dd mmmm yyyy, hh:MM TT");
|
||||
let formattedDateTime = formattedFullTime;
|
||||
let formattedDate = formattedFullTime;
|
||||
|
||||
if (!fullTime) {
|
||||
const compareDate = new Date();
|
||||
|
@ -20,21 +16,18 @@ function Time({ timestamp, fullTime }: TimeProps) {
|
|||
compareDate.setDate(compareDate.getDate() - 1);
|
||||
const isYesterday = isInSameDay(date, compareDate);
|
||||
|
||||
const dtf = new Intl.DateTimeFormat();
|
||||
const formattedDate = dtf.format(date);
|
||||
|
||||
formattedDateTime = dateFormat(
|
||||
formattedDate = dateFormat(
|
||||
date,
|
||||
isToday || isYesterday ? "hh:MM TT" : formattedDate
|
||||
isToday || isYesterday ? "hh:MM TT" : "dd/mm/yyyy"
|
||||
);
|
||||
if (isYesterday) {
|
||||
formattedDateTime = `Yesterday, ${formattedDateTime}`;
|
||||
formattedDate = `Yesterday, ${formattedDate}`;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<time dateTime={date.toISOString()} title={formattedFullTime}>
|
||||
{formattedDateTime}
|
||||
{formattedDate}
|
||||
</time>
|
||||
);
|
||||
}
|
||||
|
@ -43,4 +36,9 @@ Time.defaultProps = {
|
|||
fullTime: false,
|
||||
};
|
||||
|
||||
Time.propTypes = {
|
||||
timestamp: PropTypes.number.isRequired,
|
||||
fullTime: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default Time;
|
|
@ -97,14 +97,6 @@ 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% - 2 * var(--sp-extra-tight));
|
||||
@include dir.side(margin, auto, auto);
|
||||
width: calc(100% - var(--sp-extra-tight));
|
||||
@include dir.side(margin, auto, 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue