Skip to content

Commit

Permalink
removed sidebar from search + CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
SH20RAJ committed Mar 29, 2024
1 parent ccf83a7 commit e067b9f
Show file tree
Hide file tree
Showing 8 changed files with 3,073 additions and 5,638 deletions.
5,625 changes: 0 additions & 5,625 deletions package-lock.json

This file was deleted.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
},
"dependencies": {
"express": "^4.18.3",
"isomorphic-fetch": "^3.0.0",
"lodash": "^4.17.21",
"next": "^14.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-syntax-highlighter": "^15.5.0",
"xml2js": "^0.6.2",
"xmlbuilder": "^15.1.1"
"react-dom": "^18.2.0"
},
"devDependencies": {
"autoprefixer": "^10.0.1",
Expand Down
3 changes: 2 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
User-agent: *
Disallow:

Sitemap: /sitemapsh
User-agent: *
Allow: /sitemap2
12 changes: 11 additions & 1 deletion src/app/components/Nav.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Link from "next/link";
export default ({search }) => {
// console.log(params);
console.log(search);

return (
<nav>
<Link href="../">
Expand All @@ -18,10 +20,18 @@ export default ({search }) => {
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
</svg>
</div>
<input name="q" type="search" id="default-search" class="block w-full p-4 ps-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Search Articles, Accounts..." required />
<input name="q" type="search" id="default-search" class="block w-full p-4 ps-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Search Articles, Accounts..." required />
<button type="submit" class="hidden sm:block text-white absolute end-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Search</button>
</div>
</form>
<script dangerouslySetInnerHTML={{ __html :
`const searchParams = new URLSearchParams(window.location.search)
if (!document.querySelector('#default-search').value){
document.querySelector("#default-search").value=searchParams.get("q") || "";
}`

}}/>

{/* <li>
<Link href="/devart">About</Link>
Expand Down
9 changes: 8 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ footer {
}

.latestposts {
flex-grow: 4;
/* flex-grow: 4; */
display: flex;
flex-wrap: wrap;
align-items: center;
Expand Down Expand Up @@ -519,6 +519,7 @@ footer {
width: 90%;
height: 300px;
}

.postscontainer .card img {
height: 210px;
}
Expand Down Expand Up @@ -563,6 +564,12 @@ footer {
display: inline-block;
}

.latestposts .card a {
display: block;
overflow: hidden;
height: 100%;
}

.inline-block {
display: inline-block;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function ArticlesPage() {
<h1 className="sm:hidden rounded-[12px] m-10 text-xl shadow-2xl p-5">
<div class="relative">
<form action="/search">
<input class="w-full h-12 text-sm outline-none border mt-3 rounded-lg transition-all pl-7 pr-20 focus:border-blue-600" type="text" placeholder="Search Article, Users etc."/>
<input name="q" class="w-full h-12 text-sm outline-none border mt-3 rounded-lg transition-all pl-7 pr-20 focus:border-blue-600" type="text" placeholder="Search Article, Users etc."/>
<i class="absolute top-7 text-[#bfc6cd] left-2 fa fa-search"></i>
<button class="absolute right-2 rounded-lg cursor-pointer transition-all hover:bg-blue-900 top-4 h-10 w-16 bg-blue-500 text-white text-sm">Search</button>
</form>
Expand Down
6 changes: 3 additions & 3 deletions src/app/search/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ export default function ArticlesPage(params) {
Latest Posts
</h1>
<div className="container">
<div className="latestposts">
<div className="latestposts" class="w-full" style={{maxWidth : "100%"}}>
{filteredArticles.map((article) => (
<ArticleCard key={article.id} article={article} />
))}
</div>
<div class="post">
{/*<div class="post">
<Card2/>
</div>
</div>*/}
</div>
</main>
{isLoading && (
Expand Down
Loading

0 comments on commit e067b9f

Please sign in to comment.