File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,23 @@ templ desktopHeader() {
52
52
53
53
templ Header (isMobile bool ) {
54
54
<header class ={ " bg-accent" , " p-[20px]" , " md:p-[10px]" }>
55
+ // mobiles are usually shitty at rendering, so this prevents mobiles from rendering two blocks and choosing one using CSS.
55
56
if isMobile {
56
57
@ mobileHeader ()
57
58
} else {
58
- @ desktopHeader ()
59
+ <div style =" display: contents" class ={ " hidden" , " md:block" }>
60
+ @ desktopHeader ()
61
+ </div >
62
+ <!--
63
+ for when opened on a desktop and the client's width is really small,
64
+ and a similar thing isn't being done for mobile, since mobile clients can't change width w/o reloading
65
+ -->
66
+ <div style =" display: contents" class ={ " md:hidden" }>
67
+ @ mobileHeader ()
68
+ </div >
59
69
}
60
70
</header >
71
+ // script is being used here, so it doesn't render twice on desktops and break shit.
72
+ <script src =" /static/js/search.js" lang =" javascript" >
73
+ </script >
61
74
}
Original file line number Diff line number Diff line change @@ -34,7 +34,5 @@ templ Search() {
34
34
id =" search-suggestions-container"
35
35
></div >
36
36
</div >
37
- //
38
- <script src =" /static/js/search.js" lang =" javascript" >
39
- </script >
37
+ // script is in ui/header/header.templ
40
38
}
You can’t perform that action at this time.
0 commit comments