Skip to content

Commit

Permalink
fixed react hydration error (css issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Oct 1, 2022
1 parent b0f1975 commit a5f902f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 3 additions & 6 deletions components/app/settings/landing-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function DefaultPage() {
/>
) : (
<Tooltip content="You need to verify your domain first.">
<div className="border border-gray-300 text-gray-300 text-sm px-3 py-2 w-full max-w-md cursor-not-allowed rounded-md">
<div className="text-left border border-gray-300 text-gray-300 text-sm px-3 py-2 w-full max-w-md cursor-not-allowed rounded-md">
https://yourdomain.com
</div>
</Tooltip>
Expand All @@ -112,12 +112,9 @@ export default function DefaultPage() {
</button>
) : (
<Tooltip content="You need to verify your domain first.">
<button
disabled
className="cursor-not-allowed bg-gray-100 border-gray-200 text-gray-300 h-9 w-32 text-sm border rounded-md focus:outline-none transition-all ease-in-out duration-150"
>
<div className="cursor-not-allowed bg-gray-100 border-gray-200 text-gray-300 h-9 w-32 flex items-center justify-center text-sm border rounded-md">
Save Changes
</button>
</div>
</Tooltip>
)}
</div>
Expand Down
9 changes: 6 additions & 3 deletions components/shared/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import { ReactNode, useEffect, useRef, useState } from "react";
import { ReactNode, useRef, useState } from "react";
import { motion, AnimatePresence, useAnimation } from "framer-motion";

export default function Tooltip({
Expand Down Expand Up @@ -29,7 +29,10 @@ export default function Tooltip({
const randomIndex = Math.floor(Math.random() * 1000000).toString();
return (
<>
<button className="block sm:hidden" onClick={() => setOpenTooltip(true)}>
<button
className="inline-flex sm:hidden"
onClick={() => setOpenTooltip(true)}
>
{children}
</button>
<AnimatePresence>
Expand Down Expand Up @@ -81,7 +84,7 @@ export default function Tooltip({
</AnimatePresence>
<TooltipPrimitive.Provider delayDuration={100}>
<TooltipPrimitive.Root>
<TooltipPrimitive.Trigger className="hidden sm:flex" asChild>
<TooltipPrimitive.Trigger className="hidden sm:inline-flex" asChild>
{children}
</TooltipPrimitive.Trigger>
<TooltipPrimitive.Content
Expand Down

0 comments on commit a5f902f

Please sign in to comment.