Skip to content

Commit

Permalink
Merge branch 'main' into blog-admin-forms
Browse files Browse the repository at this point in the history
  • Loading branch information
Ase020 authored Jan 2, 2024
2 parents 84cb684 + 45f9ae6 commit 49c116b
Show file tree
Hide file tree
Showing 33 changed files with 679 additions and 526 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/update-dev.yaml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-fast-marquee": "^1.6.2",
"react-hook-form": "^7.48.2",
"react-query": "^3.39.3",
"react-router-dom": "^6.11.2",
Expand Down
1 change: 1 addition & 0 deletions src/ADMIN/pages/events/AddEventPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
import { useEventsCategories } from "../../../hooks/Queries/eventsSection/useEventCategories";
import useChaptersData from "../../../hooks/Queries/community/useChaptersData";
import usePostEvents from "../../../hooks/Queries/eventsSection/usePostEvents";
import "../../../APP/pages/community/sections/eventsSection/SingleEvents/EventAbout.css"

function AddEventPage() {
const [ selectedEventCategory, setSelectedEventCategory ] = useState('1');
Expand Down
10 changes: 4 additions & 6 deletions src/APP/components/Footer2.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Link } from "react-router-dom";
import logo from "../../assets/images/sytLogo.png";
import backup from "../../assets/images/backup.svg";
// import backup from "../../assets/images/backup.svg";
import { linkedin, twitter, spotify } from "../../assets/images/socials";
import youtube from "../../assets/images/socials/youtube.svg";

Expand Down Expand Up @@ -68,10 +68,10 @@ function Footer2() {
<Link to="/about-us">About Us</Link>
</li>
<li>
<a href="/#faq">FAQs</a>
<Link to="/community">Community</Link>
</li>
<li>
<Link to="/community">Community</Link>
<a href="/products">Products</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -137,9 +137,7 @@ function Footer2() {

<div className="sm:mt-14 mt-10">
<h1 className="text-center text-[#00FFC3] my-4 md:my-8">
&copy;{" "}
{year}{" "}
SpaceYaTech | All Rights Reserved
&copy; {year} SpaceYaTech | All Rights Reserved
</h1>
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/APP/components/Header2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ const Header2 = () => {
Products
</Link>

{/*
<Link
className="text-gray-900 hover:text-[#009975] hover:underline transition-all duration-300 cursor-pointer focus:text-[#009975] focus:underline"
to="/blogs"
onClick={() => setShowNavlinks(false)}
>
Blogs
Blog
</Link>
{/*
<Link
className="text-gray-900 hover:text-[#009975] hover:underline transition-all duration-300 cursor-pointer focus:text-[#009975] focus:underline"
to="/resources"
Expand Down Expand Up @@ -127,14 +127,14 @@ const Header2 = () => {
Products
</Link>

{/*
<Link
className="text-gray-900 hover:text-[#009975] hover:underline transition-all duration-300 cursor-pointer focus:text-[#009975] focus:underline"
to="/blogs"
>
Blogs
Blog
</Link>
{/*
<Link
className="text-gray-900 hover:text-[#009975] hover:underline transition-all duration-300 cursor-pointer focus:text-[#009975] focus:underline"
to="/resources"
Expand Down
3 changes: 1 addition & 2 deletions src/APP/components/PodcastCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export default PodcastCard;

PodcastCard.propTypes = {
img: PropTypes.string.isRequired,
category: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
link: PropTypes.number.isRequired,
link: PropTypes.string.isRequired,
};
4 changes: 2 additions & 2 deletions src/APP/pages/aboutUs/sections/HeroSection.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { aboutImg2, heroImg } from "../../../../assets/images/aboutPage";
import { about2, heroImg } from "../../../../assets/images/aboutPage";

function HeroSection() {
return (
Expand Down Expand Up @@ -30,7 +30,7 @@ function HeroSection() {
</div>
<div className="flex flex-col md:flex-row justify-between items-center md:my-20 min-h-96 px-4 md:px-0">
<div className="my-10">
<img src={aboutImg2} alt="space ya tech" />
<img src={about2} alt="space ya tech" />
</div>
<div className="leading-6 md:w-1/2 text-base space-y-4 md:pl-10">
<p>
Expand Down
1 change: 1 addition & 0 deletions src/APP/pages/blog/Blog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ function Blog() {
}

export default Blog;

51 changes: 22 additions & 29 deletions src/APP/pages/blog/sections/BlogWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React from "react";
import { formatDistanceToNow } from "date-fns";
import BlogStats from "../../blogs/sections/BlogStats";

import logo from "../../../../assets/images/sytLogo.png";

import "./blogWrapper.css";
import { Ellipse30 } from "../../../../assets/images/blogs-page";

const BlogWrapper = ({ blog }) => {
const paragraph = blog.body.split("\n");
const timeAgo = formatDistanceToNow(new Date(blog.created_at), {
addSuffix: true,
});

return (
<div className="flex flex-row">
<div className="w-full md:w-3/5 flex flex-col">
Expand All @@ -19,34 +15,31 @@ const BlogWrapper = ({ blog }) => {
{blog.title}
</h3>

<div className="flex items-center justify-between">
<div className="flex gap-2">
<img
src={logo}
alt="icon"
className="w-10 h-10 object-cover rounded-full bg-gray-200 flex items-center justify-center p-1"
/>

<div className="flex flex-col text-sm">
<h4 className="font-medium text-[#323433] capitalize">
{blog.author}
</h4>

<span className="text-[#656767] text-xs">{timeAgo}</span>
</div>
</div>
<div className="flex gap-[10px]">
<img
src={Ellipse30}
alt="icon"
className="w-10 h-10 object-cover rounded-full"
/>

<BlogStats likes={blog.likes} />
<div className="flex flex-col gap-1 text-sm">
<h4 className=" font-medium text-[#323433]">{blog.author}</h4>

<span className="text-[#656767]">{timeAgo}</span>
</div>
</div>
</div>

<div className="pb-8 pt-6 md:pt-8">
<div
className="container text-[13px] md:text-base font-normal text-[##323433]"
dangerouslySetInnerHTML={{ __html: blog.body }}
>
{/* {htmlParser(blog.body)} */}
</div>
<p className="text-[13px] md:text-base font-normal text-[##323433]">
{paragraph.map((par, i) => (
<React.Fragment key={i}>
{par}
<br />
<br />
</React.Fragment>
))}
</p>
</div>

{/* <Comments /> */}
Expand Down
44 changes: 0 additions & 44 deletions src/APP/pages/blog/sections/blogWrapper.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/APP/pages/blogs/Blogs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Blogs = () => {
const [searchText, setSearchText] = useState("");

return (
<section className="flex flex-col items-center gap-4 max-w-[1440px] mx-auto">
<section className="flex flex-col items-center gap-4">
<Banner searchText={searchText} setSearchText={setSearchText} />
<BlogsWrapper searchText={searchText} />
</section>
Expand Down
4 changes: 2 additions & 2 deletions src/APP/pages/blogs/sections/Banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Banner = ({ searchText, setSearchText }) => {
<div className="absolute inset-0 flex flex-col gap-4 md:gap-8 items-center justify-center w-[80%] mx-auto md:w-[716px]">
<h2 className="text-3xl font-normal text-white">Blogs</h2>

{/* <form
<form
className="flex items-center border-2 border-white px-4 py-2 md:py-3 rounded-full w-full gap-1"
onSubmit={handleSearch}
>
Expand All @@ -24,7 +24,7 @@ const Banner = ({ searchText, setSearchText }) => {
<button type="submit" className="w-1/10 p-2">
<img src={search} alt="search" className="w-6 h-6" />
</button>
</form> */}
</form>
</div>
</div>
);
Expand Down
18 changes: 11 additions & 7 deletions src/APP/pages/blogs/sections/BlogCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@ import { formatDistanceToNow } from "date-fns";
import { useNavigate, Link } from "react-router-dom";
import { arrowRight } from "../../../../assets/images/blogs-page";
import logo from "../../../../assets/images/sytLogo.png";

import BlogStats from "./BlogStats";
import { formatDistanceToNow } from "date-fns";

const BlogCard = ({ blog }) => {
const navigate = useNavigate();
const timeAgo = formatDistanceToNow(new Date(blog.created_at), {
addSuffix: true,
});
return (

<Link
to={`/blogs/${blog.id}`}
className="flex flex-col items-start w-full mb-6"
>

<img
src={blog.image}
alt="blog"
className="w-full h-60 object-cover rounded-lg"
className="flex-1 w-full h-60 object-cover rounded-lg"
/>

<div className="py-[6px] flex flex-col gap-[10px] w-full">
<div className="flex-1 py-[6px] flex flex-col gap-[10px] w-full">
<div className="flex flex-col lg:flex-row justify-between items-start gap-2">
<h3 className="text-xl text-[#323433] font-semibold">{blog.title}</h3>

<BlogStats likes={blog.likes <= 1 ? "" : blog.likes} />
<BlogStats likes={blog.likes} />
</div>

<p className="text-base font-normal leading-6 flex flex-wrap text-[#4C4D4D] line-clamp-2">
Expand All @@ -34,9 +38,9 @@ const BlogCard = ({ blog }) => {
<div className="flex flex-row items-start justify-between">
<div className="flex gap-[10px]">
<img
src={logo}
src={Ellipse30}
alt="icon"
className="w-10 h-10 object-cover bg-gray-200 flex items-center justify-center p-1 rounded-full"
className="w-10 h-10 object-cover rounded-full"
/>

<div className="flex flex-col gap-1 text-sm">
Expand All @@ -47,12 +51,12 @@ const BlogCard = ({ blog }) => {
</div>

<button
className="flex gap-2 items-center justify-between"
className="flex gap-2 items-center"
onClick={() => {
navigate(`/blogs/${blog.id}`);
}}
>
<span className="uppercase text-[#009975] text-sm font-medium m-0">
<span className="uppercase text-[#009975] text-sm font-medium">
read more
</span>
<img src={arrowRight} alt="arrow-right" className="w-5 h-5" />
Expand Down
17 changes: 4 additions & 13 deletions src/APP/pages/blogs/sections/BlogStats.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import { thumbsUp } from "../../../../assets/images/blogs-page";
import { chatText, eye, thumbsUp } from "../../../../assets/images/blogs-page";

const BlogStats = ({ likes }) => {
const handleLike = () => {
console.log("Clicked");
};

return (
<div className="flex flex-row items-center gap-2">
{/* <div className="flex flex-row items-center gap-1">
<img src={eye} alt="eye" className="w-5 h-5 object-cover" />
<span className="text-base text-[#00664E]">240</span>
</div> */}

<div className="flex flex-row items-center gap-x-1">
<img
src={thumbsUp}
alt="eye"
className="w-5 h-5 object-cover cursor-pointer"
onClick={handleLike}
/>
<span className="text-sm text-[#00664E] m-0">{likes}</span>
<div className="flex flex-row items-center gap-1">
<img src={thumbsUp} alt="eye" className="w-5 h-5 object-cover" />
<span className="text-base text-[#00664E]">{likes}</span>
</div>

{/* <div className="flex flex-row items-center gap-1">
Expand Down
Loading

0 comments on commit 49c116b

Please sign in to comment.