admin(ui): add ability to edit nests
This commit is contained in:
parent
0e366f69ee
commit
20234b308c
13 changed files with 157 additions and 22 deletions
31
resources/scripts/components/admin/AdminBox.tsx
Normal file
31
resources/scripts/components/admin/AdminBox.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import React, { memo } from 'react';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
||||
import tw from 'twin.macro';
|
||||
import isEqual from 'react-fast-compare';
|
||||
|
||||
interface Props {
|
||||
icon?: IconProp;
|
||||
title: string | React.ReactNode;
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const AdminBox = ({ icon, title, children, className }: Props) => (
|
||||
<div css={tw`rounded shadow-md bg-neutral-700`} className={className}>
|
||||
<div css={tw`bg-neutral-900 rounded-t px-6 py-3 border-b border-black`}>
|
||||
{typeof title === 'string' ?
|
||||
<p css={tw`text-sm uppercase`}>
|
||||
{icon && <FontAwesomeIcon icon={icon} css={tw`mr-2 text-neutral-300`}/>}{title}
|
||||
</p>
|
||||
:
|
||||
title
|
||||
}
|
||||
</div>
|
||||
<div css={tw`px-6 py-4`}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default memo(AdminBox, isEqual);
|
Loading…
Add table
Add a link
Reference in a new issue