Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phosphor icons experiments #1386

Closed
wants to merge 68 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
4eb63e7
install/upgrade dependencies & configure shadcn/ui
BrickheadJohnny Jun 27, 2024
f2e1010
use ts for tailwind config
BrickheadJohnny Jun 27, 2024
71a186f
add basic `layout.tsx`
BrickheadJohnny Jun 27, 2024
88fae3b
fix: remove top-level `/app` folder & add playground page
BrickheadJohnny Jun 27, 2024
fc83d9c
v2 add next theme (#1325)
dominik-stumpf Jun 27, 2024
d474773
feat: `Card` component (#1326)
BrickheadJohnny Jun 27, 2024
8d024c8
feat: `Dialog` component (#1328)
BrickheadJohnny Jun 27, 2024
a32ceb6
add shadcn button and style adjustments (#1327)
dominik-stumpf Jun 27, 2024
3a9323c
build: revert sourcing on postinstall
dominik-stumpf Jun 27, 2024
c69176d
fix(DialogExample): add `asChild` prop to trigger
BrickheadJohnny Jun 27, 2024
ea661c7
feat(Dialog): add focus management props
BrickheadJohnny Jun 28, 2024
156b4d2
feat(Dialog): export `DialogCloseButton` component
BrickheadJohnny Jun 28, 2024
46f8618
fix: update `--muted-foreground` variable
BrickheadJohnny Jun 29, 2024
7edc914
fix(ThemeToggle): make the buttons smaller
BrickheadJohnny Jun 29, 2024
d8d321d
Storybook (#1332)
BrickheadJohnny Jun 29, 2024
f6694f4
feat: add tooltip (#1335)
dominik-stumpf Jul 1, 2024
0a923e6
feat: `Toast` component & `useToast` hook (#1333)
BrickheadJohnny Jul 1, 2024
544146d
feat: `AlertDialog` component (#1337)
BrickheadJohnny Jul 1, 2024
773c2f7
Merge remote-tracking branch 'origin' into shadcn-ui
dominik-stumpf Jul 1, 2024
7a54835
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 2, 2024
5ae1590
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 2, 2024
e837fff
`Dialog` improvements (#1351)
BrickheadJohnny Jul 3, 2024
0e6572a
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 4, 2024
e9635f8
fix(AlertDialog.stories): import types only
BrickheadJohnny Jul 4, 2024
64ac97b
fix(useToast): eslint issue
BrickheadJohnny Jul 4, 2024
da54c40
feat: `Form` component (#1358)
BrickheadJohnny Jul 5, 2024
25c0d32
feat: `Badge` component
BrickheadJohnny Jul 8, 2024
b1bf522
feat: `DropdownMenu` component (#1359)
BrickheadJohnny Jul 8, 2024
a525c4b
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 9, 2024
a400f6d
chore: change default theme to dark
dominik-stumpf Jul 9, 2024
163c8a9
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 10, 2024
08601ab
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 10, 2024
39fdd57
feat: add anchor component (#1362)
dominik-stumpf Jul 10, 2024
399161c
chore: merge main branch
dominik-stumpf Jul 10, 2024
c26854d
style: apply biome check
dominik-stumpf Jul 10, 2024
0d79c4b
feat: add header (#1329)
dominik-stumpf Jul 10, 2024
406b992
Merge branch 'main' of github.com:guildxyz/guild.xyz into shadcn-ui
dominik-stumpf Jul 10, 2024
fa8b9dc
style: apply biome check
dominik-stumpf Jul 10, 2024
870188b
feat: add avatar and separator
dominik-stumpf Jul 10, 2024
aa75541
chore: update team href
dominik-stumpf Jul 10, 2024
626b754
Merge branch 'main' into shadcn-ui
BrickheadJohnny Jul 11, 2024
7edde79
fix: ring colors
BrickheadJohnny Jul 11, 2024
4cf228c
fix(CardMotionWrapper): add easing functions
BrickheadJohnny Jul 11, 2024
e0d19dd
fix(Dialog): ring color
BrickheadJohnny Jul 11, 2024
10ef137
fix: fine-tune accent & border colors
BrickheadJohnny Jul 11, 2024
8b4b437
fix(SharedSocials): UI improvements
BrickheadJohnny Jul 11, 2024
d6e4fc5
fix(ThemeToggle): make it work in both pages & app router
BrickheadJohnny Jul 11, 2024
c6e62e3
fix: minor UI issues
BrickheadJohnny Jul 11, 2024
3aa6e44
fix(ConnectRequirementPlatformButton): use the new `Button` component
BrickheadJohnny Jul 11, 2024
4baf3fa
fix(RequirementConnectButton): accept `ButtonProps`
BrickheadJohnny Jul 11, 2024
7470a91
feat: add notifications (#1360)
dominik-stumpf Jul 11, 2024
3cc3cdc
feat: add compound layout component (#1363)
dominik-stumpf Jul 11, 2024
1260a27
fix(NavMenu): add create-guild
dovalid Jul 11, 2024
fcaba43
UI(NavMenu): whitespace impros, highlight current path
dovalid Jul 11, 2024
afa804e
fix(NavMenu): use the `usePathname` hook
BrickheadJohnny Jul 12, 2024
2aecad4
fix(ThemeToggle): remove `console.log`
BrickheadJohnny Jul 12, 2024
b9e602d
v2 explorer (#1330)
dominik-stumpf Jul 12, 2024
efca6a1
UI(Dialog): mobile style
dovalid Jul 12, 2024
19256a6
Merge branch 'main' of github.com:guildxyz/guild.xyz into shadcn-ui
dominik-stumpf Jul 12, 2024
3bee065
fix(css): darken dark mode skeleton color (#1379)
dominik-stumpf Jul 13, 2024
638a502
chore: delete linux related esbuild plugin (#1380)
dominik-stumpf Jul 13, 2024
0b114cc
notification fix and cleanup (#1377)
dominik-stumpf Jul 13, 2024
821b6f0
fix(layout): add `antialiased` class
BrickheadJohnny Jul 15, 2024
7b85870
fix(Dialog): close animation
BrickheadJohnny Jul 15, 2024
500f833
chore: import types & context from `/dist/lib/...`
BrickheadJohnny Jul 15, 2024
9697adb
chore: remove `* as React` imports
BrickheadJohnny Jul 15, 2024
e272944
Merge branch 'shadcn-ui' into phosphor-icons-experiments
BrickheadJohnny Jul 15, 2024
ebfa1d2
feat: add `usedExports: true` to webpack config
BrickheadJohnny Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add notifications (#1360)
* feat: add header

* chore: configure navigator

* feat: `Providers` component

* chore: disable navigator on blur

* feat: `NavigationEvents` component

* refactor: make providers work with both routers

* feat: add IntercomProvider

* feat: usePrevious hook

* feat(CardMotionWrapper): use `m.div` instead of `MotionBox`

* wip: WalletSelectorModal without Google login button

* update package-lock

* fix: proper button states in wallet selector modal

* feat: `NavMenu` as popover

* feat: `CopyableAddress` component

* fix(useGuild): use the new `usePathname` hook

* fix: export `connectorButtonBaseProps` from `ConnectorButton`

* refactor toast related css variables

* fix: replace relevant toasts with our new toast component

* chore: upgrade nextjs

* wip: account modal

* cleanup playground

* refactor posthog, intercom, web3 related contexts & hooks

* cleanup: remove `DialogExample`

* fix(CardMotionWrapper): remove the `EASING` import

* Try fix build "out of memory" error (#1347)

* build: allocate more memory for nodejs on build

* build: increase memory limit

* chore: remove posthog provider to test build error

* chore: remove posthog provider to test build error

* chore: remove reward import

* build: remove memory limit override

* chore: fix circular import

* fix: update import outside v2

* fix: add missing react suspense

* Revert "chore: remove reward import"

This reverts commit b2cf1d8.

* chore: remove accidental svg

* fix(layout): add back `PostHogPageViews`

---------

Co-authored-by: BrickheadJohnny <johnny.zgen@gmail.com>

* feat(CopyableAddress): add tooltip

* feat: `NetworkModal` migration

* feat: `Accordion` component

* temporarily remove `CircularDependencyPlugin`

* move `platformMergeAlertAtom` to `atoms.ts`

* fix(useUserPublic): comment posthog related stuff

* feat: `FarcasterProfile` component

* fix ring color in light mode

* fix: remove ring offset

* fix: connect Farcaster button colors

* feat: define css vars for every platform type

* fix(SocialAccount): use the correct button colors

* feat: `Collapse` component

* feat(Form): don't re-export `FormProvider` as `Form`

* chore: remove old `Header` & `NavMenu`

* fix: Button & Input classNames

* feat(FormErrorMessage): add collapse animation

* feat: migrate the `EmailAddress` component

* chore: migrate `useDisconnect`

* fix(AccountModal): simplify modal state

* fix(EmailAddress): verify flow

* chore: remove unused `AccountButton`

* cleanup: move `processEmailError` inside `AccountModal/utils`

* feat: `useGuildUrlNameFromPathname` helper hook

* wip: `SharedSocials` migration

* refactor: move `useEditSharedSocials` to the `v2` folder

* feat: finish `SharedSocial` migration

* feat: `useErrorToast` hook

* fix(WalletSelectorModal): remove `CardMotionWrapper`

* fix(Button): remove important modifier

* fix(WalletSelectorModal): remove animations

* feat: "Linked addresses" section

* feat: `WalletLinkHelperModal` migration

* feat: `UsersGuildPins` migration

* fix(UsersGuildPins): `isValidating` logic

* fix(_app): remove custom-scrollbar.css import

* patch package-lock

* fix(playground): remove Section component

* chore(playground): remove FormExample

* cleanup: remove unused `GoogleTerms` component

* feat: migrate the `Error` component

* cleanup(LinkedAddress): remove unused legacy code

* fix: use bold icons everywhere under the `/v2` directory

* feat: `/cwaas-export` page

* fix(next.config.js): add `CircularDependencyPlugin`

* fix: uncomment `useResolveAddress` hook usages

* fix(Account): simplify conditional classNames

* fix: don't use `clsx` inside `cn` calls

* fix(usePrevious): remove assertion

* fix(EmailAddress): better generic type for `emailSentAt` state

* chore(NetworkButton): add comment about `img`

* fix(CopyableAddress): simplify className

* fix(NavMenu): remove unnecessary boolean inversion

* cleanup(ConnectorButton): use descriptive variable names

* fix(AddressTypeBadge): tooltip content

* feat: use the `useTheme` hook for dynamic connector icons

* cleanup(useWeb3ConnectionManager): remove ternary

* fix: use consistent ring sizes

* cleanup(tailwind.config.ts): remove unnecessary custom animations

* fix(WalletSelectorModal): move export link to the end of the list

* feat: `IntercomProvider` migration

* feat: `PlatformMergeErrorAlert` migration

* feat: `useConnectFromLocalStorage` migration

* fix(_app): add `Toaster`

* feat: add notifications

* feat: add separator

* feat: add notifications

* feat: `Collapsible` component

* fix(useLensProfile): don't import icon from the requirements config

* fix(EmailAddress): use the new  hook

* fix(FarcasterProfile): use the new  hook

* feat: new `GuildLogo` component

* fix(SharedSocials): use the new `GuildLogo` component

* fix: add more packages to `optimizePackageImports`

* fix(useTriggerNetworkChange): use the new `useToast` hook

* fix: patch package-lock

* fix: Tooltip animation duration

* cleanup: remove some unnecessary comments

* feat(WalletSelectorModal): use the new `Anchor` tag

* feat: add skeleton for notification

* chore: add sign in button

* refactor: write biome check unsafe

* chore: fix ts errors

* feat: add subscribe option

* feat: add modals to notification

* refactor: separate view and container

* cleanup: small copy/naming improvements

* fix(Skeleton): define a CSS variable for skeleton background

* fix(Account): styling/layout improvements

* fix(Skeleton): use the new CSS variables

* refactor: load the `Web3Inbox` component dynamically

* fix: dynamic popover width

---------

Co-authored-by: BrickheadJohnny <johnny.zgen@gmail.com>
  • Loading branch information
dominik-stumpf and BrickheadJohnny authored Jul 11, 2024
commit 7470a9181ffaf95282eb03afc808b182f7b929bd
84 changes: 76 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
--background: 240 5% 96%;
--foreground: 240 4% 16%;

--skeleton: 240 5% 84%;

--card: 0 0% 100%;
--card-secondary: 0 0% 98%;
--card-foreground: var(--foreground);
Expand Down Expand Up @@ -104,6 +106,8 @@
--background: 240 3.7% 15.88%;
--foreground: 210 20% 98%;

--skeleton: 240 5% 65%;

--card: 240 5.26% 26.08%;
--card-secondary: 240 5% 22%;
--card-foreground: var(--foreground);
Expand Down
34 changes: 32 additions & 2 deletions src/v2/components/Account/Account.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
"use client"

import { useDisclosure } from "@/hooks/useDisclosure"
import { cn } from "@/lib/utils"
import { Bell } from "@phosphor-icons/react"
import { SignIn } from "@phosphor-icons/react/dist/ssr"
import useUser from "components/[guild]/hooks/useUser"
import useResolveAddress from "hooks/useResolveAddress"
import { useSetAtom } from "jotai"
import shortenHex from "utils/shortenHex"
import { GuildAvatar } from "../GuildAvatar"
import { usePostHogContext } from "../Providers/PostHogProvider"
import { accountModalAtom, walletSelectorModalAtom } from "../Providers/atoms"
import { useWeb3ConnectionManager } from "../Web3ConnectionManager/hooks/useWeb3ConnectionManager"
import { Button } from "../ui/Button"
import { Card } from "../ui/Card"
import { Popover, PopoverContent, PopoverTrigger } from "../ui/Popover"
import { NotificationContent } from "./components/Notification/NotificationContent"

export const Account = () => {
const { address } = useWeb3ConnectionManager()
const setIsAccountModalOpen = useSetAtom(accountModalAtom)
const setIsWalletSelectorModalOpen = useSetAtom(walletSelectorModalAtom)
const { isOpen, setValue } = useDisclosure()

const domainName = useResolveAddress(address)
const { addresses } = useUser()
const linkedAddressesCount = (addresses?.length ?? 1) - 1
const { captureEvent } = usePostHogContext()

if (!address)
return (
Expand All @@ -32,8 +39,31 @@ export const Account = () => {
)

return (
<Card>
<Button variant="ghost" onClick={() => setIsAccountModalOpen(true)}>
<Card className="flex items-center">
<Popover open={isOpen} onOpenChange={setValue}>
<PopoverTrigger asChild>
<Button
variant="ghost"
className="rounded-r-none border-border border-r"
aria-label="Notifications"
onClick={() => {
if (isOpen) return
captureEvent("opened UserActivityLogPopover")
}}
>
<Bell weight="bold" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[min(100vw,theme(space.96))]">
<NotificationContent />
</PopoverContent>
</Popover>

<Button
variant="ghost"
onClick={() => setIsAccountModalOpen(true)}
className="rounded-l-none"
>
<div className="flex items-center gap-3">
<div className="flex flex-col items-end gap-0">
<span
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"use client"

import { useWeb3ConnectionManager } from "@/components/Web3ConnectionManager/hooks/useWeb3ConnectionManager"
import { Anchor } from "@/components/ui/Anchor"
import { buttonVariants } from "@/components/ui/Button"
import { Separator } from "@/components/ui/Separator"
import { cn } from "@/lib/utils"
import { ArrowRight } from "@phosphor-icons/react"
import dynamic from "next/dynamic"
import { Web3InboxSkeleton } from "./Web3InboxSkeleton"

const DynamicWeb3Inbox = dynamic(() => import("./Web3Inbox"), {
ssr: false,
loading: Web3InboxSkeleton,
})

export const NotificationContent = () => {
const { type } = useWeb3ConnectionManager()

return (
<div>
{type === "EVM" && (
<>
<section>
<h3 className="mx-4 mb-4 font-bold text-muted-foreground text-xs">
MESSAGES
</h3>
<div className="flex flex-col gap-4">
<DynamicWeb3Inbox />
</div>
</section>
<Separator className="my-4" />
</>
)}
<div className="px-4">
<Anchor
variant="silent"
className={cn(
buttonVariants({ variant: "ghost", size: "md" }),
"w-full gap-2"
)}
href="/profile/activity"
>
View recent activity
<ArrowRight />
</Anchor>
</div>
</div>
)
}
Loading
Loading