From de9edf8e7ea261ae76011b43c57c83ec70cde22a Mon Sep 17 00:00:00 2001 From: "Lucian I. Last" Date: Wed, 1 May 2024 10:15:50 +0200 Subject: [PATCH] Complete isMe addressListItem --- .../AddressList/AddressListItem.tsx | 111 ++++++++++-------- app/src/pages/AddressList.tsx | 23 ++-- app/src/tailwind.css | 11 ++ 3 files changed, 90 insertions(+), 55 deletions(-) diff --git a/app/src/components/AddressList/AddressListItem.tsx b/app/src/components/AddressList/AddressListItem.tsx index 6e483b2c2..46f961ee7 100644 --- a/app/src/components/AddressList/AddressListItem.tsx +++ b/app/src/components/AddressList/AddressListItem.tsx @@ -1,6 +1,6 @@ import { IonItem, IonText, IonIcon } from "@ionic/react"; import { t } from "i18next"; -import { shield, pauseCircleSharp } from "ionicons/icons"; +import { shield, pauseCircleSharp, bag } from "ionicons/icons"; import { Bag, User } from "../../api/types"; import BagSVG from "../Bags/Svg"; @@ -30,64 +30,81 @@ export default function AddressListItem({ - -
- {user.name} - - {isHost ? ( - - ) : null} -
- - {isUserPaused ? ( - isChainAdmin ? ( - {user.address} - ) : null - ) : isAddressPrivate ? ( -   - ) : ( - {user.address} - )} - -
+ {isHost ? ( + + ) : null} {isUserPaused ? ( ) : ( - {"#" + number} + + # + {number} + )} -
- {bags.map((b) => ( -
- +
+
+
+ {user.name} +
+ + {isUserPaused ? ( + isChainAdmin ? ( + {user.address} + ) : null + ) : isAddressPrivate ? ( +   + ) : ( + {user.address} + )} + +
+
+
+ {bags.map((b) => ( +
+ +
+ ))}
- ))} +
); diff --git a/app/src/pages/AddressList.tsx b/app/src/pages/AddressList.tsx index 27dbbbdff..ec99293e0 100644 --- a/app/src/pages/AddressList.tsx +++ b/app/src/pages/AddressList.tsx @@ -15,7 +15,7 @@ import { IonTitle, IonToolbar, } from "@ionic/react"; -import { useContext, useMemo, useRef, useState } from "react"; +import { useContext, useEffect, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { StoreContext } from "../stores/Store"; import { openOutline, searchOutline } from "ionicons/icons"; @@ -59,6 +59,16 @@ export default function AddressList() { const [search, setSearch] = useState(""); const slowSearch = useDebounce(search, 500); + + useEffect(() => { + if (authUser) { + const el = document.querySelector("ali-" + authUser.uid); + el?.scrollIntoView({ + block: "center", + }); + } + }, []); + const routeListItems = useMemo(() => { const routeLength = route.length; if (!chain || routeLength === 0) return []; @@ -68,13 +78,10 @@ export default function AddressList() { } let topRouteIndex = 0; if (routeListView === "dynamic") { - const routePrivacy = chain.route_privacy || 2; - if (routePrivacy * 2 < routeLength) { - topRouteIndex = wrapIndex( - meRouteIndex - (routePrivacy <= 3 ? routePrivacy : 3), - routeLength, - ); - } + topRouteIndex = + routeLength < 6 + ? routeLength - 1 + : wrapIndex(meRouteIndex - 6, routeLength); console.log("topRouteIndex", topRouteIndex); } diff --git a/app/src/tailwind.css b/app/src/tailwind.css index 3d58461d0..5954373cf 100644 --- a/app/src/tailwind.css +++ b/app/src/tailwind.css @@ -81,6 +81,11 @@ rgba(255, 213, 52, 1) 40px ); } + .tw-shadow-bags { + box-shadow: 0px 0px 3px 2px #fff; + border-radius: 5px; + background-color: #fff; + } } ion-radio::part(container) { @@ -106,3 +111,9 @@ ion-radio.radio-checked::part(mark) { transform: rotate(45deg); } + +ion-item.ion-color-primary::part(detail-icon) { + --detail-icon-color: var(--ion-color-light) !important; + --detail-icon-opacity: 0.8; + /* display: none !important; */ +}