- {props.items.length ? (
- props.items.map((item, index) => (
-
- ))
- ) : (
-
No result
- )}
+
+ {items.length > 0 ? (
+ items.map((item, index) => {
+ const displayName = getDisplayedName(
+ item.displayName ?? item.handle,
+ )
+ const isSelected = selectedIndex === index
+
+ return (
+
+
+
+
+ {displayName}
+
+
+
+ {item.handle}
+
+
+ )
+ })
+ ) : (
+
+ No result
+
+ )}
+
)
},
)
+
+const styles = StyleSheet.create({
+ container: {
+ width: 500,
+ borderRadius: 6,
+ borderWidth: 1,
+ borderStyle: 'solid',
+ padding: 4,
+ },
+ mentionContainer: {
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ flexDirection: 'row',
+ paddingHorizontal: 12,
+ paddingVertical: 8,
+ gap: 4,
+ },
+ firstMention: {
+ borderTopLeftRadius: 2,
+ borderTopRightRadius: 2,
+ },
+ lastMention: {
+ borderBottomLeftRadius: 2,
+ borderBottomRightRadius: 2,
+ },
+ avatarAndDisplayName: {
+ display: 'flex',
+ flexDirection: 'row',
+ alignItems: 'center',
+ gap: 6,
+ },
+ noResult: {
+ paddingHorizontal: 12,
+ paddingVertical: 8,
+ },
+})
diff --git a/web/index.html b/web/index.html
index f88fd727b3..f518665ca4 100644
--- a/web/index.html
+++ b/web/index.html
@@ -110,27 +110,7 @@
outline: 0;
}
.tippy-content .items {
- border-radius: 6px;
- background: #F3F3F8;
- border: 1px solid #e0d9d9;
- padding: 3px 3px;
- }
- .tippy-content .items .item {
- display: block;
- background: transparent;
- color: #8a8c9a;
- border: 0;
- font: 17px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
- padding: 7px 10px 8px;
- width: 100%;
- text-align: left;
- box-sizing: border-box;
- letter-spacing: 0.2px;
- }
- .tippy-content .items .item.is-selected {
- background: #fff;
- border-radius: 4px;
- color: #333;
+ width: fit-content;
}