Skip to content

Commit

Permalink
various fixes, update custom user
Browse files Browse the repository at this point in the history
  • Loading branch information
pogseal committed Oct 18, 2024
1 parent 070a3d1 commit f7c94a8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
8 changes: 5 additions & 3 deletions app/db/custom/CustomUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import {
} from "../collections/users/users.access";
export const Users: CollectionConfig = {
slug: "users",
auth: true,
auth: {
useAPIKey: true,
},
access: {
read: () => true,
create: () => true,
read: isStaff,
create: isStaff,
delete: isStaff,
update: isStaffOrSelf,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function SectionTitle({
return (
<div
id={customSlug && !section ? customSlug : undefined}
className="max-w-[728px] mx-auto scroll-mt-[72px] z-50 relative"
className="max-w-[728px] mx-auto scroll-mt-[72px] relative"
>
{!customSlug && !section ? (
<div>
Expand Down
30 changes: 16 additions & 14 deletions app/routes/_site+/c_+/_components/CollectionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ export function CollectionHeader({

const [isSectionsOpen, setSectionsOpen] = useState<boolean>(false);

const showIcon =
isEntry && entry?.icon?.url
? true
: !isEntry && collection?.icon?.url
? true
: false;

return (
<div className="bg-gradient-to-t from-white to-zinc-100 dark:from-dark350 dark:to-bg3Dark relative">
<div className="laptop:pt-0 z-20 relative">
Expand Down Expand Up @@ -152,20 +159,15 @@ export function CollectionHeader({
<h1 className="font-bold font-header text-2xl tablet:text-3xl pb-3 max-tablet:pr-14">
{entryName ?? collectionName}
</h1>
<div className="absolute right-3 laptop:right-0 top-7">
<Avatar
src={isEntry ? entry?.icon?.url : collection?.icon?.url}
className="size-16 bg-3"
initials={
entry?.icon?.url || collection?.icon?.url
? undefined
: isEntry
? entryName?.charAt(0)
: collectionName?.charAt(0)
}
options="aspect_ratio=1:1&height=128&width=128"
/>
</div>
{showIcon ? (
<div className="absolute right-3 laptop:right-0 top-7">
<Avatar
src={isEntry ? entry?.icon?.url : collection?.icon?.url}
className="size-16 bg-3"
options="aspect_ratio=1:1&height=128&width=128"
/>
</div>
) : undefined}
</div>
</div>
<section className="border-b border-zinc-200/50 dark:border-darkBorder shadow-sm max-tablet:px-3 pb-1 [clip-path:inset(0px_-10px_-10px_-10px)] relative z-10">
Expand Down
3 changes: 1 addition & 2 deletions app/utils/fetchers.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function authRestFetcher({
body,
}: {
path: string;
method: "PATCH" | "GET";
method: "PATCH" | "GET" | "DELETE";
body?: any;
}) {
try {
Expand All @@ -98,7 +98,6 @@ export function authRestFetcher({
headers: {
Authorization: `users API-Key ${process.env.MANA_APP_KEY}`,
"Content-Type": "application/json",
// connection: "keep-alive",
},
}),
...(body &&
Expand Down

0 comments on commit f7c94a8

Please sign in to comment.