ui(admin): update button components, fix Editor for eggs
This commit is contained in:
parent
4e56f6dbea
commit
089860b721
35 changed files with 363 additions and 623 deletions
|
@ -48,9 +48,9 @@ import Sidebar from '@/components/admin/Sidebar';
|
|||
import UsersContainer from '@/components/admin/users/UsersContainer';
|
||||
|
||||
function AdminRouter() {
|
||||
// const email = useStoreState((state: State<ApplicationStore>) => state.user.data!.email);
|
||||
// const roleName = useStoreState((state: State<ApplicationStore>) => state.user.data!.roleName);
|
||||
// const avatarURL = useStoreState((state: State<ApplicationStore>) => state.user.data!.avatarURL);
|
||||
const email = useStoreState((state: ApplicationStore) => state.user.data!.email);
|
||||
const roleName = useStoreState((state: ApplicationStore) => state.user.data!.roleName);
|
||||
const avatarURL = useStoreState((state: ApplicationStore) => state.user.data!.avatarURL);
|
||||
const applicationName = useStoreState((state: ApplicationStore) => state.settings.data!.name);
|
||||
|
||||
// const [collapsed, setCollapsed] = useUserPersistedState('admin_sidebar_collapsed', false);
|
||||
|
@ -71,7 +71,7 @@ function AdminRouter() {
|
|||
</div>
|
||||
<Sidebar.Wrapper>
|
||||
<Sidebar.Section>Administration</Sidebar.Section>
|
||||
<NavLink to="/admin">
|
||||
<NavLink to="/admin" end>
|
||||
<OfficeBuildingIcon />
|
||||
<span>Overview</span>
|
||||
</NavLink>
|
||||
|
@ -118,27 +118,27 @@ function AdminRouter() {
|
|||
<ReplyIcon />
|
||||
<span>Return</span>
|
||||
</NavLink>
|
||||
{/*<Sidebar.User>*/}
|
||||
{/* {avatarURL && (*/}
|
||||
{/* <img*/}
|
||||
{/* src={`${avatarURL}?s=64`}*/}
|
||||
{/* alt="Profile Picture"*/}
|
||||
{/* css={tw`h-10 w-10 rounded-full select-none`}*/}
|
||||
{/* />*/}
|
||||
{/* )}*/}
|
||||
{/* <div css={tw`flex flex-col ml-3`}>*/}
|
||||
{/* <span*/}
|
||||
{/* css={tw`font-sans font-normal text-sm text-neutral-50 whitespace-nowrap leading-tight select-none`}*/}
|
||||
{/* >*/}
|
||||
{/* {email}*/}
|
||||
{/* </span>*/}
|
||||
{/* <span*/}
|
||||
{/* css={tw`font-header font-normal text-xs text-neutral-300 whitespace-nowrap leading-tight select-none`}*/}
|
||||
{/* >*/}
|
||||
{/* {roleName}*/}
|
||||
{/* </span>*/}
|
||||
{/* </div>*/}
|
||||
{/*</Sidebar.User>*/}
|
||||
<Sidebar.User>
|
||||
{avatarURL && (
|
||||
<img
|
||||
src={`${avatarURL}?s=64`}
|
||||
alt="Profile Picture"
|
||||
css={tw`h-10 w-10 rounded-full select-none`}
|
||||
/>
|
||||
)}
|
||||
<div css={tw`flex flex-col ml-3`}>
|
||||
<span
|
||||
css={tw`font-sans font-normal text-sm text-neutral-50 whitespace-nowrap leading-tight select-none`}
|
||||
>
|
||||
{email}
|
||||
</span>
|
||||
<span
|
||||
css={tw`font-header font-normal text-xs text-neutral-300 whitespace-nowrap leading-tight select-none`}
|
||||
>
|
||||
{roleName}
|
||||
</span>
|
||||
</div>
|
||||
</Sidebar.User>
|
||||
</Sidebar>
|
||||
|
||||
<div css={tw`flex-1 overflow-x-hidden px-6 pt-6 lg:px-10 lg:pt-8 xl:px-16 xl:pt-12`}>
|
||||
|
|
|
@ -64,7 +64,7 @@ function ServerRouter() {
|
|||
error ? (
|
||||
<ServerError message={error} />
|
||||
) : (
|
||||
<Spinner size={'large'} centered />
|
||||
<Spinner size="large" centered />
|
||||
)
|
||||
) : (
|
||||
<>
|
||||
|
@ -75,21 +75,24 @@ function ServerRouter() {
|
|||
.map(route =>
|
||||
route.permission ? (
|
||||
<Can key={route.path} action={route.permission} matchAny>
|
||||
<NavLink to={`/server/${id}/${route.path ?? ''}`} end>
|
||||
<NavLink to={`/server/${id}/${route.path ?? ''}`.replace(/\/$/, '')} end>
|
||||
{route.name}
|
||||
</NavLink>
|
||||
</Can>
|
||||
) : (
|
||||
<NavLink key={route.path} to={`/server/${id}/${route.path ?? ''}`} end>
|
||||
<NavLink
|
||||
key={route.path}
|
||||
to={`/server/${id}/${route.path ?? ''}`.replace(/\/$/, '')}
|
||||
end
|
||||
>
|
||||
{route.name}
|
||||
</NavLink>
|
||||
),
|
||||
)}
|
||||
{rootAdmin && (
|
||||
// eslint-disable-next-line react/jsx-no-target-blank
|
||||
<a href={`/admin/servers/view/${serverId}`} target="_blank">
|
||||
<NavLink to={`/admin/servers/${serverId}`}>
|
||||
<FontAwesomeIcon icon={faExternalLinkAlt} />
|
||||
</a>
|
||||
</NavLink>
|
||||
)}
|
||||
</div>
|
||||
</SubNavigation>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue