Skip to content

Commit 3e04fb8

Browse files
committed
declared bankruptcy for changing classnames to tailwind css, removed light mode for now cause it was bugging out on me, and changed the input text to white
1 parent 4992b8b commit 3e04fb8

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

api/main_endpoints/models/ChatMessage.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@ ChatMessageSchema.index({chatroomId: 1, createdAt: -1}); // sort by whatever is
3131
ChatMessageSchema.index({expiresAt: 1}, {expireAfterSeconds: 0}); // TTL index for automatic expiration
3232

3333
module.exports = mongoose.model('ChatMessage', ChatMessageSchema);
34-
35-

src/Components/ShortcutKeyModal/SearchModal.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
/* blurred background */
99
display: flex;
1010
justify-content: center;
11-
align-items: flex-start;
12-
padding-top: 33vh;
11+
align-items: center;
1312
z-index: 9999;
1413
}
1514

1615
.shortcut-search-modal .input-wrapper {
1716
padding: 8px;
1817
background: white;
1918
border-radius: 8px;
20-
width: 35rem;
19+
width: 100%;
20+
/* the default is the mobile size */
21+
max-width: 500px;
2122
}
2223

2324
.shortcut-search-modal input {
@@ -67,3 +68,11 @@
6768
background-color: #1e293b;
6869
}
6970
}
71+
72+
/* Desktop mode */
73+
@media (min-width: 768px) {
74+
.shortcut-search-modal .input-wrapper {
75+
width: 35rem;
76+
max-width: none;
77+
}
78+
}

src/Components/ShortcutKeyModal/SearchModal.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,30 @@ export default function SearchModal() {
7777

7878
const topFiveItems = suggestions.slice(0, SHORTCUT_MAX_RESULT);
7979
return (
80-
<ul className='suggestion-list'>
80+
<ul className='suggestion-list bg-slate-800 text-[1.2rem] overflow-x-hidden mt-2'>
8181
{topFiveItems.map((r, index) => (
8282
<li
8383
key={r.path} // Use r.path as key
84-
className={`suggestion-item ${index === selectItem ? 'active' : ''}`}
84+
className={`h-16 flex items-center p-2 truncate cursor-pointer ${index === selectItem ? ' bg-slate-500 text-white rounded p-1' : ''}`}
8585
onMouseMove={() => setSelectItem(index)}
8686
onClick={() => {
8787
if (externalSiteRoute(r)) return;
8888
window.location.href = r.path;
8989
setOpen(false);
9090
}}
9191
>
92-
<span style={{ marginRight: '0.5rem' }}>
93-
{r.type === 'user' ? '👤' : '📄'}
94-
</span>
95-
<div className='text-wrapper'>
96-
{r.pageName}
97-
<div className='hidden-tab'>
98-
{selectItem === index && (r.type === 'external_url' ? r.path : `${window.location.origin}${r.path}`)}
92+
<div className='flex-col overflow-hidden'>
93+
<div className='flex items-center truncate'>
94+
<span className='mr-3'>
95+
{r.type === 'user' ? '👤' : '📄'}
96+
</span>
97+
<span className='font-bold truncate text-white'>
98+
{r.pageName}
99+
</span>
99100
</div>
101+
<span className="text-sm truncate text-gray-300">
102+
{r.type === 'external_url' ? r.path : window.location.origin + r.path}
103+
</span>
100104
</div>
101105
</li>
102106
))}
@@ -274,14 +278,16 @@ export default function SearchModal() {
274278
if (!open) return null;
275279

276280
return (
277-
<div className='shortcut-search-modal'>
281+
<div className='fixed inset-0 bg-black/40 backdrop-blur-sm flex justify-center items-center z-[9999]'>
278282
<div ref={modalRef}>
279-
<div className='input-wrapper'>
283+
<div className='p-2 bg-slate-800 rounded-lg w-full max-w-[500px] md:w-[35rem] md:max-w-none'>
280284
<input
281285
ref={inputRef}
282286
placeholder="Search here... (Ctrl + k)"
283287
value={keyword}
284-
onChange={handleChanges} />
288+
onChange={handleChanges}
289+
className='border-[1.5px] text-white border-gray-600 w-full rounded p-3 h-10 text-[1.2rem] bg-transparent focus:outline-sky-600'
290+
/>
285291
<SuggestionsList />
286292
</div>
287293
<div>

0 commit comments

Comments
 (0)