Skip to content

Commit

Permalink
fix: max width, badge settings, tweak rarity
Browse files Browse the repository at this point in the history
  • Loading branch information
verbiricha committed Dec 22, 2023
1 parent e82a95b commit b2f24e5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions apps/badges/core/rarity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export function getPow(id: string) {
return nip13.getPow(id);
}

const LEGENDARY = 128;
const EPIC = 64;
const SUPER_RARE = 32;
const RARE = 21;
const LEGENDARY = 64;
const EPIC = 32;
const SUPER_RARE = 21;
const RARE = 12;

export function getMinPow(r: Rarities): number {
if (r === Rarities.Legendary) {
Expand Down
2 changes: 1 addition & 1 deletion apps/badges/ui/badge-award.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function BadgeAward({ award, profile }: BadgeAwardProps) {
<AvatarGroup pubkeys={pubkeys} />
</HStack>
{badge && <Badge event={badge} />}
{badge && profile && session?.pubkey && (
{badge && profile && isForMe && (
<BadgeSettings
badge={badge}
award={award}
Expand Down
1 change: 1 addition & 0 deletions apps/badges/ui/const.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const gradient =
"linear-gradient(90deg, #B10BA5 0%, #CB5A7B 50%, #E29F56 100%)";
export const maxWidth = "72rem";
3 changes: 2 additions & 1 deletion apps/badges/ui/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { nip19 } from "nostr-tools";
import ColorModeSwitch from "./color-mode-switch";
import Link from "./link";
import Avatar from "./avatar";
import { maxWidth } from "./const";

import { useIntl } from "react-intl";

Expand All @@ -39,7 +40,7 @@ export default function Header() {
alignItems="center"
justifyContent="space-between"
width="100%"
maxWidth="60rem"
maxWidth={maxWidth}
py={2}
px={4}
>
Expand Down
5 changes: 3 additions & 2 deletions apps/badges/ui/main.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Stack, StackProps } from "@chakra-ui/react";

import { maxWidth } from "./const";

export default function Main(props: StackProps) {
return (
<Stack
spacing="1.5rem"
width="100%"
maxWidth="60rem"
pt="2rem"
maxWidth={maxWidth}
px="1rem"
{...props}
/>
Expand Down

1 comment on commit b2f24e5

@vercel
Copy link

@vercel vercel bot commented on b2f24e5 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.