Skip to content

Commit

Permalink
Fix: Remove commented static html
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilalekha committed Jun 28, 2021
1 parent 66f93e6 commit 325ffd9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 222 deletions.
175 changes: 51 additions & 124 deletions component/layout/SectionBlogs/SectionBlogs.jsx
Original file line number Diff line number Diff line change
@@ -1,127 +1,54 @@
import styles from './SectionBlogs.module.scss';
import Image from "next/image";
import Fade from 'react-reveal/Fade';
import AuthorDetails from '../BlogListing/AuthorDetails';
import styles from "./SectionBlogs.module.scss";
import Fade from "react-reveal/Fade";
import AuthorDetails from "../BlogListing/AuthorDetails";
import Link from "next/link";

export default function SectionBlogs(props) {
return (
<section className='pt-10 lg:pt-20'>
<div className='container container--small'>
<div className="sectionHeader">
<Fade>
<h2 className='sectionHeader__title md:w-36 lg:w-44 xl:w-56'>Series of Blogs</h2>
<p className="sectionHeader__description">Get the latest scoop from the world of tech ranging from javascript to AI and other crazy hacks from dev ducks across the globe.</p>
</Fade>
</div>
{/* <div className={styles.blogList}>
<div className={styles.blogItem}>
<Fade>
<figure className={styles.blogImage}>
<Image
src="/images/temp/blog1.png"
alt="Blog image"
width={528}
height={548}
className="w-full"
/>
</figure>
</Fade>
<h3>
<a href="">All you need to know about Supabase</a>
</h3>
<AuthorDetails />
</div>
<div className={styles.blogItem}>
<Fade>
<figure className={styles.blogImage}>
<Image
src="/images/temp/blog2.png"
alt="Blog image"
width={528}
height={548}
className="w-full"
/>
</figure>
</Fade>
<h3>
<a href="">Creative Search Bar and Input Field Design Inspiration</a>
</h3>
<AuthorDetails />
</div>
<div className={styles.blogItem}>
<Fade>
<figure className={styles.blogImage}>
<Image
src="/images/temp/blog3.png"
alt="Blog image"
width={528}
height={548}
className="w-full"
/>
</figure>
</Fade>
<h3>
<a href="">All you need to know about Supabase</a>
</h3>
<AuthorDetails />
</div>
<div className={styles.blogItem}>
<Fade>
<figure className={styles.blogImage}>
<Image
src="/images/temp/blog4.png"
alt="Blog image"
width={528}
height={548}
className="w-full"
/>
</figure>
</Fade>
<h3>
<a href="">All you need to know about Supabase</a>
</h3>
<AuthorDetails />
</div>
</div> */}
<div className={styles.blogList}>
{props.blog.map((item, key) => (
<div className={styles.blogItem} key={key}>
<Fade>
<figure className={styles.blogImage}>
<img
src={item.bannerImage}
alt={item.title}
width={528}
height={548}
className="w-full"
/>
</figure>
</Fade>
<h3>
<a href={`/${item.slug}`}>{item.title}</a>
</h3>

<AuthorDetails
username={item.primaryAuthor.username}
/>
</div>
))}
</div>
<div className="cta text-center">
<a href="/blog" className="btn">
<span className="btn__text">VIEW ALL OUR LATEST POSTS</span>
</a>
</div>
return (
<section className="pt-10 lg:pt-20">
<div className="container container--small">
<div className="sectionHeader">
<Fade>
<h2 className="sectionHeader__title md:w-36 lg:w-44 xl:w-56">
Series of Blogs
</h2>
<p className="sectionHeader__description">
Get the latest scoop from the world of tech ranging from
javascript to AI and other crazy hacks from dev ducks across the
globe.
</p>
</Fade>
</div>
<div className={styles.blogList}>
{props.blog.map((item, key) => (
<div className={styles.blogItem} key={key}>
<Fade>
<figure className={styles.blogImage}>
<img
src={item.bannerImage}
alt={item.title}
width={528}
height={548}
className="w-full"
/>
</figure>
</Fade>
<h3>
<a href={`/${item.slug}`}>{item.title}</a>
</h3>

<AuthorDetails username={item.primaryAuthor.username} />
</div>
</section>
);
}
))}
</div>
<div className="cta text-center">
<Link href="/blog">
<a className="btn">
<span className="btn__text">VIEW ALL OUR LATEST POSTS</span>
</a>
</Link>
</div>
</div>
</section>
);
}
98 changes: 6 additions & 92 deletions component/layout/SectionUsers/SectionUsers.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, { Component } from "react";
import Slider from "react-slick";
import styles from "./SectionUsers.module.scss";
import Link from "next/link";

export default class SimpleSlider extends Component {
render() {
// console.log(this.props.user);
const settings = {
dots: false,
arrows: false,
Expand All @@ -24,104 +26,16 @@ export default class SimpleSlider extends Component {
<div key={key}>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt="" />
<img src="/images/temp/avatar1.png" alt="user" />
</div>
<h4 className={styles.min_w_10rem}>
<a href="">{item.fullName}</a>
<Link href={`/u/${item.username}`}>
<a>{item.fullName}</a>
</Link>
</h4>
</div>
</div>
))}

{/* <div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Allie Grater</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Paige Turner</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Percy Kewshun</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Allie Grater</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Paige Turner</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Percy Kewshun</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Allie Grater</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Paige Turner</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Percy Kewshun</a></h4>
</div>
</div>
<div>
<div className={styles.item}>
<div className={styles.icon}>
<img src="/images/temp/avatar1.png" alt=""/>
</div>
<h4><a href="">Allie Grater</a></h4>
</div>
</div> */}
</Slider>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions services/PostService.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ async function getPostsByQuery(query, clickNo) {
}

async function getPostCountByUserId(userId) {
let url = "";
if (typeof window == "undefined") url = serverUrl;
else url = baseUrl;
let url = "";
if (typeof window == "undefined") url = serverUrl;
else url = baseUrl;
try {
const {data} = await axios.get(`${url}/${allPostsUrl}/count`, {
params: {userId:userId},
const { data } = await axios.get(`${url}/${allPostsUrl}/count`, {
params: { userId: userId }
});
console.log(data, " getPostCountByUserId ")
// console.log(data, " getPostCountByUserId ")
return data;
} catch (err) {
console.log(err);
Expand Down

0 comments on commit 325ffd9

Please sign in to comment.