File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 7575 });
7676 </script >
7777
78- {#if ! mini || isFavorite }
78+ {#if ! mini }
7979 <div class =" code-heart" >
8080 <button
8181 class =" heart-button"
9494 {/if }
9595 </button >
9696 </div >
97+ {:else }
98+ <div class =" code-heart" >
99+ {#if isFavorite }
100+ <svg xmlns =" http://www.w3.org/2000/svg" class =" heart-icon filled" viewBox =" 0 0 24 24" width =" 24" height =" 24" >
101+ <path fill =" currentColor" d =" M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
102+ </svg >
103+ {/if }
104+ </div >
97105{/if }
98106
99107<style >
Original file line number Diff line number Diff line change 22const { sessions } = Astro .props ;
33import Prose from " @ui/Prose.astro" ;
44import Tag from " @ui/Tag.astro" ;
5+ import CodeHeart from " @components/island/CodeHeart.svelte" ;
56import SessionSpeakers from " ./session-speakers.astro" ;
67
78type Session = {
89 data: {
910 title: string ;
11+ code: string ;
1012 speakers: Array <{
1113 id: string ;
1214 collection: " speakers" ;
@@ -34,6 +36,13 @@ type Session = {
3436 <a href = { ` /session/${session .id } ` } class = " underline" >
3537 { session .data .title }
3638 </a >
39+
40+ <CodeHeart
41+ client :load
42+ mini = { true }
43+ codeId = { session .data .code }
44+ title = { session .data .title }
45+ />
3746 </h4 >
3847 <p >
3948 <span class = " sr-only" >Speakers:</span >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { Image } from "astro:assets";
66import Markdown from " @ui/Markdown.astro" ;
77import Headline from " @ui/Headline.astro" ;
88import Section from " @ui/Section.astro"
9+ import CodeHeart from " @components/island/CodeHeart.svelte" ;
910
1011
1112export async function getStaticPaths() {
@@ -249,6 +250,13 @@ function getGitHosting(url: string): string | undefined {
249250 >
250251 { session .data .title }
251252 </a >
253+
254+ <CodeHeart
255+ client :load
256+ mini = { true }
257+ codeId = { session .data .code }
258+ title = { session .data .title }
259+ />
252260 </li >
253261 ))
254262 }
You can’t perform that action at this time.
0 commit comments