From 0d88286ffd1587c52021269668134a4d21a1aa78 Mon Sep 17 00:00:00 2001 From: kawamataryo Date: Sun, 1 Dec 2024 22:17:26 +0900 Subject: [PATCH] design: fix user card --- src/lib/components/DetectedUserListItem.tsx | 38 ++++++++---- src/lib/components/DetectedUserSource.tsx | 8 +-- src/lib/components/Sidebar.tsx | 67 ++++++++++----------- src/lib/components/UserCard.tsx | 2 +- src/lib/constants.ts | 2 +- src/options.tsx | 22 +++---- tailwind.config.js | 2 +- 7 files changed, 72 insertions(+), 69 deletions(-) diff --git a/src/lib/components/DetectedUserListItem.tsx b/src/lib/components/DetectedUserListItem.tsx index 633452d..46a06de 100644 --- a/src/lib/components/DetectedUserListItem.tsx +++ b/src/lib/components/DetectedUserListItem.tsx @@ -2,7 +2,7 @@ import type { ProfileView } from "@atproto/api/dist/client/types/app/bsky/actor/ import React from "react"; import { match } from "ts-pattern"; import type { BskyUser } from "~types"; -import { ACTION_MODE } from "../constants"; +import { ACTION_MODE, MATCH_TYPE_LABEL_AND_COLOR } from "../constants"; import DetectedUserSource from "./DetectedUserSource"; import UserCard from "./UserCard"; export type Props = { @@ -100,18 +100,32 @@ const DetectedUserListItem = ({ }); }; + const matchTypeColor = MATCH_TYPE_LABEL_AND_COLOR[user.matchType].color; + return ( -
- - +
+
+
+
+ {MATCH_TYPE_LABEL_AND_COLOR[user.matchType].label} +
+
+
+
+ + +
+
); }; diff --git a/src/lib/components/DetectedUserSource.tsx b/src/lib/components/DetectedUserSource.tsx index ef9ddf7..822c588 100644 --- a/src/lib/components/DetectedUserSource.tsx +++ b/src/lib/components/DetectedUserSource.tsx @@ -1,7 +1,5 @@ -import type { ProfileView } from "@atproto/api/dist/client/types/app/bsky/actor/defs"; import React from "react"; import type { BskyUser } from "~types"; -import { MATCH_TYPE_LABEL_AND_COLOR } from "../constants"; import UserInfo from "./UserInfo"; import UserProfile from "./UserProfile"; @@ -11,11 +9,7 @@ type DetectedUserSourceProps = { const DetectedUserSource = ({ user }: DetectedUserSourceProps) => (
-
+
Sky Follower Bridge
-
- - - - -

Detected

-
-
-
-

{detectedCount}

-

users

-
-
-
- {Object.keys(matchTypeStats).map((key) => ( -
- {MATCH_TYPE_LABEL_AND_COLOR[key].label}: - - {matchTypeStats[key]} - +
+
+
+ + + +
+
+ Detected users +
+
{detectedCount}
+
+ Same handle name: {matchTypeStats[BSKY_USER_MATCH_TYPE.HANDLE]}
- ))} +
+ Same display name:{" "} + {matchTypeStats[BSKY_USER_MATCH_TYPE.DISPLAY_NAME]} +
+
+ Included handle in description:{" "} + {matchTypeStats[BSKY_USER_MATCH_TYPE.DESCRIPTION]} +
+
diff --git a/src/lib/components/UserCard.tsx b/src/lib/components/UserCard.tsx index f2eceba..136399f 100644 --- a/src/lib/components/UserCard.tsx +++ b/src/lib/components/UserCard.tsx @@ -53,7 +53,7 @@ const UserCard = ({ handleReSearchClick, }: UserCardProps) => { return ( -
+
{

Source

Detected

-
-
- {filteredUsers.map((user) => ( - - ))} -
+
+ {filteredUsers.map((user) => ( + + ))}