Skip to content

Commit

Permalink
dashboard update; initialize rome.tools
Browse files Browse the repository at this point in the history
  • Loading branch information
arthtyagi committed Nov 9, 2022
1 parent 009f3d0 commit 1094cdb
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 64 deletions.
41 changes: 0 additions & 41 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,3 @@ repos:
- id: black
files: \.py$
exclude: ^(migrations/|tests/|test_data/|.*\.pyc$)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.26.0
hooks:
- id: eslint
files: \.[jt]sx?$
types: [file]
args:
- --fix
entry: eslint
language: node
additional_dependencies:
- eslint
- prettier
- eslint-config-airbnb
- eslint-config-airbnb-typescript
- eslint-plugin-import
- eslint-plugin-jsx-a11y
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-config-prettier
- eslint-plugin-prettier
- prettier-plugin-tailwindcss
- "@typescript-eslint/eslint-plugin"
- "@typescript-eslint/parser"
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
files: \.[jt]sx?$
types: [file]
args:
- --write
entry: prettier
language: node
additional_dependencies:
- eslint
- prettier
- eslint-config-prettier
- eslint-plugin-prettier
- "@typescript-eslint/eslint-plugin"
- prettier-plugin-tailwindcss
2 changes: 1 addition & 1 deletion apps/web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
...require('@devclad/config/eslint-react'),
ignorePatterns: ['**/*.js', '**/*.cjs', '**/*.json', 'node_modules'],
ignorePatterns: ['**/*.js', '**/*.cjs', '**/*.json', 'node_modules', 'vite.config.ts'],
parserOptions: {
ecmaFeatures: {
jsx: true,
Expand Down
1 change: 0 additions & 1 deletion apps/web/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
const CONNECT_URL = `${process.env.VITE_API_URL}/oauth/github/connect/`;
const { headers } = req;
switch (true) {
// callback
case req.url?.startsWith('/api/auth/complete/github'): {
const { code } = req.body;
const tokenUrl = 'https://github.com/login/oauth/access_token';
Expand Down
43 changes: 30 additions & 13 deletions apps/web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React, { Fragment } from 'react';
import { ArrowLeftOnRectangleIcon } from '@heroicons/react/24/solid';
import { useQueryClient } from '@tanstack/react-query';
import { Link, useNavigate } from 'react-router-dom';
import { classNames, useDocumentTitle } from '@devclad/lib';
import {
ArrowLeftOnRectangleIcon,
UserGroupIcon,
VideoCameraIcon,
ChatBubbleLeftRightIcon,
WrenchIcon,
UserCircleIcon,
KeyIcon,
CalendarDaysIcon,
AdjustmentsHorizontalIcon,
} from '@heroicons/react/24/outline';
import { Disclosure, Menu, Transition } from '@headlessui/react';
import { StarIcon } from '@heroicons/react/24/solid';
import { API_URL, DEVELOPMENT, logOut } from '@/services/auth.services';
import { LoadingSpinner } from '@/lib/Buttons.lib';
import { useAuth } from '@/services/useAuth.services';
Expand All @@ -21,7 +22,8 @@ import { useProfile } from '@/services/socialHooks.services';
const items = [
{
id: 1,
name: 'Messages Dashboard',
name: 'Messages',
description: 'Messages Dashboard',
url: '/messages',
icon: ChatBubbleLeftRightIcon,
},
Expand All @@ -48,15 +50,16 @@ const items = [
{
id: 5,
name: 'Account Settings',
description: 'Manage your account',
url: '/settings',
icon: WrenchIcon,
icon: UserCircleIcon,
},
{
id: 6,
name: 'Social Preferences',
description: 'Tweak ML Preferences',
url: '/settings/social',
icon: UserCircleIcon,
icon: AdjustmentsHorizontalIcon,
},
{
id: 7,
Expand All @@ -78,22 +81,26 @@ export function SignOut(): JSX.Element {
return (
<button
onClick={handlelogOut}
onKeyDown={handlelogOut}
type="button"
className="bg-darkBG2 hover:bg-darkBG hover:border-mistyRose hover:text-mistyRose flex w-full items-center
justify-between space-x-6 rounded-md border-[1px] border-neutral-900 p-6 text-neutral-400
className="bg-darkBG2 hover:bg-darkBG hover:border-mistyRose/30 hover:text-mistyRose/50 flex w-full items-center
justify-between space-x-6 rounded-md border-[1px] border-neutral-900 p-6 text-neutral-500
shadow-2xl shadow-white/10 focus:ring-red-900"
>
<div className="flex-1 truncate">
<div className="flex items-center space-x-3">
<h3 className="truncate text-sm font-medium">
<h3 className="truncate text-sm font-medium text-neutral-500 sm:text-base lg:text-xl">
{loggingOut ? 'Signing' : 'Sign'} Out
</h3>
</div>
</div>
{loggingOut ? (
<LoadingSpinner />
) : (
<ArrowLeftOnRectangleIcon className="h-6 w-6 flex-shrink-0 " aria-hidden="true" />
<ArrowLeftOnRectangleIcon
className="h-6 w-6 flex-shrink-0 lg:h-8 lg:w-8"
aria-hidden="true"
/>
)}
</button>
);
Expand All @@ -110,13 +117,18 @@ function DashCard({ item }: { item: typeof items[0] }): JSX.Element {
>
<div className="flex-1 truncate">
<div className="flex items-center space-x-3">
<h3 className="truncate text-sm font-medium text-neutral-100">{name}</h3>
<h3 className="truncate text-sm font-light text-neutral-100 sm:text-base lg:text-xl">
{name}
</h3>
</div>
<p className="mt-1 hidden truncate text-xs text-neutral-500 sm:block">
<p className="mt-1 hidden text-neutral-500 sm:block sm:text-sm lg:text-base">
{description}
</p>
</div>
<Icon className="h-6 w-6 flex-shrink-0 text-neutral-400" aria-hidden="true" />
<Icon
className="h-6 w-6 flex-shrink-0 text-neutral-400 lg:h-8 lg:w-8"
aria-hidden="true"
/>
</Link>
);
}
Expand All @@ -126,7 +138,8 @@ export function Home(): JSX.Element {
const navigate = useNavigate();
const { authed, loggedInUser } = useAuth();
const profile = useProfile(loggedInUser.username !== undefined ? loggedInUser.username : '');
const someURl = `https://mir-s3-cdn-cf.behance.net/project_modules/1400_opt_1/b385cb56555015.59b2ef09aa6e1.jpg`;
const someURl =
'https://mir-s3-cdn-cf.behance.net/project_modules/1400_opt_1/b385cb56555015.59b2ef09aa6e1.jpg';

useDocumentTitle('Dashboard');
React.useEffect(() => {
Expand Down Expand Up @@ -217,6 +230,10 @@ export function Home(): JSX.Element {
</div>
</div>
</div>
<span className="mb-2 flex space-x-4 text-xs font-light text-neutral-200 sm:ml-10">
<StarIcon className="mr-1 h-4 w-4 text-orange-500" />
Free Pro Trial
</span>
</div>
</Disclosure>

Expand Down
4 changes: 0 additions & 4 deletions apps/web/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
{
"source": "/api/auth/(.*)",
"destination": "/api/auth.ts"
},
{
"source": "/((?!api).*)",
"destination": "/"
}
],
"headers": [
Expand Down
Binary file added bun.lockb
Binary file not shown.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
"devDependencies": {
"@devclad/config": "*",
"@devclad/ui": "*",
"prettier": "2.7.1",
"eslint": "8.26.0",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "8.26.0",
"eslint-config-airbnb": "latest",
"eslint-config-airbnb-typescript": "latest",
"eslint-config-prettier": "latest",
Expand All @@ -31,9 +30,12 @@
"eslint-plugin-promise": "latest",
"eslint-plugin-react": "latest",
"eslint-plugin-react-hooks": "latest",
"prettier": "2.7.1",
"prettier-plugin-tailwindcss": "latest",
"rome": "^10.0.0",
"turbo": "latest",
"typescript": "^4.8.4"
"typescript": "^4.8.4",
"workspace": "^0.0.1-preview.1"
},
"engines": {
"node": ">=14.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/tailwindcss-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
darkMode: "class",
theme: {
screens: {
xs: "400px",
xs: "420px",
...defaultTheme.screens,
},
fontSize: {
Expand Down
8 changes: 8 additions & 0 deletions rome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
47 changes: 47 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,36 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"

"@rometools/[email protected]":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-10.0.0.tgz#c219bbdc8a9d53a845b18f6df2affbff5b887b0b"
integrity sha512-JT7JccEtKyFDHXy0MxhwHN4Zc94s/kW+0aTczb1ChAoCStfjj5jWzv/yQnm+HFw5Vf3ukAocLsDNRN6d9gQYbQ==

"@rometools/[email protected]":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-x64/-/cli-darwin-x64-10.0.0.tgz#dbf8284c5013d61dbca25ab92027398274ee2e3a"
integrity sha512-HORYhz8eM3L3XePPNBhU44zFpTVfhpuO4B7fjdfho7z9kwTW22M0fVvuPrxxPauxmin7gHM8lxCD2jHxabg34Q==

"@rometools/[email protected]":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-linux-arm64/-/cli-linux-arm64-10.0.0.tgz#50b3fd210054fc68f2c92494f304d26ab5a8a7b1"
integrity sha512-/L3jxo9RUwJ+uvDvAPCquAw10ccpZDuzADfZff5tHd6Fzv28cAToC3JrN/2miGpur0Fx/NIZIPbAsdI4NWGIRA==

"@rometools/[email protected]":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-linux-x64/-/cli-linux-x64-10.0.0.tgz#5cd3611dc23fcefafaf642791950bc3c940b172d"
integrity sha512-KC6CDeSR4haRfxmfrvCn8+NzQ7X31pDjFgD+m+PAbSXOeMr/KHmU7eDsjC3d47ORYYkYXqhx9VxHe1w3IEShMg==

"@rometools/[email protected]":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-win32-arm64/-/cli-win32-arm64-10.0.0.tgz#6dfb064de3b9a4c35a89bf32635ba4e675ea85c6"
integrity sha512-8XWjx7Z1dMp9q4Lvi+ax4+Y8vkbp7JHVdfrTSMQTyUA9ofaW6ah1h9iGPuKic057VTZGX66/KazC5qNTbrlckQ==

"@rometools/[email protected]":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-win32-x64/-/cli-win32-x64-10.0.0.tgz#1c5132eb96bac7ba5da59ed7cddac32d33bc933b"
integrity sha512-mAf3f32oE919cZ86KVMR/X0VOs+C16jEUyt1ww2UPw/rKUmm0DNfuT6/m4FQW8GEHdCBC8z3zdRVCd05VK7UJg==

"@rushstack/eslint-patch@^1.1.3", "@rushstack/eslint-patch@^1.2.0":
version "1.2.0"
resolved "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz"
Expand Down Expand Up @@ -7856,6 +7886,18 @@ rollup@^2.43.1, rollup@^2.79.0, rollup@^2.79.1:
optionalDependencies:
fsevents "~2.3.2"

rome@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/rome/-/rome-10.0.0.tgz#ae1e291f4b3546881c1709597f7e2e679546fc56"
integrity sha512-dQnIlzgHDt94N4JoFaqe9e2aDAZfdmyGOW4UaefMztDph41mt75Mg0aeJ/C7JgcIOLbp9D4LD+omyUB5YFUUPw==
optionalDependencies:
"@rometools/cli-darwin-arm64" "10.0.0"
"@rometools/cli-darwin-x64" "10.0.0"
"@rometools/cli-linux-arm64" "10.0.0"
"@rometools/cli-linux-x64" "10.0.0"
"@rometools/cli-win32-arm64" "10.0.0"
"@rometools/cli-win32-x64" "10.0.0"

run-async@^2.4.0:
version "2.4.1"
resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz"
Expand Down Expand Up @@ -9357,6 +9399,11 @@ [email protected], workbox-window@^6.5.4:
"@types/trusted-types" "^2.0.2"
workbox-core "6.5.4"

workspace@^0.0.1-preview.1:
version "0.0.1-preview.1"
resolved "https://registry.yarnpkg.com/workspace/-/workspace-0.0.1-preview.1.tgz#0ba0a6b92b3dbc7f1502dd12bc27a37b1eec9083"
integrity sha512-oPpEvU7NIQ0MW7ReL+EigMUI2JPNp05kmqzWS6zXVUaSq5KxuQzfgxGd8wuurBulBkTaOnEcGge+2rriyDVHkw==

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
Expand Down

0 comments on commit 1094cdb

Please sign in to comment.