کار کردم که اگر کاربر وسط یک صفحه ای بود و روی یکی از ایتم های موجود در هدر زد و وارد اون صفحه جدیده زد صفحه جدید از بالا باز شود | 35

temp
mahdi 2 years ago
parent 4d2b89dca3
commit 477282518b
  1. 6
      src/views/About/index.js
  2. 2
      src/views/Blog/index.js
  3. 7
      src/views/Blogs/index.js
  4. 4
      src/views/Contact/index.js
  5. 19
      src/views/Home/index.js

@ -21,9 +21,13 @@ function About({
setHeaderOptions({ shown: true });
}, []);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div className={_.join(["about w-11/12 mx-auto flex flex-col"], " ")}>
<main className="flex flex-col items-center pt-16">
<main className="flex flex-col items-center pt-16 ">
<header>
<h1>{first.title}</h1>
<p

@ -35,7 +35,7 @@ export const Blog = ({
getInfo({ id: location.getId() });
}, [activeBlog]);
return (
<div className="flex flex-col lg:w-11/12 mx-auto lg:py-24 lg:px-0 px-4 lg:pb-0 pb-24">
<div className="flex flex-col lg:w-11/12 mx-auto lg:py-24 lg:px-0 px-4 lg:pb-0 pb-24 ">
<Hashtags />
{isMobile && (
<div

@ -27,8 +27,13 @@ export const Blogs = ({ isMobile, getList, blogs, setHeaderOptions }) => {
}
getList();
}, []);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div className="flex w-full px-4 lg:px-0 flex-col lg:w-11/12 mx-auto lg:py-24 pb-24 lg:pb-0">
<div className="flex w-full px-4 lg:px-0 flex-col lg:w-11/12 mx-auto lg:py-24 pb-24 lg:pb-0 ">
<Hashtags />
<Single />
<Header title={window.t(" تازهترینها از وبلاگ")} />

@ -21,6 +21,10 @@ function Contact({ headerOptions, setHeaderOptions, info, isMobile, isDark }) {
setHeaderOptions(headerOptions);
}, []);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div
className="w-full flex h-auto flex-col bg-transparent lg:pt-36 lg:pb-24"

@ -1,7 +1,7 @@
import React, { useEffect } from "react";
import { connect } from "react-redux";
import DesktopHome from './Desktop';
import DesktopHome from "./Desktop";
import Portrait from "./Portrait";
import { publicApi } from "../../redux/actions";
@ -9,12 +9,20 @@ function Home({ setHeaderOptions, headerOptions, isMobile }) {
useEffect(() => {
setHeaderOptions(headerOptions);
}, []);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<>
{
isMobile ? <Portrait /> : <div className="flex justify-center"><DesktopHome /></div>
}
{isMobile ? (
<Portrait />
) : (
<div className="flex justify-center ">
<DesktopHome />
</div>
)}
{/* <Landscape /> */}
</>
@ -27,7 +35,6 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = {
setHeaderOptions: publicApi.setHeaderOptions,
};
export default connect(mapStateToProps, mapDispatchToProps)(Home);

Loading…
Cancel
Save