Hide message button from own profile (#2461)
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Sun, 24 Aug 2025 12:35:16 +0000 (18:05 +0530)
committerGitHub <noreply@github.com>
Sun, 24 Aug 2025 12:35:16 +0000 (22:35 +1000)
src/app/components/user-profile/UserRoomProfile.tsx

index e92d909825ed1d50ff67b673e9835de23cf35f98..b8b34d788289cdea4c3fcefd546c7b74bf7af90f 100644 (file)
@@ -95,25 +95,27 @@ export function UserRoomProfile({ userId }: UserRoomProfileProps) {
         <Box direction="Column" gap="400">
           <Box gap="400" alignItems="Start">
             <UserHeroName displayName={displayName} userId={userId} />
-            <Box shrink="No">
-              <Button
-                size="300"
-                variant="Primary"
-                fill="Solid"
-                radii="300"
-                disabled={directMessageState.status === AsyncStatus.Loading}
-                before={
-                  directMessageState.status === AsyncStatus.Loading ? (
-                    <Spinner size="50" variant="Primary" fill="Solid" />
-                  ) : (
-                    <Icon size="50" src={Icons.Message} filled />
-                  )
-                }
-                onClick={handleMessage}
-              >
-                <Text size="B300">Message</Text>
-              </Button>
-            </Box>
+            {userId !== myUserId && (
+              <Box shrink="No">
+                <Button
+                  size="300"
+                  variant="Primary"
+                  fill="Solid"
+                  radii="300"
+                  disabled={directMessageState.status === AsyncStatus.Loading}
+                  before={
+                    directMessageState.status === AsyncStatus.Loading ? (
+                      <Spinner size="50" variant="Primary" fill="Solid" />
+                    ) : (
+                      <Icon size="50" src={Icons.Message} filled />
+                    )
+                  }
+                  onClick={handleMessage}
+                >
+                  <Text size="B300">Message</Text>
+                </Button>
+              </Box>
+            )}
           </Box>
           {directMessageState.status === AsyncStatus.Error && (
             <Text style={{ color: color.Critical.Main }}>