Skip to content

Commit 1e163aa

Browse files
committed
Get server console page rendering (mostly) correctly
1 parent 43ff672 commit 1e163aa

18 files changed

+140
-160
lines changed

resources/scripts/components/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import ProgressBar from '@/components/elements/ProgressBar';
1212
import NotFound from '@/components/screens/NotFound';
1313
import tw from 'twin.macro';
1414
import GlobalStylesheet from '@/assets/css/GlobalStylesheet';
15-
import TransitionRouter from '@/TransitionRouter';
1615

1716
interface ExtendedWindow extends Window {
1817
SiteConfiguration?: SiteSettings;

resources/scripts/components/NavigationBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ApplicationStore } from '@/state';
77
import SearchContainer from '@/components/dashboard/search/SearchContainer';
88
import tw from 'twin.macro';
99
import styled from 'styled-components/macro';
10+
// @ts-ignore
1011
import * as config from '@/../../tailwind.config.js';
1112

1213
const Navigation = styled.div`

resources/scripts/components/NetworkErrorMessage.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

resources/scripts/components/ServerOverviewContainer.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

resources/scripts/components/dashboard/ServerRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default ({ server }: { server: Server }) => {
3939

4040
useEffect(() => {
4141
getStats().then(() => {
42+
// @ts-ignore
4243
interval.current = setInterval(() => getStats(), 20000);
4344
});
4445

@@ -79,7 +80,7 @@ export default ({ server }: { server: Server }) => {
7980
<div css={tw`w-1/3 flex items-baseline relative`}>
8081
{!stats ?
8182
!statsError ?
82-
<SpinnerOverlay size={'small'} visible={true} backgroundOpacity={0.25}/>
83+
<SpinnerOverlay size={'small'} visible backgroundOpacity={0.25}/>
8384
:
8485
server.isInstalling ?
8586
<div css={tw`flex-1 text-center`}>

resources/scripts/components/elements/PageContentBlock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import ContentContainer from '@/components/elements/ContentContainer';
33
import { CSSTransition } from 'react-transition-group';
44
import tw from 'twin.macro';
55

6-
const PageContentBlock: React.FC = ({ children }) => (
6+
const PageContentBlock: React.FC<{ className?: string }> = ({ children, className }) => (
77
<CSSTransition timeout={250} classNames={'fade'} appear in>
88
<>
9-
<ContentContainer css={tw`my-10`}>
9+
<ContentContainer css={tw`my-10`} className={className}>
1010
{children}
1111
</ContentContainer>
1212
<ContentContainer css={tw`mb-4`}>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import styled from 'styled-components/macro';
2+
import tw from 'twin.macro';
3+
// @ts-ignore
4+
import config from '../../../../tailwind.config';
5+
6+
const SubNavigation = styled.div`
7+
${tw`w-full bg-neutral-700 shadow`};
8+
9+
& > div {
10+
${tw`flex items-center text-sm mx-auto px-2`};
11+
max-width: 1200px;
12+
13+
& > a, & > div {
14+
${tw`inline-block py-3 px-4 text-neutral-300 no-underline transition-all duration-150`};
15+
16+
&:not(:first-of-type) {
17+
${tw`ml-2`};
18+
}
19+
20+
&:active, &:hover {
21+
${tw`text-neutral-100`};
22+
}
23+
24+
&:active, &:hover, &.active {
25+
box-shadow: inset 0 -2px ${config.theme.colors.cyan['500']};
26+
}
27+
}
28+
}
29+
`;
30+
31+
export default SubNavigation;

resources/scripts/components/elements/SuspenseSpinner.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React, { Suspense } from 'react';
22
import Spinner from '@/components/elements/Spinner';
3+
import tw from 'twin.macro';
34

45
const SuspenseSpinner = ({ children }: { children?: React.ReactNode }) => (
56
<Suspense
67
fallback={
7-
<div className={'mx-4 w-3/4 mr-4 flex items-center justify-center'}>
8+
<div css={tw`mx-4 w-3/4 mr-4 flex items-center justify-center`}>
89
<Spinner centered/>
910
</div>
1011
}

resources/scripts/components/elements/TitledGreyBox.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
33
import { IconProp } from '@fortawesome/fontawesome-svg-core';
4+
import tw from 'twin.macro';
45

56
interface Props {
67
icon?: IconProp;
@@ -10,17 +11,17 @@ interface Props {
1011
}
1112

1213
const TitledGreyBox = ({ icon, title, children, className }: Props) => (
13-
<div className={`rounded shadow-md bg-neutral-700 ${className}`}>
14-
<div className={'bg-neutral-900 rounded-t p-3 border-b border-black'}>
14+
<div css={tw`rounded shadow-md bg-neutral-700`} className={className}>
15+
<div css={tw`bg-neutral-900 rounded-t p-3 border-b border-black`}>
1516
{typeof title === 'string' ?
16-
<p className={'text-sm uppercase'}>
17-
{icon && <FontAwesomeIcon icon={icon} className={'mr-2 text-neutral-300'}/>}{title}
17+
<p css={tw`text-sm uppercase`}>
18+
{icon && <FontAwesomeIcon icon={icon} css={tw`mr-2 text-neutral-300`}/>}{title}
1819
</p>
1920
:
2021
title
2122
}
2223
</div>
23-
<div className={'p-3'}>
24+
<div css={tw`p-3`}>
2425
{children}
2526
</div>
2627
</div>

resources/scripts/components/screens/ScreenBlock.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React from 'react';
22
import PageContentBlock from '@/components/elements/PageContentBlock';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4-
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons/faArrowLeft';
5-
import { faSyncAlt } from '@fortawesome/free-solid-svg-icons/faSyncAlt';
4+
import { faArrowLeft, faSyncAlt } from '@fortawesome/free-solid-svg-icons';
65
import classNames from 'classnames';
7-
import styled from 'styled-components/macro';
6+
import styled, { keyframes } from 'styled-components/macro';
87
import tw from 'twin.macro';
98

109
interface BaseProps {
@@ -27,17 +26,15 @@ interface PropsWithBack extends BaseProps {
2726

2827
type Props = PropsWithBack | PropsWithRetry;
2928

29+
const spin = keyframes`
30+
to { transform: rotate(360deg) }
31+
`;
32+
3033
const ActionButton = styled.button`
3134
${tw`rounded-full w-8 h-8 flex items-center justify-center`};
3235
3336
&.hover\\:spin:hover {
34-
animation: spin 2s linear infinite;
35-
}
36-
37-
@keyframes spin {
38-
to {
39-
transform: rotate(360deg);
40-
}
37+
animation: ${spin} 2s linear infinite;
4138
}
4239
`;
4340

0 commit comments

Comments
 (0)