Skip to content

Commit

Permalink
Merge pull request #446 from icflorescu/next
Browse files Browse the repository at this point in the history
Improve docs website
  • Loading branch information
icflorescu authored Nov 1, 2023
2 parents 7a172ba + fb1df68 commit a1fe74d
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.icon {
margin-top: rem(-2px);
width: rem(14px);
width: rem(13px);
height: auto;
vertical-align: rem(-1px);
margin-right: rem(8px);
}

.expandIcon {
Expand All @@ -11,7 +12,3 @@
.expandIconRotated {
transform: rotate(90deg);
}

.employeeName {
margin-left: calc(var(--mantine-spacing-xl) * 2);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Group } from '@mantine/core';
import { Box } from '@mantine/core';
import { IconBuilding, IconChevronRight, IconUser, IconUsers } from '@tabler/icons-react';
import { DataTable, DataTableSortStatus } from '__PACKAGE__';
import clsx from 'clsx';
Expand All @@ -25,13 +25,14 @@ function EmployeesTable({ departmentId, sortStatus }: { departmentId: string; so
columns={[
{
accessor: 'name',
noWrap: true,
render: ({ firstName, lastName }) => (
<Group gap="xs" wrap="nowrap" className={classes.employeeName}>
<Box component="span" ml={40}>
<IconUser className={classes.icon} />
<div>
<span>
{firstName} {lastName}
</div>
</Group>
</span>
</Box>
),
},
{
Expand Down Expand Up @@ -59,16 +60,17 @@ function DepartmentsTable({ companyId, sortStatus }: { companyId: string; sortSt
columns={[
{
accessor: 'name',
noWrap: true,
render: ({ id, name }) => (
<Group ml="lg" gap="xs" wrap="nowrap">
<Box component="span" ml={20}>
<IconChevronRight
className={clsx(classes.icon, classes.expandIcon, {
[classes.expandIconRotated]: expandedRecordIds.includes(id),
})}
/>
<IconUsers className={classes.icon} />
<div>{name}</div>
</Group>
<span>{name}</span>
</Box>
),
},
{ accessor: 'employees', textAlign: 'right', width: 200 },
Expand Down Expand Up @@ -104,16 +106,17 @@ export function NestedTablesAsyncSortingExample() {
accessor: 'name',
sortable: true,
title: 'Company / Department / Employee',
noWrap: true,
render: ({ id, name }) => (
<Group gap="xs">
<>
<IconChevronRight
className={clsx(classes.icon, classes.expandIcon, {
[classes.expandIconRotated]: expandedRecordIds.includes(id),
})}
/>
<IconBuilding className={classes.icon} />
<div>{name}</div>
</Group>
<span>{name}</span>
</>
),
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.icon {
margin-top: rem(-2px);
width: rem(14px);
width: rem(13px);
height: auto;
vertical-align: rem(-1px);
margin-right: rem(8px);
}

.expandIcon {
Expand All @@ -11,7 +12,3 @@
.expandIconRotated {
transform: rotate(90deg);
}

.employeeName {
margin-left: calc(var(--mantine-spacing-xl) * 2);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Group } from '@mantine/core';
import { Box } from '@mantine/core';
import { IconBuilding, IconChevronRight, IconUser, IconUsers } from '@tabler/icons-react';
import { DataTable } from '__PACKAGE__';
import clsx from 'clsx';
Expand All @@ -21,13 +21,14 @@ function EmployeesTable({ departmentId }: { departmentId: string }) {
columns={[
{
accessor: 'name',
noWrap: true,
render: ({ firstName, lastName }) => (
<Group gap="xs" wrap="nowrap" className={classes.employeeName}>
<Box component="span" ml={40}>
<IconUser className={classes.icon} />
<div>
<span>
{firstName} {lastName}
</div>
</Group>
</span>
</Box>
),
},
{
Expand Down Expand Up @@ -55,16 +56,17 @@ function DepartmentsTable({ companyId }: { companyId: string }) {
columns={[
{
accessor: 'name',
noWrap: true,
render: ({ id, name }) => (
<Group ml="lg" gap="xs" wrap="nowrap">
<Box component="span" ml={20}>
<IconChevronRight
className={clsx(classes.icon, classes.expandIcon, {
[classes.expandIconRotated]: expandedRecordIds.includes(id),
})}
/>
<IconUsers className={classes.icon} />
<div>{name}</div>
</Group>
<span>{name}</span>
</Box>
),
},
{ accessor: 'employees', textAlign: 'right', width: 200 },
Expand Down Expand Up @@ -92,16 +94,17 @@ export function NestedTablesAsyncExample() {
{
accessor: 'name',
title: 'Company / Department / Employee',
noWrap: true,
render: ({ id, name }) => (
<Group gap="xs">
<>
<IconChevronRight
className={clsx(classes.icon, classes.expandIcon, {
[classes.expandIconRotated]: expandedRecordIds.includes(id),
})}
/>
<IconBuilding className={classes.icon} />
<div>{name}</div>
</Group>
<span>{name}</span>
</>
),
},
{ accessor: 'employees', title: 'Employees / Birth date', textAlign: 'right', width: 200 },
Expand Down
9 changes: 3 additions & 6 deletions app/examples/nested-tables/NestedTablesExample.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.icon {
margin-top: rem(-2px);
width: rem(14px);
width: rem(13px);
height: auto;
vertical-align: rem(-1px);
margin-right: rem(8px);
}

.expandIcon {
Expand All @@ -11,7 +12,3 @@
.expandIconRotated {
transform: rotate(90deg);
}

.employeeName {
margin-left: calc(var(--mantine-spacing-xl) * 2);
}
26 changes: 14 additions & 12 deletions app/examples/nested-tables/NestedTablesExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Group } from '@mantine/core';
import { Box } from '@mantine/core';
import { IconBuilding, IconChevronRight, IconUser, IconUsers } from '@tabler/icons-react';
import { DataTable } from '__PACKAGE__';
import clsx from 'clsx';
Expand All @@ -23,16 +23,17 @@ export function NestedTablesExample() {
{
accessor: 'name',
title: 'Company / Department / Employee',
noWrap: true,
render: ({ id, name }) => (
<Group gap="xs">
<>
<IconChevronRight
className={clsx(classes.icon, classes.expandIcon, {
[classes.expandIconRotated]: expandedCompanyIds.includes(id),
})}
/>
<IconBuilding className={classes.icon} />
<div>{name}</div>
</Group>
<span>{name}</span>
</>
),
},
{ accessor: 'employees', title: 'Employees / Birth date', textAlign: 'right', width: 200 },
Expand All @@ -48,16 +49,17 @@ export function NestedTablesExample() {
columns={[
{
accessor: 'name',
noWrap: true,
render: ({ id, name }) => (
<Group ml="lg" gap="xs" wrap="nowrap">
<Box component="span" ml={20}>
<IconChevronRight
className={clsx(classes.icon, classes.expandIcon, {
[classes.expandIconRotated]: expandedDepartmentIds.includes(id),
})}
/>
<IconUsers size="0.9em" />
<div>{name}</div>
</Group>
<IconUsers className={classes.icon} />
<span>{name}</span>
</Box>
),
},
{ accessor: 'employees', textAlign: 'right', width: 200 },
Expand All @@ -74,12 +76,12 @@ export function NestedTablesExample() {
{
accessor: 'name',
render: ({ firstName, lastName }) => (
<Group gap="xs" wrap="nowrap" className={classes.employeeName}>
<Box component="span" ml={40}>
<IconUser className={classes.icon} />
<div>
<span>
{firstName} {lastName}
</div>
</Group>
</span>
</Box>
),
},
{
Expand Down
20 changes: 7 additions & 13 deletions app/manifest.webmanifest/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,26 @@ const data: MetadataRoute.Manifest = {
sizes: 'any',
purpose: 'any',
},
{
src: `${urlPrefix}/icon.svg`,
type: 'image/svg+xml',
sizes: 'any',
purpose: 'maskable',
},
{
src: `${urlPrefix}/icon-192.png`,
type: 'image/png',
sizes: '192x192',
purpose: 'any',
},
{
src: `${urlPrefix}/icon-192.png`,
type: 'image/png',
sizes: '192x192',
purpose: 'maskable',
},
{
src: `${urlPrefix}/icon-512.png`,
type: 'image/png',
sizes: '512x512',
purpose: 'any',
},
{
src: `${urlPrefix}/icon-512.png`,
src: `${urlPrefix}/icon-maskable-192.png`,
type: 'image/png',
sizes: '192x192',
purpose: 'maskable',
},
{
src: `${urlPrefix}/icon-maskable-512.png`,
type: 'image/png',
sizes: '512x512',
purpose: 'maskable',
Expand Down
Binary file added public/icon-maskable-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icon-maskable-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a1fe74d

Please sign in to comment.