Skip to content

Commit

Permalink
added skeleton loading feature
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Sep 18, 2023
1 parent 6d45316 commit 46d8567
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
8 changes: 1 addition & 7 deletions components/LeftSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ import styles from "@/styles/LeftSidebar.module.css";
import { langs } from "@/helper/Languages";
import Link from "next/link";
import { useRouter } from "next/router";
import { useState, useEffect } from "react";

export default function LeftSidebar() {
const router = useRouter();

function replaceRoute(lang_query) {
router.replace(`/search/${lang_query}`).then(() => router.reload());
}

return (
<>
<div
Expand All @@ -28,10 +23,9 @@ export default function LeftSidebar() {
{langs.map((lang) => {
return (
<a
href="javascript:void(0);"
href={`/search/${lang.query}`}
key={lang.query}
className={`first:mt-3 cursor-pointer`}
onClick={() => replaceRoute(lang.query)}
>
<div
className={`${
Expand Down
36 changes: 1 addition & 35 deletions pages/search/[lang].js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {useRouter} from "next/router";
import { useState , useEffect } from "react";
import Link from "next/link";
import styles from "@/styles/LandingMain.module.css";
import IssuesCard from "@/components/IssuesCard";
import moment from "moment/moment";
Expand All @@ -11,9 +10,6 @@ export default function Search({allIssues}){


const router = useRouter();
const [issues,setIssues] = useState(allIssues);
const [loading, setLoading] = useState(true);
const [prevRoute,setprevRoute] = useState("");

if(router.isFallback){
return (
Expand All @@ -24,41 +20,12 @@ export default function Search({allIssues}){
)
}

// useEffect(() => {
// // console.log("rendering",router.query.lang)
// // if(prevRoute != router.query.lang){
// // setprevRoute(router.query.lang);
// // window.location.reload();

// // }

// // loadIssues().then(() => setLoading(false))
// // if(issues.length != 0){
// setLoading(false);
// // }
// },[issues])

return (
<>
<div className = {`${styles.landing_main} p-3 md:p-8 issues_result overflow-auto w-[100%] md:w-[54%] landing_main h-full flex flex-col items-start justify-start`}>
<p className = "w-[200px] mb-4 italic font-semibold text-[16px] lg:text-[18px] text-main_primary">Issues Result</p>
{/* {loading == true ? (
<SkeletonCard />
) : (
issues.map(issue => {
return (
<IssuesCard key={issue.issueId} issue={issue} />
)
})
)
} */}
{
issues.map(issue => {
allIssues?.map(issue => {
return (
<IssuesCard key={issue.issueId} issue={issue} />
)
Expand All @@ -69,7 +36,6 @@ export default function Search({allIssues}){
)
}

// pages/products/[id].js
async function loadRepo(issueItems){

var repoObj = {};
Expand Down

1 comment on commit 46d8567

@vercel
Copy link

@vercel vercel bot commented on 46d8567 Sep 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

findissues – ./

findissues-anand346.vercel.app
findissues.vercel.app
findissues-git-main-anand346.vercel.app

Please sign in to comment.