Merge pull request #2321 from Sir3lit/movetitles
Move page titles to PageContentBlocks
This commit is contained in:
commit
d946cba2f3
4 changed files with 5 additions and 28 deletions
|
@ -1,5 +1,4 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Helmet } from 'react-helmet';
|
|
||||||
import ContentBox from '@/components/elements/ContentBox';
|
import ContentBox from '@/components/elements/ContentBox';
|
||||||
import CreateApiKeyForm from '@/components/dashboard/forms/CreateApiKeyForm';
|
import CreateApiKeyForm from '@/components/dashboard/forms/CreateApiKeyForm';
|
||||||
import getApiKeys, { ApiKey } from '@/api/account/getApiKeys';
|
import getApiKeys, { ApiKey } from '@/api/account/getApiKeys';
|
||||||
|
@ -8,7 +7,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faKey, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
import { faKey, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
||||||
import ConfirmationModal from '@/components/elements/ConfirmationModal';
|
import ConfirmationModal from '@/components/elements/ConfirmationModal';
|
||||||
import deleteApiKey from '@/api/account/deleteApiKey';
|
import deleteApiKey from '@/api/account/deleteApiKey';
|
||||||
import { Actions, useStoreActions, useStoreState } from 'easy-peasy';
|
import { Actions, useStoreActions } from 'easy-peasy';
|
||||||
import { ApplicationStore } from '@/state';
|
import { ApplicationStore } from '@/state';
|
||||||
import FlashMessageRender from '@/components/FlashMessageRender';
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
||||||
import { httpErrorToHuman } from '@/api/http';
|
import { httpErrorToHuman } from '@/api/http';
|
||||||
|
@ -22,7 +21,6 @@ export default () => {
|
||||||
const [ keys, setKeys ] = useState<ApiKey[]>([]);
|
const [ keys, setKeys ] = useState<ApiKey[]>([]);
|
||||||
const [ loading, setLoading ] = useState(true);
|
const [ loading, setLoading ] = useState(true);
|
||||||
const { addError, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
|
const { addError, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
|
||||||
const name = useStoreState((state: ApplicationStore) => state.settings.data!.name);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
clearFlashes('account');
|
clearFlashes('account');
|
||||||
|
@ -50,10 +48,7 @@ export default () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContentBlock>
|
<PageContentBlock title={'Account API'}>
|
||||||
<Helmet>
|
|
||||||
<title> {name} | API</title>
|
|
||||||
</Helmet>
|
|
||||||
<FlashMessageRender byKey={'account'} css={tw`mb-4`}/>
|
<FlashMessageRender byKey={'account'} css={tw`mb-4`}/>
|
||||||
<div css={tw`flex`}>
|
<div css={tw`flex`}>
|
||||||
<ContentBox title={'Create API Key'} css={tw`flex-1`}>
|
<ContentBox title={'Create API Key'} css={tw`flex-1`}>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Helmet } from 'react-helmet';
|
|
||||||
import { ApplicationStore } from '@/state';
|
|
||||||
import ContentBox from '@/components/elements/ContentBox';
|
import ContentBox from '@/components/elements/ContentBox';
|
||||||
import UpdatePasswordForm from '@/components/dashboard/forms/UpdatePasswordForm';
|
import UpdatePasswordForm from '@/components/dashboard/forms/UpdatePasswordForm';
|
||||||
import UpdateEmailAddressForm from '@/components/dashboard/forms/UpdateEmailAddressForm';
|
import UpdateEmailAddressForm from '@/components/dashboard/forms/UpdateEmailAddressForm';
|
||||||
|
@ -9,7 +7,6 @@ import PageContentBlock from '@/components/elements/PageContentBlock';
|
||||||
import tw from 'twin.macro';
|
import tw from 'twin.macro';
|
||||||
import { breakpoint } from '@/theme';
|
import { breakpoint } from '@/theme';
|
||||||
import styled from 'styled-components/macro';
|
import styled from 'styled-components/macro';
|
||||||
import { useStoreState } from 'easy-peasy';
|
|
||||||
|
|
||||||
const Container = styled.div`
|
const Container = styled.div`
|
||||||
${tw`flex flex-wrap my-10`};
|
${tw`flex flex-wrap my-10`};
|
||||||
|
@ -28,12 +25,8 @@ const Container = styled.div`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const name = useStoreState((state: ApplicationStore) => state.settings.data!.name);
|
|
||||||
return (
|
return (
|
||||||
<PageContentBlock>
|
<PageContentBlock title={'Account Overview'}>
|
||||||
<Helmet>
|
|
||||||
<title> {name} | Account Overview</title>
|
|
||||||
</Helmet>
|
|
||||||
<Container>
|
<Container>
|
||||||
<ContentBox title={'Update Password'} showFlashes={'account:password'}>
|
<ContentBox title={'Update Password'} showFlashes={'account:password'}>
|
||||||
<UpdatePasswordForm/>
|
<UpdatePasswordForm/>
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Helmet } from 'react-helmet';
|
|
||||||
import { Server } from '@/api/server/getServer';
|
import { Server } from '@/api/server/getServer';
|
||||||
import { ApplicationStore } from '@/state';
|
|
||||||
import getServers from '@/api/getServers';
|
import getServers from '@/api/getServers';
|
||||||
import ServerRow from '@/components/dashboard/ServerRow';
|
import ServerRow from '@/components/dashboard/ServerRow';
|
||||||
import Spinner from '@/components/elements/Spinner';
|
import Spinner from '@/components/elements/Spinner';
|
||||||
|
@ -20,7 +18,6 @@ export default () => {
|
||||||
const [ page, setPage ] = useState(1);
|
const [ page, setPage ] = useState(1);
|
||||||
const { rootAdmin } = useStoreState(state => state.user.data!);
|
const { rootAdmin } = useStoreState(state => state.user.data!);
|
||||||
const [ showOnlyAdmin, setShowOnlyAdmin ] = usePersistedState('show_all_servers', false);
|
const [ showOnlyAdmin, setShowOnlyAdmin ] = usePersistedState('show_all_servers', false);
|
||||||
const name = useStoreState((state: ApplicationStore) => state.settings.data!.name);
|
|
||||||
|
|
||||||
const { data: servers, error } = useSWR<PaginatedResult<Server>>(
|
const { data: servers, error } = useSWR<PaginatedResult<Server>>(
|
||||||
[ '/api/client/servers', showOnlyAdmin, page ],
|
[ '/api/client/servers', showOnlyAdmin, page ],
|
||||||
|
@ -33,10 +30,7 @@ export default () => {
|
||||||
}, [ error ]);
|
}, [ error ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContentBlock showFlashKey={'dashboard'}>
|
<PageContentBlock title={'Dashboard'} showFlashKey={'dashboard'}>
|
||||||
<Helmet>
|
|
||||||
<title> {name} | Dashboard</title>
|
|
||||||
</Helmet>
|
|
||||||
{rootAdmin &&
|
{rootAdmin &&
|
||||||
<div css={tw`mb-2 flex justify-end items-center`}>
|
<div css={tw`mb-2 flex justify-end items-center`}>
|
||||||
<p css={tw`uppercase text-xs text-neutral-400 mr-2`}>
|
<p css={tw`uppercase text-xs text-neutral-400 mr-2`}>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Helmet } from 'react-helmet';
|
|
||||||
import { ServerContext } from '@/state/server';
|
import { ServerContext } from '@/state/server';
|
||||||
import { Actions, useStoreActions, useStoreState } from 'easy-peasy';
|
import { Actions, useStoreActions, useStoreState } from 'easy-peasy';
|
||||||
import { ApplicationStore } from '@/state';
|
import { ApplicationStore } from '@/state';
|
||||||
|
@ -18,7 +17,6 @@ export default () => {
|
||||||
|
|
||||||
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
||||||
const subusers = ServerContext.useStoreState(state => state.subusers.data);
|
const subusers = ServerContext.useStoreState(state => state.subusers.data);
|
||||||
const servername = ServerContext.useStoreState(state => state.server.data!.name);
|
|
||||||
const setSubusers = ServerContext.useStoreActions(actions => actions.subusers.setSubusers);
|
const setSubusers = ServerContext.useStoreActions(actions => actions.subusers.setSubusers);
|
||||||
|
|
||||||
const permissions = useStoreState((state: ApplicationStore) => state.permissions.data);
|
const permissions = useStoreState((state: ApplicationStore) => state.permissions.data);
|
||||||
|
@ -50,10 +48,7 @@ export default () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContentBlock>
|
<PageContentBlock title={'Subusers'}>
|
||||||
<Helmet>
|
|
||||||
<title> {servername} | Subusers </title>
|
|
||||||
</Helmet>
|
|
||||||
<FlashMessageRender byKey={'users'} css={tw`mb-4`}/>
|
<FlashMessageRender byKey={'users'} css={tw`mb-4`}/>
|
||||||
{!subusers.length ?
|
{!subusers.length ?
|
||||||
<p css={tw`text-center text-sm text-neutral-400`}>
|
<p css={tw`text-center text-sm text-neutral-400`}>
|
||||||
|
|
Loading…
Reference in a new issue