From 9c2a769bbd050c9ff1e53f958531f580f462d46b Mon Sep 17 00:00:00 2001 From: nizune <9-nizune@users.noreply.gitlab.insrt.uk> Date: Fri, 2 Jul 2021 11:13:54 +0200 Subject: [PATCH] Fix: small fixes to friends menu --- src/pages/friends/Friend.module.scss | 9 +++++++-- src/pages/friends/Friend.tsx | 20 ++++++++++---------- src/pages/friends/Friends.tsx | 25 +++++++++++++------------ 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/pages/friends/Friend.module.scss b/src/pages/friends/Friend.module.scss index 5ac68fa..1db3b2d 100644 --- a/src/pages/friends/Friend.module.scss +++ b/src/pages/friends/Friend.module.scss @@ -1,10 +1,15 @@ .list { - padding: 16px; + padding: 0 20px 20px 20px; user-select: none; overflow-y: scroll; .overline { display: flex; + position: sticky; + top: 0; + background: var(--primary-background); + padding: 8px 0; + z-index: 10; } &[data-empty="true"] { @@ -67,7 +72,7 @@ display: flex; gap: 12px; - > div { + > a { height: 40px; width: 40px; diff --git a/src/pages/friends/Friend.tsx b/src/pages/friends/Friend.tsx index 6a6bbdc..dd51b26 100644 --- a/src/pages/friends/Friend.tsx +++ b/src/pages/friends/Friend.tsx @@ -29,18 +29,18 @@ export function Friend({ user }: Props) { subtext = <UserStatus user={user} /> actions.push( <> - <IconButton type="circle" - onClick={stopPropagation}> - <Link to={'/open/' + user._id}> + <Link to={'/open/' + user._id}> + <IconButton type="circle" + onClick={stopPropagation}> <PhoneCall size={20} /> - </Link> - </IconButton> - <IconButton type="circle" - onClick={stopPropagation}> - <Link to={'/open/' + user._id}> + </IconButton> + </Link> + <Link to={'/open/' + user._id}> + <IconButton type="circle" + onClick={stopPropagation}> <Envelope size={20} /> - </Link> - </IconButton> + </IconButton> + </Link> </> ); } diff --git a/src/pages/friends/Friends.tsx b/src/pages/friends/Friends.tsx index c331f34..c59bb9c 100644 --- a/src/pages/friends/Friends.tsx +++ b/src/pages/friends/Friends.tsx @@ -1,5 +1,5 @@ import styles from "./Friend.module.scss"; -import { UserPlus } from "@styled-icons/boxicons-regular"; +import { Conversation, UserPlus } from "@styled-icons/boxicons-solid"; import { Friend } from "./Friend"; import { Text } from "preact-i18n"; @@ -34,11 +34,12 @@ export default function Friends() { <div className={styles.title}> <Text id="app.navigation.tabs.friends" /> </div> - <div className="actions"> - <IconButton onClick={() => openScreen({ id: 'special_input', type: 'add_friend' })}> - <UserPlus size={24} /> - </IconButton> - </div> + <IconButton onClick={() => openScreen({ id: 'special_input', type: 'add_friend' })}> {/* TOFIX: Make sure this opens the "Start Group DM" window on click */} + <Conversation size={24} /> + </IconButton> + <IconButton onClick={() => openScreen({ id: 'special_input', type: 'add_friend' })}> + <UserPlus size={24} /> + </IconButton> </Header> <div className={styles.list} @@ -53,8 +54,8 @@ export default function Friends() { </> )} {pending.length > 0 && ( - <Overline type="subtle"> - <Text id="app.special.friends.pending" /> –{" "} + <Overline className={styles.overline} type="subtle"> + <Text id="app.special.friends.pending" /> —{" "} {pending.length} </Overline> )} @@ -62,8 +63,8 @@ export default function Friends() { <Friend key={y._id} user={y} /> ))} {friends.length > 0 && ( - <Overline type="subtle"> - <Text id="app.navigation.tabs.friends" /> –{" "} + <Overline className={styles.overline} type="subtle"> + <Text id="app.navigation.tabs.friends" /> —{" "} {friends.length} </Overline> )} @@ -71,8 +72,8 @@ export default function Friends() { <Friend key={y._id} user={y} /> ))} {blocked.length > 0 && ( - <Overline type="subtle"> - <Text id="app.special.friends.blocked" /> –{" "} + <Overline className={styles.overline} type="subtle"> + <Text id="app.special.friends.blocked" /> —{" "} {blocked.length} </Overline> )} -- GitLab