mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-30 13:23:28 +01:00
feat: better layout
This commit is contained in:
1 parent
9e340d2e16
commit
6600bba58c
2 files changed
+26
-26
No files matched your search
@@ -204,21 +204,6 @@ export default function Page() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex justify="center" wrap="wrap" gap="2">
|
<Flex justify="center" wrap="wrap" gap="2">
|
||||||
<Select.Root
|
|
||||||
onValueChange={(value) => setRowsPerPage(parseInt(value))}
|
|
||||||
defaultValue={`${rowsPerPage}`}
|
|
||||||
>
|
|
||||||
<Select.Trigger />
|
|
||||||
|
|
||||||
<Select.Content>
|
|
||||||
{ROWS_OPTIONS.map((size) => (
|
|
||||||
<Select.Item value={`${size}`} key={size}>
|
|
||||||
{size} per page
|
|
||||||
</Select.Item>
|
|
||||||
))}
|
|
||||||
</Select.Content>
|
|
||||||
</Select.Root>
|
|
||||||
|
|
||||||
<Flex gap="2">
|
<Flex gap="2">
|
||||||
<Button variant="soft" onClick={previousPage}>
|
<Button variant="soft" onClick={previousPage}>
|
||||||
<CaretLeftIcon />
|
<CaretLeftIcon />
|
||||||
@@ -261,6 +246,7 @@ export default function Page() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapper color="orange">
|
<PageWrapper color="orange">
|
||||||
|
<Flex gap="4" wrap="wrap" justify="center">
|
||||||
<Flex gap="2">
|
<Flex gap="2">
|
||||||
<Select.Root
|
<Select.Root
|
||||||
defaultValue={region}
|
defaultValue={region}
|
||||||
@@ -307,6 +293,21 @@ export default function Page() {
|
|||||||
</Select.Group>
|
</Select.Group>
|
||||||
</Select.Content>
|
</Select.Content>
|
||||||
</Select.Root>
|
</Select.Root>
|
||||||
|
|
||||||
|
<Select.Root
|
||||||
|
onValueChange={(value) => setRowsPerPage(parseInt(value))}
|
||||||
|
defaultValue={`${rowsPerPage}`}
|
||||||
|
>
|
||||||
|
<Select.Trigger />
|
||||||
|
|
||||||
|
<Select.Content>
|
||||||
|
{ROWS_OPTIONS.map((size) => (
|
||||||
|
<Select.Item value={`${size}`} key={size}>
|
||||||
|
{size} per page
|
||||||
|
</Select.Item>
|
||||||
|
))}
|
||||||
|
</Select.Content>
|
||||||
|
</Select.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="3" justify="center" wrap="wrap" align="center">
|
<Flex gap="3" justify="center" wrap="wrap" align="center">
|
||||||
@@ -342,7 +343,6 @@ export default function Page() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog.Root>
|
</Dialog.Root>
|
||||||
|
|
||||||
<Dialog.Root
|
<Dialog.Root
|
||||||
open={jumpToPositionOpen}
|
open={jumpToPositionOpen}
|
||||||
onOpenChange={setJumpToPositionOpen}
|
onOpenChange={setJumpToPositionOpen}
|
||||||
@@ -377,7 +377,6 @@ export default function Page() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog.Root>
|
</Dialog.Root>
|
||||||
|
|
||||||
<Dialog.Root>
|
<Dialog.Root>
|
||||||
<Dialog.Trigger>
|
<Dialog.Trigger>
|
||||||
<Button variant="ghost">League</Button>
|
<Button variant="ghost">League</Button>
|
||||||
@@ -420,7 +419,9 @@ export default function Page() {
|
|||||||
if (firstPlayerIndex === -1) return;
|
if (firstPlayerIndex === -1) return;
|
||||||
|
|
||||||
setPage(Math.floor(firstPlayerIndex / rowsPerPage));
|
setPage(Math.floor(firstPlayerIndex / rowsPerPage));
|
||||||
setHighlightedPlayerId(players.data[firstPlayerIndex].id);
|
setHighlightedPlayerId(
|
||||||
|
players.data[firstPlayerIndex].id,
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Jump
|
Jump
|
||||||
@@ -430,7 +431,6 @@ export default function Page() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog.Root>
|
</Dialog.Root>
|
||||||
|
|
||||||
<Dialog.Root>
|
<Dialog.Root>
|
||||||
<Dialog.Trigger>
|
<Dialog.Trigger>
|
||||||
<Button variant="ghost">Player</Button>
|
<Button variant="ghost">Player</Button>
|
||||||
@@ -488,6 +488,7 @@ export default function Page() {
|
|||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog.Root>
|
</Dialog.Root>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
<PageTurner />
|
<PageTurner />
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Theme } from '@radix-ui/themes';
|
import { Flex, Theme } from '@radix-ui/themes';
|
||||||
import { ComponentProps } from 'react';
|
import { ComponentProps } from 'react';
|
||||||
|
|
||||||
interface PageWrapperProps extends ComponentProps<'div'> {
|
interface PageWrapperProps extends ComponentProps<typeof Flex> {
|
||||||
color?: ComponentProps<typeof Theme>['accentColor'];
|
color?: ComponentProps<typeof Theme>['accentColor'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,20 +12,19 @@ export default function PageWrapper({
|
|||||||
}: PageWrapperProps) {
|
}: PageWrapperProps) {
|
||||||
return (
|
return (
|
||||||
<Theme accentColor={color}>
|
<Theme accentColor={color}>
|
||||||
<div
|
<Flex
|
||||||
|
{...props}
|
||||||
|
direction="column"
|
||||||
|
gap="4"
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
maxWidth: 800,
|
maxWidth: 800,
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
display: 'flex',
|
|
||||||
padding: 16,
|
padding: 16,
|
||||||
flexDirection: 'column',
|
|
||||||
gap: 32,
|
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
|
|
||||||
...style,
|
...style,
|
||||||
}}
|
}}
|
||||||
{...props}
|
|
||||||
/>
|
/>
|
||||||
</Theme>
|
</Theme>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user