Skip to content

Commit

Permalink
fix(dashboard): cleanup website list page
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuhito committed Mar 5, 2024
1 parent 02369dc commit f4df73d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
1 change: 1 addition & 0 deletions dashboard/app/components/settings/Settings.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.wrapper {
background-color: var(--me-color-bg-grey);
border-radius: 8px;
}
32 changes: 26 additions & 6 deletions dashboard/app/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Grid, Group, Stack } from '@mantine/core';
import { Button, Grid, Group, Stack, Text, TextInput } from '@mantine/core';

import { type components } from '@/api/types';

Expand All @@ -12,17 +12,37 @@ interface SettingsProps {
export const Settings = ({ user }: SettingsProps) => {
return (
<Stack className={classes.wrapper}>
<h1>Settings</h1>
<Text fw={700} fz={32} p={24}>
Settings
</Text>
<Grid>
<Grid.Col span={4}>
<Sidebar />
</Grid.Col>
<Grid.Col span={8}>
<Grid.Col span={8} py="xl">
<Group>
<Box>Account</Box>
<Box>Site</Box>
{JSON.stringify(user)}
<Stack justify="flex-start" align="flex-start">
<Text size="xl" fw={700}>
Account details
</Text>
<Text size="sm">Edit your username and password.</Text>
</Stack>
<Stack>
<TextInput
label="Username"
placeholder="Username"
value={user.username}
/>
<TextInput
label="Password"
placeholder="Password"
type="password"
/>
</Stack>
</Group>
<Button variant="light" color="blue">
Save
</Button>
</Grid.Col>
</Grid>
</Stack>
Expand Down
34 changes: 25 additions & 9 deletions dashboard/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from '@mantine/core';
import { Divider, Paper, Text } from '@mantine/core';
import {
json,
type LoaderFunctionArgs,
Expand All @@ -7,7 +7,7 @@ import {
} from '@remix-run/node';
import {
isRouteErrorResponse,
NavLink,
Link,
useLoaderData,
useRouteError,
} from '@remix-run/react';
Expand Down Expand Up @@ -50,15 +50,23 @@ export default function Index() {
return (
<main>
<h1>Websites</h1>
{JSON.stringify(websites)}
<Divider mb={30} />
{websites.map((website) => (
<Button
<Paper
key={website.hostname}
component={NavLink}
withBorder
w={300}
p={8}
radius={8}
component={Link}
to={`/${website.hostname}`}
prefetch="intent"
>
{website.name}
</Button>
<Text>{website.name}</Text>
<Text size="xs" c="gray">
{website.hostname}
</Text>
</Paper>
))}
</main>
);
Expand All @@ -72,9 +80,17 @@ export const ErrorBoundary = () => {
<main>
<h1>404</h1>
<p>No websites found</p>
<Button component={NavLink} to="/add">
<Paper
withBorder
w={300}
p={8}
radius={8}
component={Link}
to="/add"
prefetch="intent"
>
Add Website
</Button>
</Paper>
</main>
);
}
Expand Down

0 comments on commit f4df73d

Please sign in to comment.