Skip to content

Commit

Permalink
Merge branch 'main' of github.com:guildxyz/guild.xyz into profiles-page
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Jul 24, 2024
2 parents 378416c + 41fb580 commit ac413d1
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 316 deletions.
61 changes: 32 additions & 29 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { LegacyPostHogProvider } from "components/_app/LegacyPostHogProvider"
import { LegacyWeb3ConnectionManager } from "components/_app/LegacyWeb3ConnectionManager"
import "wicg-inert"
import AppErrorBoundary from "@/components/AppErrorBoundary"
import { TooltipProvider } from "@/components/ui/Tooltip"
import NextTopLoader from "nextjs-toploader"

const DynamicReCAPTCHA = dynamic(() => import("v2/components/ReCAPTCHA"))
Expand Down Expand Up @@ -65,38 +66,40 @@ const App = ({
<NextTopLoader showSpinner={false} color="#eff6ff" height={3} />

<Chakra cookies={pageProps.cookies}>
<IconContext.Provider
value={{
color: "currentColor",
size: "1em",
weight: "bold",
mirrored: false,
}}
>
<SWRConfig value={{ fetcher: fetcherForSWR }}>
<WagmiProvider config={wagmiConfig} reconnectOnMount={false}>
<QueryClientProvider client={queryClient}>
<FuelProvider ui={false} fuelConfig={fuelConfig}>
<LegacyPostHogProvider>
<IntercomProvider>
<AppErrorBoundary>
<Component {...pageProps} />
</AppErrorBoundary>
<TooltipProvider>
<IconContext.Provider
value={{
color: "currentColor",
size: "1em",
weight: "bold",
mirrored: false,
}}
>
<SWRConfig value={{ fetcher: fetcherForSWR }}>
<WagmiProvider config={wagmiConfig} reconnectOnMount={false}>
<QueryClientProvider client={queryClient}>
<FuelProvider ui={false} fuelConfig={fuelConfig}>
<LegacyPostHogProvider>
<IntercomProvider>
<AppErrorBoundary>
<Component {...pageProps} />
</AppErrorBoundary>

<ClientOnly>
<AccountModal />
</ClientOnly>
</IntercomProvider>
<ClientOnly>
<AccountModal />
</ClientOnly>
</IntercomProvider>

<LegacyWeb3ConnectionManager />
</LegacyPostHogProvider>
</FuelProvider>
</QueryClientProvider>
</WagmiProvider>
</SWRConfig>
<LegacyWeb3ConnectionManager />
</LegacyPostHogProvider>
</FuelProvider>
</QueryClientProvider>
</WagmiProvider>
</SWRConfig>

<Toaster />
</IconContext.Provider>
<Toaster />
</IconContext.Provider>
</TooltipProvider>
</Chakra>
</>
)
Expand Down
41 changes: 17 additions & 24 deletions src/v2/components/Account/components/AccountModal/AccountModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import {
DialogTitle,
} from "@/components/ui/Dialog"
import { Separator } from "@/components/ui/Separator"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/Tooltip"
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/Tooltip"
import { useDisclosure } from "@/hooks/useDisclosure"
import { useUserPublic } from "@/hooks/useUserPublic"
import { LinkBreak, SignOut } from "@phosphor-icons/react/dist/ssr"
Expand Down Expand Up @@ -128,24 +123,22 @@ const AccountModal = () => {
/>
</div>

<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
size="icon"
variant="outline"
className="ml-auto size-8"
onClick={handleLogout}
aria-label="Disconnect"
>
<SignOut weight="bold" className="size-3" />
</Button>
</TooltipTrigger>
<TooltipContent>
<span>Disconnect</span>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
size="icon"
variant="outline"
className="ml-auto size-8"
onClick={handleLogout}
aria-label="Disconnect"
>
<SignOut weight="bold" className="size-3" />
</Button>
</TooltipTrigger>
<TooltipContent>
<span>Disconnect</span>
</TooltipContent>
</Tooltip>
</div>

<AccountConnections />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Separator } from "@/components/ui/Separator"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/Tooltip"
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/Tooltip"
import { cn } from "@/lib/utils"
import { Question } from "@phosphor-icons/react/dist/ssr"
import useUser from "components/[guild]/hooks/useUser"
Expand Down Expand Up @@ -67,16 +62,14 @@ const AccountConnections = () => {
titleRightElement={
addresses?.length > 1 ? (
<div className="flex w-full items-center justify-between">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Question weight="bold" />
</TooltipTrigger>
<TooltipContent>
<p>Each of your addresses will be used for requirement checks</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Question weight="bold" />
</TooltipTrigger>
<TooltipContent>
<p>Each of your addresses will be used for requirement checks</p>
</TooltipContent>
</Tooltip>
<LinkAddressButton variant="ghost" className="-my-1" />
</div>
) : undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Badge, BadgeProps } from "@/components/ui/Badge"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/Tooltip"
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/Tooltip"
import { User } from "types"

type AddressType = Exclude<User["addresses"][number]["walletType"], "EVM">
Expand All @@ -23,18 +18,16 @@ const TYPE_NAMES: Record<AddressType, string> = {
}

const AddressTypeBadge = ({ type, size }: Props) => (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Badge size={size} className="px-1">
<img src={TYPE_ICONS[type]} alt={TYPE_NAMES[type]} className="size-3" />
</Badge>
</TooltipTrigger>
<TooltipContent>
<span>{TYPE_NAMES[type]}</span>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Badge size={size} className="px-1">
<img src={TYPE_ICONS[type]} alt={TYPE_NAMES[type]} className="size-3" />
</Badge>
</TooltipTrigger>
<TooltipContent>
<span>{TYPE_NAMES[type]}</span>
</TooltipContent>
</Tooltip>
)

export default AddressTypeBadge
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ import {
AlertDialogTitle,
} from "@/components/ui/AlertDialog"
import { Button, ButtonProps } from "@/components/ui/Button"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/Tooltip"
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/Tooltip"
import { DisclosureState } from "@/hooks/useDisclosure"
import { cn } from "@/lib/utils"
import { LinkBreak } from "@phosphor-icons/react/dist/ssr"
Expand All @@ -35,24 +30,22 @@ const DisconnectAccountButton = ({
state: DisclosureState
}) => (
<>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
className={cn("size-8 rounded-full px-0", className)}
colorScheme="destructive"
variant="ghost"
aria-label="Disconnect account"
onClick={onOpen}
>
<LinkBreak weight="bold" className="h-3 w-3" />
</Button>
</TooltipTrigger>
<TooltipContent>
<span>Disconnect account</span>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
className={cn("size-8 rounded-full px-0", className)}
colorScheme="destructive"
variant="ghost"
aria-label="Disconnect account"
onClick={onOpen}
>
<LinkBreak weight="bold" className="h-3 w-3" />
</Button>
</TooltipTrigger>
<TooltipContent>
<span>Disconnect account</span>
</TooltipContent>
</Tooltip>

<AlertDialog open={isOpen}>
<AlertDialogContent onEscapeKeyDown={onClose}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ import {
} from "@/components/ui/Form"
import { Input } from "@/components/ui/Input"
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/InputOTP"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/Tooltip"
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/Tooltip"
import { useToast } from "@/components/ui/hooks/useToast"
import { useDisclosure } from "@/hooks/useDisclosure"
import { cn } from "@/lib/utils"
Expand Down Expand Up @@ -266,32 +261,30 @@ const ConnectEmailButton = ({

<DialogFooter className="pt-2">
{shouldShowPinEntry ? (
<TooltipProvider>
<Tooltip open={!isResendButtonDisabled ? false : undefined}>
<TooltipTrigger asChild>
<Button
onClick={submit}
isLoading={
verificationRequest.isLoading ||
connect.isLoading ||
connect.isSigning
}
variant="ghost"
size="sm"
disabled={isResendButtonDisabled}
className="w-full rounded-lg"
>
Resend code
</Button>
</TooltipTrigger>
<TooltipContent>
<p>
Check if you received the first code before requesting a new
one (check in the spam as well)
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<Tooltip open={!isResendButtonDisabled ? false : undefined}>
<TooltipTrigger asChild>
<Button
onClick={submit}
isLoading={
verificationRequest.isLoading ||
connect.isLoading ||
connect.isSigning
}
variant="ghost"
size="sm"
disabled={isResendButtonDisabled}
className="w-full rounded-lg"
>
Resend code
</Button>
</TooltipTrigger>
<TooltipContent>
<p>
Check if you received the first code before requesting a new
one (check in the spam as well)
</p>
</TooltipContent>
</Tooltip>
) : (
<Button
onClick={submit}
Expand Down
Loading

0 comments on commit ac413d1

Please sign in to comment.