mirror of
https://github.com/task-17-lct/frontend.git
synced 2024-11-10 22:36:35 +03:00
fix like bug
This commit is contained in:
parent
4d178a3b8a
commit
2624ae4e32
|
@ -10,7 +10,8 @@ export interface EventCardIE{
|
|||
lat: number,
|
||||
lon: number,
|
||||
oid: string,
|
||||
title: string
|
||||
title: string,
|
||||
True?:boolean
|
||||
}
|
||||
|
||||
enum category{
|
||||
|
@ -31,7 +32,7 @@ enum category{
|
|||
export const EventCard:React.FC<EventCardIE> = (props) =>{
|
||||
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 = ()=>{
|
||||
if (localStorage.getItem('token') != null){
|
||||
|
|
|
@ -120,7 +120,9 @@ export const Main: react.FC = () => {
|
|||
lat={1}
|
||||
lon={2}
|
||||
oid={favorite.oid}
|
||||
title={favorite.title} ></EventCard>
|
||||
title={favorite.title}
|
||||
True={true}
|
||||
></EventCard>
|
||||
}
|
||||
else{
|
||||
return null
|
||||
|
|
Loading…
Reference in New Issue
Block a user