mirror of
https://github.com/task-17-lct/frontend.git
synced 2025-02-22 13:32:47 +03:00
fix like bug
This commit is contained in:
parent
4d178a3b8a
commit
2624ae4e32
|
@ -10,7 +10,8 @@ export interface EventCardIE{
|
||||||
lat: number,
|
lat: number,
|
||||||
lon: number,
|
lon: number,
|
||||||
oid: string,
|
oid: string,
|
||||||
title: string
|
title: string,
|
||||||
|
True?:boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
enum category{
|
enum category{
|
||||||
|
@ -31,7 +32,7 @@ enum category{
|
||||||
export const EventCard:React.FC<EventCardIE> = (props) =>{
|
export const EventCard:React.FC<EventCardIE> = (props) =>{
|
||||||
let location = useLocation()
|
let location = useLocation()
|
||||||
|
|
||||||
const [liked, setLiked] = useState(location.pathname == '/favorites'? true:false)
|
const [liked, setLiked] = useState(location.pathname == '/favorites' || props.True? true:false)
|
||||||
|
|
||||||
const onLiked = ()=>{
|
const onLiked = ()=>{
|
||||||
if (localStorage.getItem('token') != null){
|
if (localStorage.getItem('token') != null){
|
||||||
|
|
|
@ -120,7 +120,9 @@ export const Main: react.FC = () => {
|
||||||
lat={1}
|
lat={1}
|
||||||
lon={2}
|
lon={2}
|
||||||
oid={favorite.oid}
|
oid={favorite.oid}
|
||||||
title={favorite.title} ></EventCard>
|
title={favorite.title}
|
||||||
|
True={true}
|
||||||
|
></EventCard>
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return null
|
return null
|
||||||
|
|
Loading…
Reference in New Issue
Block a user