From 5d9cefcf927eb10742bf1ac36960170cabea3c5f Mon Sep 17 00:00:00 2001 From: Anton Bochkovskyi <98012691+firehawk89@users.noreply.github.com> Date: Mon, 25 Sep 2023 22:09:26 +0300 Subject: [PATCH] Add message component (#12) PR: https://github.com/dev-KPI/messenger-frontend/pull/12 --- .eslintrc.json | 5 ++++- public/icons/avatar.svg | 4 ++++ src/app/global.css | 5 +++-- src/app/{layout.js => layout.jsx} | 4 +++- src/app/page.js | 5 ----- src/app/page.jsx | 26 ++++++++++++++++++++++++++ src/components/message.jsx | 25 +++++++++++++++++++++++++ src/utils/getFormattedDate.js | 7 +++++++ 8 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 public/icons/avatar.svg rename src/app/{layout.js => layout.jsx} (58%) delete mode 100644 src/app/page.js create mode 100644 src/app/page.jsx create mode 100644 src/components/message.jsx create mode 100644 src/utils/getFormattedDate.js diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..d2a18fa 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,6 @@ { - "extends": "next/core-web-vitals" + "extends": "next/core-web-vitals", + "rules": { + "react/no-unescaped-entities": "off" + } } diff --git a/public/icons/avatar.svg b/public/icons/avatar.svg new file mode 100644 index 0000000..fd7f2c9 --- /dev/null +++ b/public/icons/avatar.svg @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/src/app/global.css b/src/app/global.css index 02a103f..c2e1b21 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -2,6 +2,7 @@ @tailwind components; @tailwind utilities; -.body { - @apply h-screen flex items-center justify-center bg-slate-300; +html, +body { + @apply min-h-screen; } diff --git a/src/app/layout.js b/src/app/layout.jsx similarity index 58% rename from src/app/layout.js rename to src/app/layout.jsx index 70e0f63..175b4fd 100644 --- a/src/app/layout.js +++ b/src/app/layout.jsx @@ -5,7 +5,9 @@ import './global.css' export default function RootLayout({ children }) { return ( -
{children} + +{children}
+ {formatTime(sentAt)} +