-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(RewardCard): change layout with container queries * chore: update schemas * feat: custom reward cards for permissions and points * feat: fetch real rewards data and add a simple reward leaderboard * fix: remove points name for now * feat: separate join and leave guild components * feat: useGuild hook * fix: add missing use client directives * feat: auth rework (#1581) * feat: use `https` in development * feat: use httpOnly cookie for authenticated requests * feat: third party auth (#1582) * feat: 3rd party auth flow * feat(ConnectResultToast): add toast icons * chore: update readme * cleanup: remove unnecessary components * fix: invalidate queries when signing in/out * feat: join modal * feat: DiscordRewardCard * cleanup(RoleCard): remove unnecessary TODO comments * feat: better identity-related types * fix(DiscordRewardCard): disabled state * fix(ConnectResultToast): show toast only after platform connection * fix(PointsRewardCard): don't use pathname for navigation * fix(rewardCards): add proper types * feat(leaderboard): display points' name * feat(leaderboard): display user addresses & "Your position" section * feat(DiscordRewardCard): more detailed tooltip message
- Loading branch information
1 parent
0d6a0df
commit 8f10e63
Showing
46 changed files
with
1,160 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,5 @@ bun.lockb | |
/playwright/.cache/ | ||
/playwright/.auth/ | ||
/playwright/results | ||
|
||
certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/app/(dashboard)/[guildUrlName]/components/ActionButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
|
||
import { Button } from "@/components/ui/Button"; | ||
import { userOptions } from "@/lib/options"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { useGuild } from "../hooks/useGuild"; | ||
import { JoinGuild } from "./JoinGuild"; | ||
import { LeaveGuild } from "./LeaveGuild"; | ||
|
||
export const ActionButton = () => { | ||
const user = useQuery(userOptions()); | ||
const guild = useGuild(); | ||
|
||
if (!guild.data) { | ||
throw new Error("Failed to fetch guild"); | ||
} | ||
|
||
const isJoined = !!user.data?.guilds?.some( | ||
({ guildId }) => guildId === guild.data.id, | ||
); | ||
|
||
return isJoined ? <LeaveGuild /> : <JoinGuild />; | ||
}; | ||
|
||
export const ActionButtonSkeleton = () => ( | ||
<Button isLoading loadingText="Loading"> | ||
Join guild | ||
</Button> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.