Skip to content

Commit

Permalink
useClient
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiasWorker committed Mar 13, 2024
1 parent b6c8198 commit 916f10a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/site-isotype/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { useParallax } from "@atomico/hooks/use-parallax";
import { c, css, useRef } from "atomico";
import { c, css, useMemo, useRef, options, UseMemo } from "atomico";
import { SitePlanet } from "../site-planet";
import { tokensColor, tokensSize } from "../site-tokens";

const isAndroid = navigator.userAgent.toLowerCase().includes("android");
const useClient: UseMemo = (callback, args) =>
useMemo(() => {
if (options.ssr) return;
return callback();
}, args);

function siteIsotype() {
const host = useRef(globalThis);
const state = useParallax(host);
const isAndroid = useClient(
() => navigator.userAgent.toLowerCase().includes("android"),
[]
);

return (
<host shadowDom>
<div class="atom-orbe" style="--orbe-size: 1.5; opacity:.5">
Expand Down

0 comments on commit 916f10a

Please sign in to comment.