Skip to content

Commit 75b7025

Browse files
committed
style + hover fix
1 parent 9fff854 commit 75b7025

5 files changed

Lines changed: 53 additions & 33 deletions

File tree

components/forms/MiniProfile.tsx

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,45 @@ import UserIcon from '../icons/UserIcon';
77
import { SearchBar } from './Styles';
88

99
// TODO: Once DMs are implemented, this component will need to be updated to handle DMs as well.
10-
function WrappedComponent({ profile, server_user, roles }: { profile: User, server_user: ServerUser, roles: Role[] }) {
10+
function WrappedComponent({
11+
profile,
12+
server_user,
13+
roles,
14+
}: {
15+
profile: User;
16+
server_user: ServerUser;
17+
roles: Role[];
18+
}) {
1119
return (
1220
<div className="flex flex-col space-y-2 items-center p-3">
13-
<UserIcon user={profile} className='!w-9 !h-9'/>
14-
{ server_user.nickname && <h2 className='text-lg'>
15-
{server_user.nickname}
16-
</h2> }
17-
<h2 className={server_user.nickname ? 'text-base' : 'text-lg'}>{profile.username}</h2>
18-
<hr/>
19-
<h2 className='text-sm text-gray-400 text-left w-full'>Roles</h2>
20-
<div className='flex flex-col w-full items-center space-y-1'>
21-
{ roles.map(role => (
21+
<UserIcon user={profile} className="!w-9 !h-9" />
22+
{server_user.nickname && (
23+
<h2 className="text-lg">{server_user.nickname}</h2>
24+
)}
25+
<h2 className={server_user.nickname ? 'text-base' : 'text-lg'}>
26+
{profile.username}
27+
</h2>
28+
<hr />
29+
<h2 className="text-sm text-gray-400 text-left w-full">Roles</h2>
30+
<div className="flex flex-col w-full items-center space-y-1">
31+
{roles.map((role) => (
2232
<span
2333
key={role.id}
24-
className='text-sm text-gray-400 py-1 px-2 border-2 border-solid w-full rounded-sm'
34+
className="text-sm text-gray-400 py-1 px-2 border-2 border-solid w-full rounded-sm"
2535
style={{
2636
border: `1px solid #${!!role.color ? role.color : 'cacacacc'}`,
2737
color: `#${!!role.color ? role.color : 'cacacacc'}`,
2838
}}
2939
>
3040
{role.name}
3141
</span>
32-
)) }
42+
))}
3343
</div>
34-
<hr/>
44+
<hr />
3545
<form>
3646
<input
3747
type="text"
38-
className={`${SearchBar}`}
48+
className={`${SearchBar('bg-grey-900')}`}
3949
placeholder={`Message @${profile.username}`}
4050
/>
4151
</form>

components/forms/Styles.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ ${bg}
1717
flex-1`;
1818
}
1919

20-
export const SearchBar = `w-full
20+
export function SearchBar(bg = 'bg-grey-950 ') {
21+
return `w-full
2122
py-2
22-
pl-6
23+
pl-5
2324
self-start
2425
text-base
2526
font-normal
@@ -30,5 +31,6 @@ transition
3031
ease-in-out
3132
m-0
3233
focus:outline-none
33-
bg-grey-950
34+
${bg}
3435
flex-1`;
36+
}

components/home/MessageHeader.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,30 @@ export function MessageHeader({
1010
message_color,
1111
display_time,
1212
edited,
13-
roles
13+
roles,
1414
}: {
15-
profile: User,
16-
server_user: ServerUser,
17-
message_id: number,
18-
message_color: string,
19-
display_time: string,
20-
edited: boolean,
21-
roles: Role[],
15+
profile: User;
16+
server_user: ServerUser;
17+
message_id: number;
18+
message_color: string;
19+
display_time: string;
20+
edited: boolean;
21+
roles: Role[];
2222
}) {
2323
return (
2424
<div className="flex-grow flex flex-row">
25-
<Tooltip id={profile.id} className='z-20 !w-12' clickable noArrow>
26-
<MiniProfile profile={profile} server_user={server_user} roles={roles} />
25+
<Tooltip
26+
id={profile.id}
27+
className="z-20 !w-12 !opacity-100 "
28+
style={{ backgroundColor: '#21282b', borderRadius: '0.5rem' }}
29+
clickable
30+
noArrow
31+
>
32+
<MiniProfile
33+
profile={profile}
34+
server_user={server_user}
35+
roles={roles}
36+
/>
2737
</Tooltip>
2838
<UserIcon user={profile} />
2939
<div className="flex-grow flex items-center">
@@ -39,9 +49,7 @@ export function MessageHeader({
3949
</div>
4050
<div className="text-xs tracking-wider text-grey-300 mt-1">
4151
{display_time}{' '}
42-
{edited && (
43-
<span className="text-gray-400">(edited)</span>
44-
)}
52+
{edited && <span className="text-gray-400">(edited)</span>}
4553
</div>
4654
</div>
4755
</div>

components/home/RenderDesktopView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export default function RenderDesktopView() {
1616
const [sideBarView, mainView] = renderContent(sideBarOption, channel);
1717

1818
return (
19-
<div className={`${styles.container} `}>
19+
<div className={`${styles.container}`}>
2020
<div className="col-start-1 col-end-2 bg-grey-950 flex-col justify-center ">
2121
<NavBar type="vertical" />
2222
</div>
23-
<div className="col-start-2 col-end-4 flex-col bg-grey-900 ">
23+
<div className="col-start-2 col-end-4 flex-col bg-grey-900 h-screen overflow-y-scroll overflow-x-hidden">
2424
{sideBarView}
2525
</div>
2626
<div className="col-start-4 col-end-13 flex flex-col h-screen">

components/home/ServerList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function ServerList() {
6969
<div className="pt-4 pb-4">
7070
<input
7171
type="text"
72-
className={`${SearchBar}`}
72+
className={`${SearchBar()}`}
7373
placeholder="Search"
7474
></input>
7575
</div>

0 commit comments

Comments
 (0)