Skip to content

Commit

Permalink
add block message in profile pane
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Jan 8, 2024
1 parent 1e16e0d commit 6f8c131
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/chat-api/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export async function registerRequest(email: string, username: string, password:
}

export interface UserDetails {
block: boolean;
user: RawUser & {
_count: {
followers: number,
Expand Down
12 changes: 11 additions & 1 deletion src/components/profile-pane/ProfilePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,15 @@ function SideBar(props: { user: UserDetails }) {

return (
<div class={styles.sidePane}>
<Show when={props.user.block}>
<SidePaneItem
icon="block"
label="You've been blocked"
color="var(--alert-color)"
value="This user has blocked you."
onClick={() => setToggleJoinedDateType(!toggleJoinedDateType())}
/>
</Show>
<UserActivity userId={props.user.user.id} />
<SidePaneItem
icon="event"
Expand Down Expand Up @@ -777,11 +786,12 @@ function SidePaneItem(props: {
icon: string;
label: string;
value: string;
color?: string;
onClick?: () => void;
}) {
return (
<div class={styles.SidePaneItem} onClick={props.onClick}>
<Icon name={props.icon} size={18} color="var(--primary-color)" />
<Icon name={props.icon} size={18} color={props.color || "var(--primary-color)"} />
<FlexColumn>
<div class={styles.label}>{props.label}</div>
<div class={styles.value}>{props.value}</div>
Expand Down

0 comments on commit 6f8c131

Please sign in to comment.