Skip to content

Commit

Permalink
feat: shadnui (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
olros authored Apr 26, 2024
1 parent 8787899 commit e0cbdc2
Show file tree
Hide file tree
Showing 73 changed files with 5,029 additions and 3,297 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/prisma_migrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x

- name: Set DATABASE_URL .env-variables
run: |
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,33 @@ jobs:
with:
node-version: 20.x

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: yarn
run: pnpm i

- name: Lint
run: yarn lint
run: pnpm run lint

- name: Typecheck
run: yarn typecheck
run: pnpm run typecheck

- name: Build
run: yarn build
run: pnpm run build
4 changes: 3 additions & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ node_modules
/api/index.js
/api/index.js.map

*.log
*.log

.DS_Store
3 changes: 2 additions & 1 deletion web/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"endOfLine": "auto"
"endOfLine": "auto",
"plugins": ["prettier-plugin-tailwindcss"]
}
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stats

**Tech-stack:** [Remix](https://remix.run/), [Prisma](https://www.prisma.io/), [MUI Joy UI](https://mui.com/joy-ui/getting-started/overview/), [Nivo](https://nivo.rocks/)
**Tech-stack:** [Remix](https://remix.run/), [Prisma](https://www.prisma.io/), [Tailwind](https://tailwindcss.com/), [Radix](https://www.radix-ui.com/), [Nivo](https://nivo.rocks/)

## Development

Expand Down
50 changes: 0 additions & 50 deletions web/app/components/ConfirmDialog.tsx

This file was deleted.

37 changes: 23 additions & 14 deletions web/app/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
import styled from '@emotion/styled';
import { isRouteErrorResponse, useRouteError } from '@remix-run/react';

const Container = styled('div')`
background-color: #ff0000;
padding: 1rem;
`;
import { Typography } from './typography';
import { Card } from './ui/card';

export const ErrorBoundary = () => {
const error = useRouteError();

return isRouteErrorResponse(error) ? (
<Container>
<h1>{`${error.status} - ${error.data}`}</h1>
</Container>
) : (
<Container>
<p>[ErrorBoundary]: There was an error: {(error as Error).message}</p>
</Container>
return (
<Card className='bg-red-500'>
<Typography variant='h3'>Something went wrong</Typography>
{isRouteErrorResponse(error) ? (
<Typography>{`${error.status} - ${error.data}`}</Typography>
) : error instanceof Error ? (
<>
<Typography>{`${error.name}: ${error.message}`}</Typography>
{process.env.NODE_ENV !== 'production' && (
<Card>
<Typography variant='small'>Stack:</Typography>
<Typography variant='small' className='mt-2 whitespace-break-spaces font-mono'>
{error.stack}
</Typography>
</Card>
)}
</>
) : (
<Typography>Unknown error</Typography>
)}
</Card>
);
};
20 changes: 0 additions & 20 deletions web/app/components/Icons.tsx

This file was deleted.

20 changes: 8 additions & 12 deletions web/app/components/LinkTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { TabsProps } from '@mui/joy';
import { Tab, TabList, Tabs } from '@mui/joy';
import { Link, useLocation } from '@remix-run/react';
import { useState } from 'react';
import { Tabs, TabsList, TabsProps, TabsTrigger } from './ui/tabs';

export type LinkTabsProps = Omit<TabsProps, 'defaultValue'> & {
tabs: {
Expand All @@ -16,18 +15,15 @@ export const LinkTabs = ({ tabs, baseLocation, ...props }: LinkTabsProps) => {
const [defaultLocation] = useState(location.pathname);
return (
<Tabs defaultValue={defaultLocation} {...props}>
<TabList>
<TabsList className='grid w-full auto-cols-fr grid-flow-col'>
{tabs.map((tab) => (
<Tab
component={Link}
key={tab.label}
to={`${baseLocation}${tab.url ? `/${tab.url}` : ''}`}
unstable_viewTransition
value={`${baseLocation}${tab.url ? `/${tab.url}` : ''}`}>
{tab.label}
</Tab>
<TabsTrigger asChild key={tab.label} value={`${baseLocation}${tab.url ? `/${tab.url}` : ''}`}>
<Link to={`${baseLocation}${tab.url ? `/${tab.url}` : ''}`} unstable_viewTransition>
{tab.label}
</Link>
</TabsTrigger>
))}
</TabList>
</TabsList>
</Tabs>
);
};
Loading

0 comments on commit e0cbdc2

Please sign in to comment.