File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545
4646 const classes = $derived ({
4747 common: cn (
48- ' flex items-center justify-between my-4 pb-4 border-b-[1px] md:border-0 border-grey px-4 '
48+ ' flex items-center justify-between my-4 pb-6 border-b-[1px] md:border-0 border-grey'
4949 ),
5050 text: variantClasses [variant ].text ,
5151 background: variantClasses [variant ].background
Original file line number Diff line number Diff line change 99 let route = $derived (page .url .pathname );
1010 let heading = $state (' ' );
1111
12- const routeToHeading: Record <string , string > = {
13- ' /home' : ' Feed' ,
14- ' /discover' : ' Search' ,
15- ' /post' : ' Post' ,
16- ' /messages' : ' Messages' ,
17- ' /settings' : ' Settings' ,
18- ' /profile' : ' Profile'
19- };
20-
2112 $effect (() => {
22- heading = routeToHeading [route ] ?? heading ;
13+ if (route .includes (' home' )) {
14+ heading = ' Feed' ;
15+ } else if (route .includes (' discover' )) {
16+ heading = ' Search' ;
17+ } else if (route .includes (' post' )) {
18+ heading = ' Post' ;
19+ } else if (route .includes (' messages' )) {
20+ heading = ' Messages' ;
21+ } else if (route .includes (' settings' )) {
22+ heading = ' Settings' ;
23+ } else if (route .includes (' profile' )) {
24+ heading = ' Profile' ;
25+ } else {
26+ heading = ' ' ;
27+ }
2328 });
2429 </script >
2530
2631<main class =" block h-[100dvh] grid-cols-[20vw_auto_30vw] md:grid" >
2732 <SideBar profileSrc ="https://picsum.photos/200" handlePost ={async () => alert (' adas' )} />
28- <section class =" mx-4 md:mx-8 md:pt-10" >
33+
34+ <section class =" mx-4 md:mx-8 md:pt-8" >
2935 <div class =" flex justify-between" >
3036 <Header variant ="primary" {heading } />
3137 {#if route === ' /profile' }
Original file line number Diff line number Diff line change 5858 });
5959 </script >
6060
61- <ul bind:this ={listElement } class =" hide-scrollbar h-[600px] overflow-auto" >
61+ <ul bind:this ={listElement } class =" hide-scrollbar overflow-auto" >
6262 {#each visiblePosts as post }
6363 <li class =" mb-6" >
6464 <Post
Original file line number Diff line number Diff line change 22 let { children } = $props ();
33 </script >
44
5- <div class =" flex flex-col gap-5 px-5 " >
5+ <div class =" flex flex-col gap-5" >
66 {@render children ()}
77</div >
You can’t perform that action at this time.
0 commit comments