Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Use border as background color
Browse files Browse the repository at this point in the history
  • Loading branch information
mybearworld committed Aug 6, 2024
1 parent d3b9e97 commit 9103397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/Mention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Mention = (props: MentionProps) => {
username={props.username}
dontShowOnline
size="w-5 h-5 min-w-5 min-h-5"
smallBorderPadding
/>
: undefined}
</span>
Expand Down
15 changes: 10 additions & 5 deletions src/components/ProfilePicture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type ProfilePictureProps = {
className?: string;
dontShowOnline?: boolean;
size?: string;
smallBorderPadding?: boolean;
};
export const ProfilePicture = (props: ProfilePictureProps) => {
const [user, loadUser, ulist] = useAPI(
Expand All @@ -34,6 +35,7 @@ export const ProfilePicture = (props: ProfilePictureProps) => {
ulist.includes(props.username)
: false
}
smallBorderPadding={props.smallBorderPadding}
size={props.size}
/>
);
Expand All @@ -43,6 +45,7 @@ export type ChatProfilePictureProps = {
chat: string | undefined;
className?: string;
size?: string;
smallBorderPadding?: boolean;
};
export const ChatProfilePicture = (props: ChatProfilePictureProps) => {
const [chat, loadChat] = useAPI(
Expand All @@ -68,6 +71,7 @@ export const ChatProfilePicture = (props: ChatProfilePictureProps) => {
}
className={props.className}
size={props.size}
smallBorderPadding={props.smallBorderPadding}
placeholder={22}
/>
);
Expand All @@ -83,6 +87,7 @@ export type ProfilePictureBaseProps = {
online?: boolean;
size?: string;
placeholder?: number;
smallBorderPadding?: boolean;
};
export const ProfilePictureBase = (props: ProfilePictureBaseProps) => {
const settings = useAPI((state) => state.settings);
Expand All @@ -95,21 +100,21 @@ export const ProfilePictureBase = (props: ProfilePictureBaseProps) => {
>
<img
className={twMerge(
"rounded-lg border border-[--border-color] [border-style:--border-style]",
"rounded-lg bg-[--border-color]",
props.className,
props.smallBorderPadding ? "p-[0.0625rem]" : "p-0.5",
props.size ?? "h-10 min-h-10 w-10 min-w-10",
)}
style={
{
"--border-color": "#" + props.pfp.avatar_color,
"--border-style":
"--border-color":
(
settings.avatarBorders &&
props.pfp.avatar &&
props.pfp.avatar_color !== "!color"
) ?
"solid"
: "none",
"#" + props.pfp.avatar_color
: "transparent",
} as CSSProperties
}
src={
Expand Down

0 comments on commit 9103397

Please sign in to comment.