From 8ced3d17d243b8d1398628f5d5607dffb9ea9621 Mon Sep 17 00:00:00 2001 From: Sushant khadka <87481819+NamelesssNerd@users.noreply.github.com> Date: Sat, 7 Oct 2023 23:10:21 +0545 Subject: [PATCH 1/6] feat: avatar's background color will be random. (#31) --- .d.ts | 1 + .../Dashboard/DashboardSidebar/index.tsx | 13 ++--- package.json | 3 ++ yarn.lock | 47 +++++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 .d.ts diff --git a/.d.ts b/.d.ts new file mode 100644 index 00000000..ab357faf --- /dev/null +++ b/.d.ts @@ -0,0 +1 @@ +declare module 'core-js/actual' \ No newline at end of file diff --git a/components/Dashboard/DashboardSidebar/index.tsx b/components/Dashboard/DashboardSidebar/index.tsx index bf6a98fc..89239d16 100644 --- a/components/Dashboard/DashboardSidebar/index.tsx +++ b/components/Dashboard/DashboardSidebar/index.tsx @@ -11,7 +11,7 @@ import { import Image from 'next/image' import Link from 'next/link' import { usePathname } from 'next/navigation' -import { Fragment } from 'react' +import { Fragment, use, useState } from 'react' import { DropdownMenu, @@ -21,7 +21,7 @@ import { import { useSelectedProject } from '@/hooks/query/project' import { useCurrentUser } from '@/hooks/query/user' import { cn } from '@/lib/utils' - +import Avatar from "react-avatar" const routes = [ { name: 'COLLECT', @@ -75,7 +75,6 @@ const DashboardSidebar: React.FC = () => { const pathname = usePathname() const { user } = useCurrentUser() const { project } = useSelectedProject() - return (
- {user?.firstName.charAt(0)} - {user?.lastName?.charAt(0)} -
+ <> +
{user?.firstName} {user?.lastName}
diff --git a/package.json b/package.json
index e2a62ccb..86858647 100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.0",
+ "core-js-pure": "^3.33.0",
"date-fns": "^2.30.0",
"eslint": "8.46.0",
"eslint-config-next": "13.4.13",
@@ -42,6 +43,7 @@
"next-themes": "^0.2.1",
"postcss": "8.4.27",
"react": "18.2.0",
+ "react-avatar": "^5.0.3",
"react-colorful": "^5.6.1",
"react-device-frameset": "^1.3.4",
"react-dom": "18.2.0",
@@ -60,6 +62,7 @@
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/client-preset": "4.1.0",
"@graphql-codegen/introspection": "4.0.0",
+ "@types/core-js": "^2.5.6",
"concurrently": "^8.2.0",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.3"
diff --git a/yarn.lock b/yarn.lock
index b7e7a575..5f160127 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1767,6 +1767,11 @@
"@tanstack/query-core" "4.32.6"
use-sync-external-store "^1.2.0"
+"@types/core-js@^2.5.6":
+ version "2.5.6"
+ resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-2.5.6.tgz#b06885ab91decdc4045215dbc4edbf02f061900d"
+ integrity sha512-zLzoC7avO4EYUUYCSzDaahSP1QJEpZQcPxqs91mPeFdh2NS4hQBcnRoEc9RuXfJ8cdN/KXUWukMmZGcKaWeOvw==
+
"@types/js-yaml@^4.0.0":
version "4.0.5"
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138"
@@ -2389,6 +2394,11 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
+charenc@0.0.2:
+ version "0.0.2"
+ resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
+ integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==
+
chokidar@^3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
@@ -2574,6 +2584,11 @@ copy-anything@^3.0.2:
dependencies:
is-what "^4.1.8"
+core-js-pure@^3.33.0:
+ version "3.33.0"
+ resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.33.0.tgz#938a28754b4d82017a7a8cbd2727b1abecc63591"
+ integrity sha512-FKSIDtJnds/YFIEaZ4HszRX7hkxGpNKM7FC9aJ9WLJbSd3lD4vOltFuVIBLR8asSx9frkTSqL0dw90SKQxgKrg==
+
cosmiconfig@^8.1.0, cosmiconfig@^8.1.3:
version "8.2.0"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.2.0.tgz#f7d17c56a590856cd1e7cee98734dca272b0d8fd"
@@ -2600,6 +2615,11 @@ cross-spawn@^7.0.2:
shebang-command "^2.0.0"
which "^2.0.1"
+crypt@0.0.2:
+ version "0.0.2"
+ resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
+ integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==
+
cssesc@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
@@ -3661,6 +3681,11 @@ is-boolean-object@^1.1.0:
call-bind "^1.0.2"
has-tostringtag "^1.0.0"
+is-buffer@~1.1.6:
+ version "1.1.6"
+ resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
+ integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
+
is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
@@ -3746,6 +3771,11 @@ is-relative@^1.0.0:
dependencies:
is-unc-path "^1.0.0"
+is-retina@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-retina/-/is-retina-1.0.3.tgz#d7401b286bea2ae37f62477588de504d0b8647e3"
+ integrity sha512-/tCmbIETZwCd8uHWO+GvbRa7jxwHFHdfetHfiwoP0aN9UDf3prUJMtKn7iBFYipYhqY1bSTjur8hC/Dakt8eyw==
+
is-shared-array-buffer@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79"
@@ -4045,6 +4075,15 @@ map-cache@^0.2.0:
resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==
+md5@^2.0.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f"
+ integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==
+ dependencies:
+ charenc "0.0.2"
+ crypt "0.0.2"
+ is-buffer "~1.1.6"
+
merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
@@ -4602,6 +4641,14 @@ queue-microtask@^1.2.2:
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
+react-avatar@^5.0.3:
+ version "5.0.3"
+ resolved "https://registry.yarnpkg.com/react-avatar/-/react-avatar-5.0.3.tgz#42c6b7dc992a2e73fe83c0a1c2ceeac4c7bfae21"
+ integrity sha512-DNc+qkWH9QehSEZqHBhqpXWsPY+rU9W7kD68QFHfu8Atfsvx/3ML0DzAePgTUd96nCXQQ3KZMcC3LKYT8FiBIg==
+ dependencies:
+ is-retina "^1.0.3"
+ md5 "^2.0.0"
+
react-colorful@^5.6.1:
version "5.6.1"
resolved "https://registry.yarnpkg.com/react-colorful/-/react-colorful-5.6.1.tgz#7dc2aed2d7c72fac89694e834d179e32f3da563b"
From dafad02cf82bb6f5fb095e9413501e5086ef08f3 Mon Sep 17 00:00:00 2001
From: Sushant khadka <87481819+NamelesssNerd@users.noreply.github.com>
Date: Sat, 7 Oct 2023 23:10:28 +0545
Subject: [PATCH 2/6] feat: avatar's background color will be random. (#31)
---
components/Dashboard/DashboardSidebar/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/Dashboard/DashboardSidebar/index.tsx b/components/Dashboard/DashboardSidebar/index.tsx
index 89239d16..2d9a370e 100644
--- a/components/Dashboard/DashboardSidebar/index.tsx
+++ b/components/Dashboard/DashboardSidebar/index.tsx
@@ -97,7 +97,7 @@ const DashboardSidebar: React.FC = () => {
) : (
<>
-
From 9b97b49c64a96bbb1b6f879fc95e81a0d17cbeae Mon Sep 17 00:00:00 2001 From: Sushant khadka <87481819+NamelesssNerd@users.noreply.github.com> Date: Sat, 7 Oct 2023 23:12:23 +0545 Subject: [PATCH 3/6] pulled from remote repo --- components/Dashboard/DashboardSidebar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Dashboard/DashboardSidebar/index.tsx b/components/Dashboard/DashboardSidebar/index.tsx index bf6a98fc..67d77d49 100644 --- a/components/Dashboard/DashboardSidebar/index.tsx +++ b/components/Dashboard/DashboardSidebar/index.tsx @@ -97,7 +97,7 @@ const DashboardSidebar: React.FC = () => { /> ) : ( - +
{user?.firstName.charAt(0)}
{user?.lastName?.charAt(0)}
From 80fc18a38a53d6d8373c49e87884e53fc39df589 Mon Sep 17 00:00:00 2001
From: Sushant khadka <87481819+NamelesssNerd@users.noreply.github.com>
Date: Sat, 7 Oct 2023 23:13:05 +0545
Subject: [PATCH 4/6] feat: avatar's background color will be random. (#31)
---
.d.ts | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 .d.ts
diff --git a/.d.ts b/.d.ts
deleted file mode 100644
index ab357faf..00000000
--- a/.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-declare module 'core-js/actual'
\ No newline at end of file
From 5e6744f0591086b94e9220f371c0f4c5c21f47b7 Mon Sep 17 00:00:00 2001
From: Sushant khadka <87481819+NamelesssNerd@users.noreply.github.com>
Date: Sat, 7 Oct 2023 23:32:29 +0545
Subject: [PATCH 5/6] feat: avatar's background color will be random. (#31)
---
components/Dashboard/DashboardSidebar/index.tsx | 3 ++-
package.json | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/components/Dashboard/DashboardSidebar/index.tsx b/components/Dashboard/DashboardSidebar/index.tsx
index 2d9a370e..5c66b33a 100644
--- a/components/Dashboard/DashboardSidebar/index.tsx
+++ b/components/Dashboard/DashboardSidebar/index.tsx
@@ -11,7 +11,7 @@ import {
import Image from 'next/image'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
-import { Fragment, use, useState } from 'react'
+import { Fragment, } from 'react'
import {
DropdownMenu,
@@ -22,6 +22,7 @@ import { useSelectedProject } from '@/hooks/query/project'
import { useCurrentUser } from '@/hooks/query/user'
import { cn } from '@/lib/utils'
import Avatar from "react-avatar"
+
const routes = [
{
name: 'COLLECT',
diff --git a/package.json b/package.json
index 86858647..ab78e634 100644
--- a/package.json
+++ b/package.json
@@ -67,4 +67,4 @@
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.3"
}
-}
+}
\ No newline at end of file
From c0b8a02d773f4ba318eec51fc7dd2b1a57d08def Mon Sep 17 00:00:00 2001
From: Sushant khadka <87481819+NamelesssNerd@users.noreply.github.com>
Date: Sat, 7 Oct 2023 23:33:41 +0545
Subject: [PATCH 6/6] feat: avatar's background color will be random. (#31)
---
components/Dashboard/DashboardSidebar/index.tsx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/components/Dashboard/DashboardSidebar/index.tsx b/components/Dashboard/DashboardSidebar/index.tsx
index 5c66b33a..7141d8bc 100644
--- a/components/Dashboard/DashboardSidebar/index.tsx
+++ b/components/Dashboard/DashboardSidebar/index.tsx
@@ -97,9 +97,7 @@ const DashboardSidebar: React.FC = () => {
/>
) : (
- <>
-
{user?.firstName} {user?.lastName}