diff --git a/app/frontend/src/components/message/message.css b/app/frontend/src/components/message/message.css index 5f631e8..611ca7f 100644 --- a/app/frontend/src/components/message/message.css +++ b/app/frontend/src/components/message/message.css @@ -1,46 +1,47 @@ .message { - max-width: 100%; + max-width: 100%; - display: grid; - grid-template-areas: - "title time" - "body body" - "tags tags" - "image image"; + display: grid; + grid-template-areas: + "title time" + "body body" + "tags tags" + "image image"; - grid-template-columns: repeat(2, minmax(0, 1fr)); - align-content: space-between; - padding: 10px; + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-content: space-between; + padding: 10px; } .messagetitle { - grid-area: title; - font-size: 1.2em; - padding-left: 5px; - overflow: hidden; - margin-top: 0px; + grid-area: title; + font-size: 1.2em; + padding-left: 5px; + overflow: hidden; + margin-top: 0px; } .messagetime { - grid-area: time; - justify-self: right; - padding-right: 5px; - margin-top: 0px; + grid-area: time; + justify-self: right; + padding-right: 5px; + margin-top: 0px; } .messagebody { - grid-area: body; - padding-left: 5px; - padding-right: 5px; + grid-area: body; + padding-left: 5px; + padding-right: 5px; + white-space: pre-line; } .messagetags { - grid-area: tags; + grid-area: tags; } .messageimage { - grid-area: image; - max-width: 100%; - max-height: 25vh; - justify-self: center; + grid-area: image; + max-width: 100%; + max-height: 25vh; + justify-self: center; } \ No newline at end of file diff --git a/app/frontend/src/components/message/message.tsx b/app/frontend/src/components/message/message.tsx index 8faee5e..ade385a 100644 --- a/app/frontend/src/components/message/message.tsx +++ b/app/frontend/src/components/message/message.tsx @@ -10,42 +10,41 @@ import type { MessageType } from '../../types/messagetype'; import style from './message.css'; type MessageProps = { - message: MessageType; + message: MessageType; } function timestampToString(timestamp: number): string { - const date = new Date(timestamp); - return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`; + const date = new Date(timestamp); + return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`; } const Message: FunctionalComponent = ({ message }: MessageProps) => { - const [receiveTimeStamp, setReceiveTimestamp] = useState(format(message.receivedAt)); + const [receiveTimeStamp, setReceiveTimestamp] = useState(format(message.receivedAt)); - useEffect(() => { - setReceiveTimestamp(format(message.receivedAt)); - const id = setInterval(() => setReceiveTimestamp(format(message.receivedAt)), 1000); - return () => clearInterval(id); - }, [message, setReceiveTimestamp]); + useEffect(() => { + setReceiveTimestamp(format(message.receivedAt)); + const id = setInterval(() => setReceiveTimestamp(format(message.receivedAt)), 1000); + return () => clearInterval(id); + }, [message, setReceiveTimestamp]); - // todo: - // - add a delete button - // - add a read status indicator - // - add a show more option on to many tags + // todo: + // - add a delete button + // - add a show more option on to many tags - return ( -
- -
-

{message.title}

-

{receiveTimeStamp}

-
{message.body}
- - {message.tags.map((tag: string) => ({({tag}) as any}) as any)} - - {message.icon && ()} -
-
-
) + return ( +
+ +
+

{message.title}

+

{receiveTimeStamp}

+
{message.body}
+ + {message.tags.map((tag: string) => ({({tag}) as any}) as any)} + + {message.icon && (user supplied content)} +
+
+
) } export default Message; \ No newline at end of file diff --git a/app/frontend/src/manifest.json b/app/frontend/src/manifest.json index e21f93f..cacca1c 100644 --- a/app/frontend/src/manifest.json +++ b/app/frontend/src/manifest.json @@ -55,7 +55,7 @@ "platform": "android" }, { - "src": "/assets/icons/desktop-screenshot.png", + "src": "/assets/screenshots/desktop-screenshot.png", "sizes": "2038x1301", "type": "image/png", "form_factor": "wide", @@ -63,7 +63,7 @@ "platform": "windows" }, { - "src": "/assets/icons/desktop-screenshot.png", + "src": "/assets/screenshots/desktop-screenshot.png", "sizes": "2038x1301", "type": "image/png", "form_factor": "wide",