Skip to content

Commit

Permalink
feat: webapp work
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Nov 28, 2023
1 parent 107999e commit a0dbc1b
Show file tree
Hide file tree
Showing 33 changed files with 2,215 additions and 196 deletions.
5 changes: 5 additions & 0 deletions packages/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@
"preview": "vite preview"
},
"dependencies": {
"@faker-js/faker": "^8.3.1",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@tanstack/react-table": "^8.10.7",
"class-variance-authority": "^0.7.0",
"clsx": "^1.2.1",
"cmdk": "^0.2.0",
Expand All @@ -27,6 +31,7 @@
"react": "^18.2.0",
"react-day-picker": "^8.9.1",
"react-dom": "^18.2.0",
"react-router-dom": "^6.20.0",
"recharts": "^2.10.1",
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7"
Expand Down
16 changes: 13 additions & 3 deletions packages/webapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import './App.css'
import { ThemeProvider } from '@/components/theme-provider'
import DashboardPage from './components/dashboard'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import JobsPage from './components/jobs';
import ConnectionsPage from './components/connections';
import TaskPage from './components/jobs/Task';

function App() {
return (
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
<div>
<DashboardPage/>
</div>
<Router>
<Routes>
<Route path="/" element={<DashboardPage />} />
<Route path="/jobs" element={<JobsPage />} />
<Route path="/tasks" element={<TaskPage />} />
<Route path="/connections" element={<ConnectionsPage />} />
{/* ... other routes */}
</Routes>
</Router>
</ThemeProvider>
)
}
Expand Down
14 changes: 14 additions & 0 deletions packages/webapp/src/components/api-keys/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function ApiKeysPage() {
return (
<div>
<div className="flex items-center justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">Api Keys</h2>
<div className="flex items-center space-x-2">
</div>
</div>
<div>

</div>
</div>
);
}
14 changes: 14 additions & 0 deletions packages/webapp/src/components/configuration/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function ConfigurationPage() {
return (
<div>
<div className="flex items-center justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">Configuration</h2>
<div className="flex items-center space-x-2">
</div>
</div>
<div>

</div>
</div>
);
}
14 changes: 14 additions & 0 deletions packages/webapp/src/components/connections/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function ConnectionsPage() {
return (
<div>
<div className="flex items-center justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">Connections</h2>
<div className="flex items-center space-x-2">
</div>
</div>
<div>

</div>
</div>
);
}
63 changes: 49 additions & 14 deletions packages/webapp/src/components/dashboard/components/main-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,73 @@
import { cn } from "@/lib/utils"
import { useState } from "react";

export function MainNav({
onLinkClick,
className,
...props
}: React.HTMLAttributes<HTMLElement>) {
}: {
onLinkClick: (name: string) => void;
className: string;
}) {
const [selectedItem, setSelectedItem] = useState<string>("jobs");

const navItemClassName = (itemName: string) =>
`text-sm border-b font-medium w-full text-left px-4 py-2 hover:bg-gray-900 cursor-pointer ${
selectedItem === itemName ? "bg-gray-900" : "text-muted-foreground"
} transition-colors`;

function click(name: string) {
setSelectedItem(name);
onLinkClick(name);
}

return (
<nav
className={cn("flex items-center space-x-4 lg:space-x-6", className)}
className={`flex flex-col items-start ${className}`}
{...props}
>
<a
href="/examples/dashboard"
className="text-sm font-medium transition-colors hover:text-primary"
className={navItemClassName('jobs')}
onClick={() => click('jobs')}
>
Jobs
</a>
<a
className={navItemClassName('connections')}
onClick={() => click('connections')}
>
Dashboard
Connections
</a>
<a
href="/examples/dashboard"
className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary"
className={navItemClassName('integrations')}
onClick={() => click('integrations')}
>
Integrations
</a>
<a
className={navItemClassName('linked-accounts')}
onClick={() => click('linked-accounts')}
>
Linked Accounts
</a>
<a
href="/examples/dashboard"
className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary"
className={navItemClassName('configuration')}
onClick={() => click('configuration')}
>
Configuration
</a>
<a
href="/examples/dashboard"
className="text-sm font-medium text-muted-foreground transition-colors hover:text-primary"
className={navItemClassName('api-keys')}
onClick={() => click('api-keys')}
>
API Keys
</a>
<a
className={navItemClassName('docs')}
onClick={() => click('docs')}
>
Docs
</a>
{/* Add other nav items as needed */}
</nav>
)
}
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function Search() {
<Input
type="search"
placeholder="Search..."
className="md:w-[100px] lg:w-[300px]"
className="md:w-[100px] lg:w-[100px]"
/>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const groups = [
label: "Personal Account",
teams: [
{
label: "Alicia Koch",
label: "Alicia K.",
value: "personal",
},
],
Expand Down Expand Up @@ -96,7 +96,7 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
aria-label="Select a team"
className={cn("w-[200px] justify-between", className)}
>
<Avatar className="mr-2 h-5 w-5">
<Avatar className="mr-2 h-3 w-3">
<AvatarImage
src={`https://avatar.vercel.sh/${selectedTeam.value}.png`}
alt={selectedTeam.label}
Expand All @@ -107,7 +107,7 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
<CaretSortIcon className="ml-auto h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0">
<PopoverContent className="w-[200px] p-0 ml-20">
<Command>
<CommandList>
<CommandInput placeholder="Search team..." />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
</Avatar>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56" align="end" forceMount>
<DropdownMenuContent className="w-56 ml-10" align="end" forceMount>
<DropdownMenuLabel className="font-normal">
<div className="flex flex-col space-y-1">
<p className="text-sm font-medium leading-none">shadcn</p>
Expand Down
Loading

0 comments on commit a0dbc1b

Please sign in to comment.