Update img and desgin
هذا الالتزام موجود في:
تم حذف اختلاف الملف لأن أحد الأسطر أو أكثر طويلة جداً
|
قبل العرض: | الارتفاع: | الحجم: 1.1 MiB بعد العرض: | الارتفاع: | الحجم: 1.1 MiB |
ثنائية
src/assets/bgoverherosection.png
Normal file
ثنائية
src/assets/bgoverherosection.png
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 1.1 MiB |
14
src/components/shared/GetUser.ts
Normal file
14
src/components/shared/GetUser.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export const GetUser = () => {
|
||||
let user = null;
|
||||
const userRaw = localStorage.getItem('sp_user');
|
||||
if (userRaw) {
|
||||
try {
|
||||
const userObj = JSON.parse(userRaw);
|
||||
user = userObj?.email || null;
|
||||
return user
|
||||
} catch (e) {
|
||||
user = null;
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,25 @@
|
||||
import { useState } from 'react'
|
||||
import Herosection from "../assets/herosection.svg"
|
||||
import Bgoverherosection from "../assets/bgoverherosection.png"
|
||||
import DashboardPreview from "../assets/MacBookPro.svg"
|
||||
import { Link, useNavigate } from 'react-router-dom'
|
||||
import { useAppDispatch, useAppSelector } from '../store/hooks'
|
||||
import { setUrl } from '../store/urlSlice'
|
||||
import { GetUser } from '../components/shared/GetUser'
|
||||
|
||||
const HomePage = () => {
|
||||
const [urlInput, setUrlInput] = useState('')
|
||||
const navigate = useNavigate()
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
const user = JSON.parse(localStorage.getItem('sp_user') || '').email
|
||||
|
||||
// const user = useAppSelector((state) => state.url.isLoggedIn); // or change to your auth state
|
||||
|
||||
const handleButtonClick = () => {
|
||||
if (urlInput.trim()) {
|
||||
dispatch(setUrl(urlInput.trim()))
|
||||
|
||||
if (user) {
|
||||
if (GetUser()) {
|
||||
navigate('/keywords');
|
||||
} else
|
||||
navigate('/login')
|
||||
@@ -28,11 +30,11 @@ const HomePage = () => {
|
||||
<div className="min-h-screen bg-white overflow-x-hidden">
|
||||
<div className="relative">
|
||||
<div className="absolute inset-x-0 top-0 h-[944px] bg-gradient-to-b from-[#112674] via-[#112674] to-transparent opacity-100"
|
||||
style={{ background: `url(${Herosection})`, backgroundSize: 'cover', backgroundPosition: 'center' }} />
|
||||
style={{ background: `url(${Bgoverherosection})`, backgroundSize: 'cover', backgroundPosition: 'center' }} />
|
||||
|
||||
<div className="absolute inset-x-0 top-0 h-[944px] opacity-full">
|
||||
<img
|
||||
src={Herosection}
|
||||
src={Bgoverherosection}
|
||||
alt=""
|
||||
className="w-full h-full object-cover mix-blend-overlay"
|
||||
/>
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم