Skip to content

Commit

Permalink
width
Browse files Browse the repository at this point in the history
  • Loading branch information
nullity00 committed Jan 5, 2025
1 parent 0dd2165 commit 71c841a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Navbar = () => {
<>
<nav className="w-full bg-white flex h-18 items-center justify-between top-0 py-6">
{/* Logo section */}
<div className="flex flex-row gap-4 text-emeraldlight items-center text-xl lg:ml-64">
<div className="flex flex-row gap-4 text-emeraldlight items-center text-xl lg:ml-80">
<Link href="https://electisec.tech/">
<img alt="Logo" src="/logo.svg" className="h-10" />
</Link>
Expand Down
31 changes: 17 additions & 14 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ export default function Home({ reports }: HomeProps) {
// Enhanced useEffect to handle multiple URL tags
useEffect(() => {
const params = new URLSearchParams(window.location.search);
const tagParam = params.get('tag');
const tagParam = params.get("tag");

if (tagParam) {
// Split the tag parameter by commas and filter out any invalid tags
const urlTags = tagParam.split(',')
.map(tag => tag.trim())
.filter(tag => tags.includes(tag));

const urlTags = tagParam
.split(",")
.map((tag) => tag.trim())
.filter((tag) => tags.includes(tag));

if (urlTags.length > 0) {
setSelectedTags(urlTags);
}
Expand Down Expand Up @@ -75,29 +76,31 @@ export default function Home({ reports }: HomeProps) {
const newTags = prevTags.includes(tag)
? prevTags.filter((t) => t !== tag)
: [...prevTags, tag];

// Update URL with all selected tags
const params = new URLSearchParams(window.location.search);
if (newTags.length > 0) {
params.set('tag', newTags.join(','));
params.set("tag", newTags.join(","));
} else {
params.delete('tag');
params.delete("tag");
}

// Update URL without refreshing the page
window.history.replaceState(
{},
'',
`${window.location.pathname}${newTags.length ? `?${params.toString()}` : ''}`
"",
`${window.location.pathname}${
newTags.length ? `?${params.toString()}` : ""
}`
);

return newTags;
});
};

return (
<div className="min-h-screen bg-gray-50">
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<main className="max-w-6xl mx-auto py-6 sm:px-6 lg:px-8">
<div className="px-4 sm:px-0 mb-8 text-gray-400">
<SearchBar onSearch={handleSearch} />
<div className="flex flex-wrap gap-2 mx-auto mt-4 justify-center">
Expand Down
4 changes: 2 additions & 2 deletions pages/reports/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function ReportPage({
<h2 className="text-xl mb-4 text-black">← Back to Reports</h2>
</Link>

<div className="max-w-7xl bg-white shadow py-6 sm:px-6 flex flex-row justify-between ">
<div className="max-w-6xl bg-white shadow py-6 sm:px-6 flex flex-row justify-between ">
<h1
className="text-3xl font-bold text-black"
id={title.toLocaleLowerCase()}
Expand Down Expand Up @@ -53,7 +53,7 @@ export default function ReportPage({
))}
</div>
</div>
<div className="max-w-7xl bg-white shadow py-6 mt-4 sm:px-6">
<div className="max-w-6xl bg-white shadow py-6 mt-4 sm:px-6">
<div
className="prose prose-lg max-w-none prose-table:shadow-lg prose-table:border prose-td:p-2 prose-th:p-2 prose-th:bg-gray-100"
dangerouslySetInnerHTML={{ __html: content }}
Expand Down

0 comments on commit 71c841a

Please sign in to comment.