Skip to content

Commit

Permalink
fix: add title to iframe and theme switcher, lazy loading iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-xue committed Aug 24, 2024
1 parent 3c253b3 commit f2fc4f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/preview-iframe.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function PreviewIframe({ url }: { url: string }) {
return <iframe src={url} className="w-full h-full" />;
return <iframe title="preview" loading="lazy" src={url} className="w-full h-full" />;
}
2 changes: 1 addition & 1 deletion components/theme-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ThemeSwitcher() {
</div>

return (
<div className="w-full h-full px-3 py-1" onClick={() => onToggleTheme(theme === "light" ? "dark" : "light")}>
<div className="w-full h-full px-3 py-1" onClick={() => onToggleTheme(theme === "light" ? "dark" : "light")} title="Switch Theme">
{theme === "light" && <svg className="swap-on fill-current w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z" />
Expand Down

0 comments on commit f2fc4f1

Please sign in to comment.