fix(striker-ui): add link to Anvil on each server list item

main
Tsu-ba-me 3 years ago
parent 8560171d8f
commit 5c8d6691f4
  1. 25
      striker-ui/pages/index.tsx
  2. 2
      striker-ui/types/APIServer.d.ts

@ -8,6 +8,7 @@ import { DIVIDER } from '../lib/consts/DEFAULT_THEME';
import { Preview } from '../components/Display'; import { Preview } from '../components/Display';
import Header from '../components/Header'; import Header from '../components/Header';
import Link from '../components/Link';
import OutlinedInput from '../components/OutlinedInput'; import OutlinedInput from '../components/OutlinedInput';
import { Panel, PanelHeader } from '../components/Panels'; import { Panel, PanelHeader } from '../components/Panels';
import periodicFetch from '../lib/fetchers/periodicFetch'; import periodicFetch from '../lib/fetchers/periodicFetch';
@ -30,7 +31,7 @@ const createServerPreviewContainer = (
flexWrap: 'wrap', flexWrap: 'wrap',
'& > *': { '& > *': {
width: { xs: '20em', md: '30em' }, width: { xs: '20em', md: '24em' },
}, },
'& > :not(:last-child)': { '& > :not(:last-child)': {
@ -39,14 +40,30 @@ const createServerPreviewContainer = (
}} }}
> >
{servers.map( {servers.map(
({ isScreenshotStale, screenshot, serverName, serverUUID }) => ( ({
anvilName,
isScreenshotStale,
screenshot,
serverName,
serverUUID,
}) => (
<Preview <Preview
key={`server-preview-${serverUUID}`} externalPreview={screenshot}
headerEndAdornment={
<Link
href="/anvil"
sx={{
opacity: 0.7,
}}
>
{anvilName}
</Link>
}
isExternalPreviewStale={isScreenshotStale} isExternalPreviewStale={isScreenshotStale}
isFetchPreview={false} isFetchPreview={false}
isShowControls={false} isShowControls={false}
isUseInnerPanel isUseInnerPanel
externalPreview={screenshot} key={`server-preview-${serverUUID}`}
serverName={serverName} serverName={serverName}
serverUUID={serverUUID} serverUUID={serverUUID}
setMode={() => { setMode={() => {

@ -1,4 +1,6 @@
type ServerOverviewMetadata = { type ServerOverviewMetadata = {
anvilName: string;
anvilUUID: string;
serverHostUUID: string; serverHostUUID: string;
serverName: string; serverName: string;
serverState: string; serverState: string;

Loading…
Cancel
Save