Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribute element container exceeds screen width on mobile #919 #959

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 82 additions & 9 deletions frontend/index.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what's going on here at all.. 👀
This is how the page looks now:
Screenshot 2025-03-01 at 5 55 35 PM

Original file line number Diff line number Diff line change
@@ -1,13 +1,86 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="https://owasp.org/www--site-theme/favicon.ico" />
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" type="image/png" href="https://owasp.org/www--site-theme/favicon.ico">
<title>OWASP Nest</title>
</head>
<body>
<div id="root"></div>
<style>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have style here in the middle of the template of all the places? 🤔
and we normally do not have CSS in our files

* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f8f9fa;
}

#root {
width: 100%;
max-width: 600px;
padding: 10px;
}

.container {
width: 100%;
max-width: 100%;
padding: 16px;
background: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
}


.contribute {
width: 100%;
max-width: 100%;
padding: 16px;
background: #f1f1f1;
border-radius: 8px;
text-align: center;
}

.projects {
width: 100%;
max-width: 100%;
padding: 16px;
background: #e3e3e3;
border-radius: 8px;
text-align: center;
}


@media (max-width: 768px) {
.container, .contribute, .projects {
width: 100%;
max-width: 100%;
padding: 12px;
}
}
</style>
</head>
<body>
<div id="root">
<div class="container">
<h1>Welcome to OWASP Nest</h1>
<div class="projects">
<h2>Projects</h2>
<p>Explore various security projects.</p>
</div>
<div class="contribute">
<h2>Contribute</h2>
<p>Join and contribute to the community.</p>
</div>
</div>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</body>
</html>
6 changes: 2 additions & 4 deletions frontend/src/components/MultiSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ const MultiSearchBar: React.FC<MultiSearchBarProps> = ({
if (event.key === 'Escape') {
setShowSuggestions(false)
} else if (event.key === 'Enter' && highlightedIndex !== null) {
const { index, subIndex } = highlightedIndex
const suggestion = suggestions[index].hits[subIndex]
const { index, subIndex } = highlighted const suggestion = suggestions[index].hits[subIndex]
handleSuggestionClick(suggestion, suggestions[index].indexName)
} else if (event.key === 'ArrowDown') {
event.preventDefault()
if (highlightedIndex === null) {
setHighlightedIndex({ index: 0, subIndex: 0 })
} else {
const { index, subIndex } = highlightedIndex
if (subIndex < suggestions[index].hits.length - 1) {
const { index, subIndex } = highlighted if (subIndex < suggestions[index].hits.length - 1) {
setHighlightedIndex({ index, subIndex: subIndex + 1 })
} else if (index < suggestions.length - 1) {
setHighlightedIndex({ index: index + 1, subIndex: 0 })
Expand Down
Loading