diff --git a/Components/Users/ShowSearchedFriend.tsx b/Components/Users/ShowSearchedFriend.tsx
index e625256..49cc394 100644
--- a/Components/Users/ShowSearchedFriend.tsx
+++ b/Components/Users/ShowSearchedFriend.tsx
@@ -1,3 +1,4 @@
+import { convertPictureURL } from '@/hooks/Common/users';
import { User } from '@/types';
import Image from 'next/image';
import Link from 'next/link';
@@ -15,10 +16,7 @@ const ShowSearchedFriend = ({
return (
{searchedUserUpToFour?.map((user) => {
- const picture =
- user.picture.trim().split('.')[0] === 'https://avatars'
- ? user.picture
- : '/icon_cat.svg';
+ const picture = convertPictureURL(user.picture);
return (
{
const cookieStore = cookies();
@@ -23,7 +23,7 @@ const Users = async () => {
친구{allUsersExceptMe?.length}명
-
+
);
diff --git a/app/users/users.type.ts b/app/users/users.type.ts
new file mode 100644
index 0000000..78ce70f
--- /dev/null
+++ b/app/users/users.type.ts
@@ -0,0 +1,5 @@
+import { User } from '@/types';
+
+export type UserHasOnline = User & {
+ isOnline: boolean;
+};
diff --git a/hooks/Common/users.ts b/hooks/Common/users.ts
new file mode 100644
index 0000000..5c86d79
--- /dev/null
+++ b/hooks/Common/users.ts
@@ -0,0 +1,12 @@
+export const convertPictureURL = (url: string) => {
+ const splitByDot = url.split('.com');
+ if (
+ splitByDot.length > 1 &&
+ (splitByDot[0] === 'http://res.cloudinary' ||
+ splitByDot[0] === 'https://gravatar' ||
+ splitByDot[0] === 'https://avatars.githubusercontent')
+ ) {
+ return url;
+ }
+ return '/icon_cat.svg';
+};
diff --git a/public/icon_gray_dot.svg b/public/icon_gray_dot.svg
new file mode 100644
index 0000000..c03b334
--- /dev/null
+++ b/public/icon_gray_dot.svg
@@ -0,0 +1,3 @@
+
diff --git a/public/icon_green_dot.svg b/public/icon_green_dot.svg
new file mode 100644
index 0000000..bb9a3eb
--- /dev/null
+++ b/public/icon_green_dot.svg
@@ -0,0 +1,3 @@
+