Skip to content

Commit

Permalink
fix(web): inline a piece of javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Oct 2, 2024
1 parent 25a2dae commit f948214
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ function updateHeroLayout() {
const paddingBottom = y <= MaxPaddingBottom ? MaxPaddingBottom - y : 0;
const height = paddingTop + SearchHeight + paddingBottom;

const hero = document.querySelector('.hero') as HTMLElement;
const hero = document.querySelector('.hero');
if (hero) hero.style.height = height + 'px';
const top = document.querySelector('.hero-top') as HTMLElement;
const top = document.querySelector('.hero-top');
if (top) {
top.style.top = paddingTop - MaxPaddingTop + 'px';
top.classList.remove('hidden');
}
const search = document.querySelector('.hero-search') as HTMLElement;
const search = document.querySelector('.hero-search');
if (search) search.style.top = paddingTop + 'px';
const bottom = document.querySelector('.hero-bottom') as HTMLElement;
const bottom = document.querySelector('.hero-bottom');
if (bottom) {
bottom.style.top = paddingTop + SearchHeight + 'px';
bottom.style.height = paddingBottom + 'px';
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/web/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import './styles/main.css';
import './styles/layout.css';
import './styles/sonner.css';

import global from '~/layouts/global?url';
import global from '~/layouts/global.js?raw';
import { Toaster } from '~/components/ui/sonner';

export function Layout({ children }: { children: React.ReactNode }) {
Expand All @@ -23,7 +23,7 @@ export function Layout({ children }: { children: React.ReactNode }) {
<link rel="mask-icon" color="#FFFFFF" href="/favicon.svg" />
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="theme-color" content="#ffffff" />
<script src={global}></script>
<script dangerouslySetInnerHTML={{ __html: global }}></script>
<Meta />
<Links />
</head>
Expand Down

0 comments on commit f948214

Please sign in to comment.