Skip to content

Commit

Permalink
feat: fixed bugs on MovieDetail page
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiyDmytruk committed Oct 9, 2023
1 parent 743558b commit dab4808
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/pages/MovieDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@ import { items } from "@/movies.json";
import MovieStarRating from "@/MovieStarRating.vue";
const props = defineProps({
id: {type: Number, default: null}
})
id: { type: Number, default: null },
});
const movies = ref(items);
const movie = computed(() => movies.value.find((m) => m.id === props.id))
const movie = computed(() => movies.value.find((m) => m.id === props.id));
</script>
<template>

<div class="container flex items-center max-w-6xl gap-4 p-10 m-auto">
<RouterLink class="w-full"
:to="{ name: 'home' }">
Home
</RouterLink>
</div>

<div
class="container flex items-center max-w-6xl gap-4 p-10 m-auto dark:text-white"
class="container flex items-center max-w-6xl gap-4 p-10 m-auto text-white"
>
<RouterLink class="w-full" :to="{ name: 'home' }">
Back to Category
</RouterLink>
</div>

<div
class="container flex items-center max-w-6xl gap-4 p-10 m-auto text-white"
>
<figure class="relative">
<MovieStarRating :rating="movie.rating" class="absolute top-5 right-5" />
<img :src="movie.image" :alt="movie.name" class="w-96" />
Expand Down

0 comments on commit dab4808

Please sign in to comment.