mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 07:27:23 +02:00
refactor: Update domain to grimoire.rocks and prioritize premium styling
Changes: - Update all references from grimoire.app to grimoire.rocks - Make premium gradient styling highest priority (even above active account) - New visual hierarchy: premium (gradient) > active account (orange) > standard (accent) This ensures premium grimoire.rocks users always stand out with the gradient, even when viewing their own profile.
This commit is contained in:
@@ -14,20 +14,20 @@ interface UserNameProps {
|
||||
* Component that displays a user's name from their Nostr profile
|
||||
* Shows placeholder derived from pubkey while loading or if no profile exists
|
||||
* Clicking opens the user's profile
|
||||
* Uses gradient styling for grimoire.rocks premium users (highest priority)
|
||||
* Uses orange-400 color for the logged-in user
|
||||
* Uses gradient styling for grimoire.app premium users
|
||||
*/
|
||||
export function UserName({ pubkey, isMention, className }: UserNameProps) {
|
||||
const { addWindow, state } = useGrimoire();
|
||||
const profile = useProfile(pubkey);
|
||||
const displayName = getDisplayName(pubkey, profile);
|
||||
|
||||
// Check if this is a grimoire.rocks premium user (highest priority)
|
||||
const isPremium = isGrimoirePremium(pubkey);
|
||||
|
||||
// Check if this is the logged-in user
|
||||
const isActiveAccount = state.activeAccount?.pubkey === pubkey;
|
||||
|
||||
// Check if this is a grimoire.app premium user
|
||||
const isPremium = isGrimoirePremium(pubkey);
|
||||
|
||||
const handleClick = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
addWindow("profile", { pubkey });
|
||||
@@ -38,10 +38,10 @@ export function UserName({ pubkey, isMention, className }: UserNameProps) {
|
||||
dir="auto"
|
||||
className={cn(
|
||||
"font-semibold cursor-crosshair hover:underline hover:decoration-dotted",
|
||||
isActiveAccount
|
||||
? "text-orange-400"
|
||||
: isPremium
|
||||
? "text-grimoire-gradient"
|
||||
isPremium
|
||||
? "text-grimoire-gradient"
|
||||
: isActiveAccount
|
||||
? "text-orange-400"
|
||||
: "text-accent",
|
||||
className,
|
||||
)}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function QueryNip05({
|
||||
// Only show if verified
|
||||
if (nip05pubkey !== pubkey) return null;
|
||||
|
||||
// Check if this is a grimoire.app premium user (by pubkey or NIP-05)
|
||||
// Check if this is a grimoire.rocks premium user (by pubkey or NIP-05)
|
||||
const isPremium = isGrimoirePremium(pubkey) || isGrimoireNip05(nip05);
|
||||
const displayNip05 = nip05.replace(/^_@/, "");
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { nip19 } from "nostr-tools";
|
||||
|
||||
/**
|
||||
* Hardcoded test pubkey for grimoire.app premium treatment
|
||||
* Hardcoded test pubkey for grimoire.rocks premium treatment
|
||||
* npub107jk7htfv243u0x5ynn43scq9wrxtaasmrwwa8lfu2ydwag6cx2quqncxg
|
||||
*/
|
||||
const PREMIUM_TEST_PUBKEY = (() => {
|
||||
@@ -16,7 +16,7 @@ const PREMIUM_TEST_PUBKEY = (() => {
|
||||
})();
|
||||
|
||||
/**
|
||||
* Check if a pubkey should receive grimoire.app premium visual treatment
|
||||
* Check if a pubkey should receive grimoire.rocks premium visual treatment
|
||||
* Currently hardcoded for testing, will be replaced with NIP-05 check
|
||||
*/
|
||||
export function isGrimoirePremium(pubkey: string): boolean {
|
||||
@@ -24,17 +24,17 @@ export function isGrimoirePremium(pubkey: string): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a NIP-05 identifier is a grimoire.app address
|
||||
* Future: Will check for @grimoire.app suffix
|
||||
* Check if a NIP-05 identifier is a grimoire.rocks address
|
||||
* Future: Will check for @grimoire.rocks suffix
|
||||
*/
|
||||
export function isGrimoireNip05(nip05?: string): boolean {
|
||||
if (!nip05) return false;
|
||||
return nip05.endsWith("@grimoire.app");
|
||||
return nip05.endsWith("@grimoire.rocks");
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract username from grimoire.app NIP-05
|
||||
* Returns null if not a grimoire.app address
|
||||
* Extract username from grimoire.rocks NIP-05
|
||||
* Returns null if not a grimoire.rocks address
|
||||
*/
|
||||
export function getGrimoireUsername(nip05: string): string | null {
|
||||
if (!isGrimoireNip05(nip05)) return null;
|
||||
|
||||
Reference in New Issue
Block a user