generated from dwd/boilarplate-astro-tailwind
fix-link removed
parent
a1c178c223
commit
e40c477b4a
|
@ -1,2 +1 @@
|
||||||
/// <reference types="astro/client" />
|
/// <reference types="astro/client" />
|
||||||
/// <reference path="content.d.ts" />
|
|
|
@ -8,56 +8,7 @@ import { store } from "../redux/store";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
|
|
||||||
const Blog = (props) => {
|
const Blog = (props) => {
|
||||||
// console.log("props in blog", props.blog);
|
|
||||||
window.scrollTo({ top: 0, behavior: "instant" });
|
window.scrollTo({ top: 0, behavior: "instant" });
|
||||||
// const { pathname } = useLocation();
|
|
||||||
// const slug = pathname.split("/")[2];
|
|
||||||
// const [props.blog, setBlogData] = useState();
|
|
||||||
// const navigate = useNavigate();
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// fetch(
|
|
||||||
// `https://curriculum-app-api.beanstalkedu.com/items/blog?filter[status][_eq]=published&filter[property][_eq]=aKadmy&filter[slug][_eq]=${slug}`
|
|
||||||
// )
|
|
||||||
// .then((res) => res.json())
|
|
||||||
// .then((data) => {
|
|
||||||
// setBlogData(data?.data?.[0]);
|
|
||||||
// if (data?.data.length === 0) {
|
|
||||||
// navigate("/404");
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .catch((err) => console.log("err123", err));
|
|
||||||
// }, [slug]);
|
|
||||||
|
|
||||||
// blog
|
|
||||||
const newSchema =
|
|
||||||
props.blog && props.blog.schema && props.blog?.schema.replaceAll("\n", "");
|
|
||||||
const newSchema2 =
|
|
||||||
props.blog &&
|
|
||||||
props.blog.schema2 &&
|
|
||||||
props.blog?.schema2.replaceAll("\n", "");
|
|
||||||
const newSchema3 =
|
|
||||||
props.blog &&
|
|
||||||
props.blog.schema3 &&
|
|
||||||
props.blog?.schema3.replaceAll("\n", "");
|
|
||||||
|
|
||||||
// console.log("blogUrl", `https://akadmyapp.com${pathname}`);
|
|
||||||
|
|
||||||
const metaData = {
|
|
||||||
title: props.blog && props.blog.meta,
|
|
||||||
description: props.blog && props.blog.meta_description,
|
|
||||||
// canonical: `https://akadmyapp.com${pathname}`,
|
|
||||||
og_title: props.blog && props.blog.og_title,
|
|
||||||
og_desc: props.blog && props.blog.og_desc,
|
|
||||||
siteName: "aKadmy",
|
|
||||||
type: "website",
|
|
||||||
url: "https://akadmyapp.com",
|
|
||||||
img_url: `https://management.beanstalkedu.com/assets/${
|
|
||||||
props.blog && props.blog.og_img
|
|
||||||
}`,
|
|
||||||
content: "product",
|
|
||||||
creator: "@aKadmy",
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -5,7 +5,6 @@ import React, { useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import style from "./Header.module.css";
|
import style from "./Header.module.css";
|
||||||
import MenuIcon from "@mui/icons-material/Menu";
|
import MenuIcon from "@mui/icons-material/Menu";
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
|
|
||||||
const navbar = [
|
const navbar = [
|
||||||
{
|
{
|
||||||
|
@ -68,26 +67,26 @@ function Header({ theme = "LIGHT", color }) {
|
||||||
<div className={style.container}>
|
<div className={style.container}>
|
||||||
<div className={style.menus}>
|
<div className={style.menus}>
|
||||||
<div className={style.logo}>
|
<div className={style.logo}>
|
||||||
<Link to="/">
|
<a href="/">
|
||||||
<img
|
<img
|
||||||
src={"/assets/akademy_Logo.png"}
|
src={"/assets/akademy_Logo.png"}
|
||||||
width={80}
|
width={80}
|
||||||
alt="akadmy Logo"
|
alt="akadmy Logo"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className={style.menus1}>
|
<div className={style.menus1}>
|
||||||
{navbar.map((item, i) => (
|
{navbar.map((item, i) => (
|
||||||
<div key={i} className={`${style.dropdown} ${style.product}`}>
|
<div key={i} className={`${style.dropdown} ${style.product}`}>
|
||||||
<Link to={item.link} style={{ color: color, fontWeight: 500 }}>
|
<a href={item.link} style={{ color: color, fontWeight: 500 }}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</Link>
|
</a>
|
||||||
{item?.subcat && <ArrowDropDownIcon style={{ color: color }} />}
|
{item?.subcat && <ArrowDropDownIcon style={{ color: color }} />}
|
||||||
<div className={style.dropdown_content}>
|
<div className={style.dropdown_content}>
|
||||||
{item?.subcat?.map((subItem, i) => (
|
{item?.subcat?.map((subItem, i) => (
|
||||||
<Link key={i} to={subItem.link}>
|
<a key={i} href={subItem.link}>
|
||||||
{subItem.name}
|
{subItem.name}
|
||||||
</Link>
|
</a>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -95,7 +94,7 @@ function Header({ theme = "LIGHT", color }) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={style.menus2}>
|
<div className={style.menus2}>
|
||||||
<Link to="/purchase/cart">
|
<a href="/purchase/cart">
|
||||||
<IconButton aria-label="cart" size="large">
|
<IconButton aria-label="cart" size="large">
|
||||||
<Badge
|
<Badge
|
||||||
badgeContent={
|
badgeContent={
|
||||||
|
@ -108,11 +107,11 @@ function Header({ theme = "LIGHT", color }) {
|
||||||
<ShoppingCartOutlinedIcon style={{ color: color }} />
|
<ShoppingCartOutlinedIcon style={{ color: color }} />
|
||||||
</Badge>
|
</Badge>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Link>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{/* mobile sidebar */}
|
{/* mobile sidebar */}
|
||||||
<div className={style.burger_menu}>
|
<div className={style.burger_menu}>
|
||||||
<Link to="/purchase/cart">
|
<a href="/purchase/cart">
|
||||||
<IconButton aria-label="cart" size="large">
|
<IconButton aria-label="cart" size="large">
|
||||||
<Badge
|
<Badge
|
||||||
badgeContent={
|
badgeContent={
|
||||||
|
@ -125,7 +124,7 @@ function Header({ theme = "LIGHT", color }) {
|
||||||
<ShoppingCartOutlinedIcon style={{ color: color }} />
|
<ShoppingCartOutlinedIcon style={{ color: color }} />
|
||||||
</Badge>
|
</Badge>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Link>
|
</a>
|
||||||
<MenuIcon onClick={() => setOpen(true)} style={{ color: color }} />
|
<MenuIcon onClick={() => setOpen(true)} style={{ color: color }} />
|
||||||
{open ? (
|
{open ? (
|
||||||
<div className={style.sidenav}>
|
<div className={style.sidenav}>
|
||||||
|
@ -142,15 +141,15 @@ function Header({ theme = "LIGHT", color }) {
|
||||||
sx={{ display: "flex" }}
|
sx={{ display: "flex" }}
|
||||||
onClick={() => setActive(item.name)}
|
onClick={() => setActive(item.name)}
|
||||||
>
|
>
|
||||||
<Link
|
<a
|
||||||
to={item.link}
|
href={item.link}
|
||||||
style={{
|
style={{
|
||||||
color: color === "white" ? "#818181" : color,
|
color: color === "white" ? "#818181" : color,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.name}
|
{item.name}
|
||||||
</Link>
|
</a>
|
||||||
{item?.subcat && (
|
{item?.subcat && (
|
||||||
<ArrowDropDownIcon
|
<ArrowDropDownIcon
|
||||||
style={{ color: color === "white" ? "#818181" : color }}
|
style={{ color: color === "white" ? "#818181" : color }}
|
||||||
|
@ -161,15 +160,15 @@ function Header({ theme = "LIGHT", color }) {
|
||||||
{active === item.name ? (
|
{active === item.name ? (
|
||||||
<Box ml={2}>
|
<Box ml={2}>
|
||||||
{item?.subcat?.map((subItem, i) => (
|
{item?.subcat?.map((subItem, i) => (
|
||||||
<Link
|
<a
|
||||||
key={i}
|
key={i}
|
||||||
to={subItem.link}
|
href={subItem.link}
|
||||||
style={{
|
style={{
|
||||||
color: color === "white" ? "#818181" : color,
|
color: color === "white" ? "#818181" : color,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{subItem.name}
|
{subItem.name}
|
||||||
</Link>
|
</a>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
|
@ -44,7 +44,7 @@ const schema3 = blogData?.schema3?.replaceAll("\n", "");
|
||||||
---
|
---
|
||||||
<Layout
|
<Layout
|
||||||
title={blogData?.title ?? 'Blog | Akademy'}
|
title={blogData?.title ?? 'Blog | Akademy'}
|
||||||
description={blogData.meta_description}
|
description={blogData?.meta_description}
|
||||||
canonicalUrl={`https://akadmyapp.com/blogs/${id}`}
|
canonicalUrl={`https://akadmyapp.com/blogs/${id}`}
|
||||||
ogImage={`https://management.beanstalkedu.com/assets/${blogData?.og_img}`}
|
ogImage={`https://management.beanstalkedu.com/assets/${blogData?.og_img}`}
|
||||||
ogUrl={'https://akadmyapp.com'}
|
ogUrl={'https://akadmyapp.com'}
|
||||||
|
|
Loading…
Reference in New Issue