Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev resolve conflicts #126

Merged
merged 51 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6e46312
init blog formatting
Ase020 Jan 3, 2024
6ef935d
format blogs page
Ase020 Jan 3, 2024
70fd0c4
add line-clamp to podCard title&desc
Ase020 Jan 3, 2024
0cf2043
return categories
Ase020 Jan 3, 2024
fbd9138
add blog search functionality
Ase020 Jan 4, 2024
aae2da1
prevent blogWrapper.css styles affecting other components
Ase020 Jan 4, 2024
36becdf
add text-primary & bg in global.css
Ase020 Jan 4, 2024
cf2de42
style code on blog body
Ase020 Jan 4, 2024
8d751fc
wrap no result in a p tag
Ase020 Jan 4, 2024
62e59e6
init pageNotFound
Ase020 Jan 4, 2024
1482eac
import 404 image
Ase020 Jan 4, 2024
af0eedb
complete page not found page
Ase020 Jan 4, 2024
d0fcc03
Merge pull request #98 from SpaceyaTech/blog-page-format
JimmyTron Jan 5, 2024
68efe35
import formatDistanceToNow (#100)
Ase020 Jan 5, 2024
21381d4
refactor service section
Ase020 Jan 6, 2024
7cd3014
change param to title_slug
Ase020 Jan 6, 2024
f061fc6
filter blogs by categories
Ase020 Jan 6, 2024
7c53394
make blog categories scrollable
Ase020 Jan 6, 2024
55603c4
span components on the landing page
Ase020 Jan 6, 2024
3176306
add download attribute internship document
Ase020 Jan 6, 2024
5afd015
fix route
Ase020 Jan 7, 2024
5915c09
fetch related blogs on blog page
Ase020 Jan 7, 2024
85632ef
refetch on page change
Ase020 Jan 7, 2024
8b414d1
add error img
Ase020 Jan 7, 2024
cf9b90a
add condition filtering to cat
Ase020 Jan 7, 2024
57f7f8e
add loader to blog page
Ase020 Jan 8, 2024
7c8fa29
build error500 mobile page
Ase020 Jan 9, 2024
3045b72
build error500 web page
Ase020 Jan 9, 2024
37d3217
remove img border
Ase020 Jan 9, 2024
1e0705d
Merge branch 'main' into page-not-found
Ase020 Jan 9, 2024
3876edc
error 400 page build
Ase020 Jan 9, 2024
a0e1171
Merge branch 'page-not-found' of github.com:SpaceyaTech/SYT-Web-Redes…
Ase020 Jan 9, 2024
b55f1e1
error 400 page build
Ase020 Jan 9, 2024
0332d8e
error 403 page build
Ase020 Jan 9, 2024
e3bd03b
reinsert 404 page
Ase020 Jan 9, 2024
c4950cd
remove 403 route
Ase020 Jan 9, 2024
5956c62
removed unbuilt routes
Ase020 Jan 9, 2024
e8f2a34
Filter out recurring current blog on related blogs fetched.
collinskasyoki Jan 9, 2024
f5a9b22
Merge pull request #102 from SpaceyaTech/related-blogs
Ase020 Jan 9, 2024
54cb428
Merge branch 'main' into page-not-found
Ase020 Jan 9, 2024
929c7fb
Add error500 svg img
Ase020 Jan 9, 2024
482a39f
Merge branch 'page-not-found' of github.com:SpaceyaTech/SYT-Web-Redes…
Ase020 Jan 9, 2024
226ca0a
Merge pull request #103 from SpaceyaTech/page-not-found
JimmyTron Jan 9, 2024
4fc2626
Merge branch 'main' into remove-pages-wip-build
JimmyTron Jan 10, 2024
6bff912
Merge pull request #104 from SpaceyaTech/remove-pages-wip-build
JimmyTron Jan 10, 2024
03da624
Merge branch 'main' into Dev
Ase020 Jan 10, 2024
ac4b741
Remove duplicates from files
Ase020 Jan 11, 2024
973e815
duplicate??
Ase020 Jan 11, 2024
f9c4a9f
remove comment tag
Ase020 Jan 11, 2024
2cce4bc
Resolve conflicts
Ase020 Jan 31, 2024
5ec78e5
resolve dev conflicts
Ase020 Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file not shown.
Binary file added .vs/SYT-Web-Redesign/v17/.wsuo
Binary file not shown.
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"postcss": "^8.4.23",
"prettier": "^2.8.8",
"tailwindcss": "^3.3.2",
"vite": "^4.3.2"
"vite": "^4.5.1"
},
"lint-staged": {
"**/*.{js,jsx}": [
Expand Down
4 changes: 0 additions & 4 deletions src/APP/components/Footer2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ function Footer2() {
Gallery
</a>
</li>

</ul>
</div>

Expand Down Expand Up @@ -160,7 +159,6 @@ function Footer2() {
special offers
</p>


<form className="flex items-center">
<input
type="email"
Expand All @@ -170,15 +168,13 @@ function Footer2() {
<button
type="submit"
className="rounded-r-lg px-2 md:px-4 py-3 flex-auto font-semibold text-white transition-all duration-200 bg-primary border border-transparent hover:bg-gray-700 focus:ring-2 focus:ring-offset-2 focus:ring-gray-900"

>
Subscribe
</button>
</form>
</div>
</div>
</div>

</div>

<div className="sm:mt-14 mt-10">
Expand Down
1 change: 0 additions & 1 deletion src/APP/pages/blog/sections/BlogWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import logo from "../../../../assets/images/sytLogo.png";
import "./blogWrapper.css";

const BlogWrapper = ({ blog }) => {

const timeAgo = formatDistanceToNow(new Date(blog?.created_at), {
addSuffix: true,
});
Expand Down
3 changes: 0 additions & 3 deletions src/APP/pages/blog/sections/RelatedBlogs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useRelatedBlogsData } from "../../../../hooks/Queries/blog/useBlogData"
import BlogCard from "../../blogs/sections/BlogCard";
import { filterRelatedBlogs } from "../../../../utilities/FilterBlogs";


function RelatedBlogs({ blogId, categoryId }) {
const { title_slug } = useParams();

Expand All @@ -25,7 +24,6 @@ function RelatedBlogs({ blogId, categoryId }) {
title_slug
);


return (
<>
{isError && <p>Error loading blogs!</p>}
Expand All @@ -34,7 +32,6 @@ function RelatedBlogs({ blogId, categoryId }) {
{isSuccess && filteredRelatedBlogs.length > 0 && (
<>
<h2 className="text-2xl text-gray-500 font-semibold underline decoration-green-600 underline-offset-2">

{filteredRelatedBlogs.length > 1
? "Related Articles"
: "Related Article"}
Expand Down
149 changes: 75 additions & 74 deletions src/APP/pages/blogs/sections/BlogCard.jsx
Original file line number Diff line number Diff line change
@@ -1,74 +1,75 @@
import React from "react";
import { useNavigate, Link } from "react-router-dom";
import { formatDistanceToNow } from "date-fns";

import { arrowRight } from "../../../../assets/images/blogs-page";
import logo from "../../../../assets/images/sytLogo.png";
import BlogStats from "./BlogStats";

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

return (
<Link
to={`/blogs/${blog.title_slug}`}

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

<div className="py-[6px] flex flex-col gap-[10px] w-full mt-2">
<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} />
</div>

<p className="text-base font-normal leading-6 text-[#4C4D4D] line-clamp-3">
{blog.description}
</p>

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

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

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

<button
className="flex gap-2 items-center justify-between"
onClick={() => {
navigate(`/blogs/${blog.title_slug}`);
}}
>
<span className="uppercase text-primary text-sm font-medium m-0">
read more
</span>
<img src={arrowRight} alt="arrow-right" className="w-5 h-5" />
</button>
</div>
</div>
</Link>
);
}

export default BlogCard;
/* eslint-disable react/prop-types */
import React from "react";
import { useNavigate, Link } from "react-router-dom";
import { formatDistanceToNow } from "date-fns";

import { arrowRight } from "../../../../assets/images/blogs-page";
import logo from "../../../../assets/images/sytLogo.png";
import BlogStats from "./BlogStats";

function BlogCard({ blog }) {
const navigate = useNavigate();

const timeAgo =
blog?.created_at &&
formatDistanceToNow(new Date(blog?.created_at), {
addSuffix: true,
});

return (
<Link
to={`/blogs/${blog.title_slug}`}
className="flex flex-col items-start w-full mb-5"
>
<img
src={blog.image}
alt="blog"
className="w-full h-60 object-cover rounded-lg"
/>

<div className="py-[6px] flex flex-col gap-[10px] w-full mt-2">
<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} />
</div>

<p className="text-base font-normal leading-6 text-[#4C4D4D] line-clamp-3">
{blog.description}
</p>

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

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

<button
type="button"
className="flex gap-2 items-center justify-between"
onClick={() => {
navigate(`/blogs/${blog.title_slug}`);
}}
>
<span className="uppercase text-primary text-sm font-medium m-0">
read more
</span>
<img src={arrowRight} alt="arrow-right" className="w-5 h-5" />
</button>
</div>
</div>
</Link>
);
}

export default BlogCard;
7 changes: 2 additions & 5 deletions src/APP/pages/blogs/sections/BlogsWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable operator-linebreak */
/* eslint-disable react/jsx-indent */
import React, { useState, useEffect, useContext } from "react";
import { useNavigate } from "react-router-dom";
// import { useNavigate } from "react-router-dom";

import BlogCard from "./BlogCard";
import BlogPagination from "./BlogPagination";
Expand All @@ -13,20 +13,18 @@ import {
} from "../../../../hooks/Queries/blogs/useAllBlogsData";

import { filterBlogsByCat } from "../../../../utilities/FilterBlogs";

function SearchResults({ searchText }) {
return (
<h3 className="text-black text-xl md:text-3xl font-semibold leading-8 md:leading-loose text-center">
Showing results for

<span className="text-primary"> "{searchText}"</span>

</h3>
);
}

function BlogsWrapper() {
const { searchText, searchBlog } = useContext(SearchBlogContext);

const [selectedCat, setSelectedCat] = useState("");
const [page, setPage] = useState(1);

Expand Down Expand Up @@ -74,7 +72,6 @@ function BlogsWrapper() {
{isSuccess && (
<>
<div className="w-full md:w-fit overflow-x-auto md:overflow-auto flex flex-row items-center gap-4 md:px-3 md:gap-3 md:mb-2">

{statusBlogCategories === "error" && (
<p>Error loading blog categories!</p>
)}
Expand Down
1 change: 0 additions & 1 deletion src/hooks/Queries/blog/useBlogData.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import axios from "axios";
import { useQuery } from "@tanstack/react-query";


const fetchBlogData = async (title_slug) => {
try {
const response = await axios.get(
Expand Down