mirror of https://github.com/cocosolos/ixion.git
Further small screen adjustments
This commit is contained in:
parent
734a3f3e3b
commit
74693204b4
|
|
@ -1,10 +1,4 @@
|
||||||
import {
|
import { Box, ToggleButton, ToggleButtonGroup, Tooltip } from '@mui/material';
|
||||||
Box,
|
|
||||||
ToggleButton,
|
|
||||||
ToggleButtonGroup,
|
|
||||||
Tooltip,
|
|
||||||
useMediaQuery,
|
|
||||||
} from '@mui/material';
|
|
||||||
import { ServerData } from '../../data/ServerData';
|
import { ServerData } from '../../data/ServerData';
|
||||||
|
|
||||||
const expansionButtons = [
|
const expansionButtons = [
|
||||||
|
|
@ -12,7 +6,7 @@ const expansionButtons = [
|
||||||
key="rotz"
|
key="rotz"
|
||||||
value="rotz"
|
value="rotz"
|
||||||
aria-label="rotz-enabled"
|
aria-label="rotz-enabled"
|
||||||
className="py-0"
|
className="px-1 py-0"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
RotZ
|
RotZ
|
||||||
|
|
@ -21,7 +15,7 @@ const expansionButtons = [
|
||||||
key="cop"
|
key="cop"
|
||||||
value="cop"
|
value="cop"
|
||||||
aria-label="cop-enabled"
|
aria-label="cop-enabled"
|
||||||
className="py-0"
|
className="px-1 py-0"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
CoP
|
CoP
|
||||||
|
|
@ -30,7 +24,7 @@ const expansionButtons = [
|
||||||
key="toau"
|
key="toau"
|
||||||
value="toau"
|
value="toau"
|
||||||
aria-label="toau-enabled"
|
aria-label="toau-enabled"
|
||||||
className="py-0"
|
className="px-1 py-0"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
ToAU
|
ToAU
|
||||||
|
|
@ -39,7 +33,7 @@ const expansionButtons = [
|
||||||
key="wotg"
|
key="wotg"
|
||||||
value="wotg"
|
value="wotg"
|
||||||
aria-label="wotg-enabled"
|
aria-label="wotg-enabled"
|
||||||
className="py-0"
|
className="px-1 py-0"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
WotG
|
WotG
|
||||||
|
|
@ -48,7 +42,7 @@ const expansionButtons = [
|
||||||
key="soa"
|
key="soa"
|
||||||
value="soa"
|
value="soa"
|
||||||
aria-label="soa-enabled"
|
aria-label="soa-enabled"
|
||||||
className="py-0"
|
className="px-1 py-0"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
SoA
|
SoA
|
||||||
|
|
@ -57,7 +51,7 @@ const expansionButtons = [
|
||||||
key="addons"
|
key="addons"
|
||||||
value="addons"
|
value="addons"
|
||||||
aria-label="addons-enabled"
|
aria-label="addons-enabled"
|
||||||
className="py-0"
|
className="px-1 py-0"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
+
|
+
|
||||||
|
|
@ -68,7 +62,6 @@ type ExpansionBarProps = { server: ServerData };
|
||||||
|
|
||||||
export default function ExpansionBar({ server }: ExpansionBarProps) {
|
export default function ExpansionBar({ server }: ExpansionBarProps) {
|
||||||
const { expansions } = server;
|
const { expansions } = server;
|
||||||
const isSmallScreen = useMediaQuery('(max-width:400px)');
|
|
||||||
|
|
||||||
const addons = ['acp', 'amk', 'asa', 'abyssea', 'voidwatch', 'rov', 'tvr'];
|
const addons = ['acp', 'amk', 'asa', 'abyssea', 'voidwatch', 'rov', 'tvr'];
|
||||||
let enabledAddons = addons.filter((prop) => expansions[prop]);
|
let enabledAddons = addons.filter((prop) => expansions[prop]);
|
||||||
|
|
@ -95,7 +88,6 @@ export default function ExpansionBar({ server }: ExpansionBarProps) {
|
||||||
>
|
>
|
||||||
<ToggleButtonGroup
|
<ToggleButtonGroup
|
||||||
size="small"
|
size="small"
|
||||||
orientation={isSmallScreen ? 'vertical' : 'horizontal'}
|
|
||||||
value={
|
value={
|
||||||
expansions && [
|
expansions && [
|
||||||
expansions.rotz && 'rotz',
|
expansions.rotz && 'rotz',
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
alpha,
|
alpha,
|
||||||
useMediaQuery,
|
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import {
|
import {
|
||||||
Children,
|
Children,
|
||||||
|
|
@ -47,7 +46,6 @@ type ServerCardProps = {
|
||||||
|
|
||||||
export default function ServerCard({ server, children }: ServerCardProps) {
|
export default function ServerCard({ server, children }: ServerCardProps) {
|
||||||
const { themeMode } = useThemeModeContext();
|
const { themeMode } = useThemeModeContext();
|
||||||
const isSmallScreen = useMediaQuery('(max-width:400px)');
|
|
||||||
const [clipboardTooltip, setClipboardTooltip] = useState('Copy server URL.');
|
const [clipboardTooltip, setClipboardTooltip] = useState('Copy server URL.');
|
||||||
const [clipboardTooltipOpen, setClipboardTooltipOpen] = useState(false);
|
const [clipboardTooltipOpen, setClipboardTooltipOpen] = useState(false);
|
||||||
const handleClipboardTooltipClose = () => {
|
const handleClipboardTooltipClose = () => {
|
||||||
|
|
@ -188,15 +186,8 @@ export default function ServerCard({ server, children }: ServerCardProps) {
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
<Box
|
<Box className="grow flex-col py-1 pl-4">
|
||||||
// className={
|
<Box className="flex">
|
||||||
// isSmallScreen
|
|
||||||
// ? 'flex grow flex-col items-center justify-center py-1 pl-4'
|
|
||||||
// : 'grow py-1 pl-4'
|
|
||||||
// }
|
|
||||||
className="grow py-1 pl-4"
|
|
||||||
>
|
|
||||||
<Box className="flex content-center">
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="h5"
|
variant="h5"
|
||||||
color={(theme) => alpha(theme.palette.text.primary, 0.87)}
|
color={(theme) => alpha(theme.palette.text.primary, 0.87)}
|
||||||
|
|
@ -231,7 +222,7 @@ export default function ServerCard({ server, children }: ServerCardProps) {
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Box className="flex content-center">
|
<Box className="flex">
|
||||||
<Typography
|
<Typography
|
||||||
variant="subtitle2"
|
variant="subtitle2"
|
||||||
color={(theme) => alpha(theme.palette.text.primary, 0.6)}
|
color={(theme) => alpha(theme.palette.text.primary, 0.6)}
|
||||||
|
|
@ -267,17 +258,17 @@ export default function ServerCard({ server, children }: ServerCardProps) {
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</Box>
|
|
||||||
<ExpansionBar server={server} />
|
|
||||||
</Box>
|
|
||||||
<Box className="flex items-center justify-center">
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="h5"
|
variant="h5"
|
||||||
|
className="flex grow justify-end"
|
||||||
|
sx={{ lineHeight: 1.0 }}
|
||||||
color={(theme) => theme.palette.text.secondary}
|
color={(theme) => theme.palette.text.secondary}
|
||||||
>
|
>
|
||||||
{`Lv.${server.max_level}`}
|
{`Lv.${server.max_level}`}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
<ExpansionBar server={server} />
|
||||||
|
</Box>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails
|
<AccordionDetails
|
||||||
className="p-2 pt-0"
|
className="p-2 pt-0"
|
||||||
|
|
@ -343,7 +334,6 @@ export default function ServerCard({ server, children }: ServerCardProps) {
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Box className="flex items-center whitespace-nowrap">
|
<Box className="flex items-center whitespace-nowrap">
|
||||||
{/* <ServerDetailsModal id={server.id} /> */}
|
|
||||||
<Typography variant="caption" sx={{ lineHeight: 1 }}>
|
<Typography variant="caption" sx={{ lineHeight: 1 }}>
|
||||||
Updated: {new Date(server.updated).toLocaleString()}
|
Updated: {new Date(server.updated).toLocaleString()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue