Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export type SmallRfdItems = {
export default function Header({ currentRfd }: { currentRfd?: RfdItem }) {
const { user, rfds, localMode, inlineComments } = useRootLoaderData()

// Show create button in local mode or in production only for logged-in internal users
const userIsInternal = user?.groups.some((group) => group === 'oxide-employee')
const showCreateButton = localMode || userIsInternal

const fetcher = useFetcher()

const toggleTheme = () => {
Expand Down Expand Up @@ -80,7 +84,7 @@ export default function Header({ currentRfd }: { currentRfd?: RfdItem }) {
<Icon name="search" size={16} />
</button>
<Search open={open} onClose={() => setOpen(false)} />
<NewRfdButton />
{showCreateButton && <NewRfdButton />}

{user ? (
<Dropdown.Root modal={false}>
Expand Down
1 change: 1 addition & 0 deletions app/components/NewRfdButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const NewRfdButton = () => {
<button
onClick={dialog.toggle}
className="text-tertiary bg-secondary border-secondary elevation-1 hover:bg-tertiary flex h-8 w-8 items-center justify-center rounded border"
aria-label="Create new RFD"
>
<Icon name="add-roundel" size={16} />
</button>
Expand Down