Skip to content

Feat/public crews #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
05a21c5
feat(sidebar): sidebar for dashboard
biwasxyz Nov 9, 2024
0f8f117
feat: Add sidebar toggle functionality with default collapsed state
whoabuddy Nov 10, 2024
5b63d38
style: Improve sidebar scrollbar appearance with Tailwind scrollbar u…
whoabuddy Nov 10, 2024
d561a6d
feat: Change sidebar toggle icon to dynamic chevron based on state
whoabuddy Nov 10, 2024
37c15be
refactor: Remove defaultOpen prop from Sidebar component
whoabuddy Nov 10, 2024
b95a49b
fix: Resolve TypeScript error in SidebarTrigger component
whoabuddy Nov 10, 2024
a442b60
fix: Resolve TypeScript type inference for SidebarTrigger children prop
whoabuddy Nov 10, 2024
c11eee4
refactor: Simplify sidebar trigger rendering in Dashboard component
whoabuddy Nov 10, 2024
273d587
refactor: Simplify sidebar icon rendering with helper function
whoabuddy Nov 10, 2024
d71cc83
refactor: Improve chevron icon rendering with explicit parentheses
whoabuddy Nov 10, 2024
157401f
refactor: Move sidebar toggle to sidebar edge for better positioning
whoabuddy Nov 10, 2024
864e7d4
feat: Double sidebar width in Dashboard and sidebar components
whoabuddy Nov 10, 2024
d79284e
fix: Adjust sidebar trigger positioning for better visibility
whoabuddy Nov 10, 2024
f8a1682
refactor: Adjust sidebar styling and positioning
whoabuddy Nov 10, 2024
3c1ead6
feat: Add mobile sheet sidebar for responsive dashboard layout
whoabuddy Nov 10, 2024
dcd43a6
refactor: Simplify dashboard sidebar to use Sheet component across al…
whoabuddy Nov 10, 2024
84e40de
refactor: Remove unused ChevronLeft and ChevronRight icons from import
whoabuddy Nov 10, 2024
f93d393
refactor: Adjust sidebar width and clean up imports in Dashboard comp…
whoabuddy Nov 10, 2024
df9e9c9
feat: Add crew management triggers to nav and dashboard
whoabuddy Nov 10, 2024
e847154
feat: Add sidebarOpen state to Dashboard component
whoabuddy Nov 10, 2024
8b0875f
refactor: Simplify dashboard chat messages and input placeholder
whoabuddy Nov 10, 2024
3e7f2f0
feat: Move crew management button next to chat input
whoabuddy Nov 10, 2024
9791e2b
feat: Import Settings icon from lucide-react
whoabuddy Nov 10, 2024
517d35c
chore: cleanup the mess
whoabuddy Nov 10, 2024
f9bf19c
feat: Add visual selection indicators for crew selection buttons
whoabuddy Nov 10, 2024
72866cc
refactor: Update crew selection icons to CheckCircle and Circle
whoabuddy Nov 10, 2024
e33b605
fix: build errors
whoabuddy Nov 10, 2024
1e0700f
feat(crew): toggle public and private
biwasxyz Nov 10, 2024
7fdb9a9
feat(crew): user can set their crew public/private
biwasxyz Nov 10, 2024
6038cc9
fix: build
biwasxyz Nov 10, 2024
5442a34
fix: protect public-crew route
biwasxyz Nov 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.3",
"@stacks/connect": "^7.7.1",
"@stacks/connect-react": "^22.4.2",
"@stacks/connect-ui": "^6.4.1",
Expand Down
5 changes: 4 additions & 1 deletion src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from "react";
import Dashboard from "@/components/dashboard/Dashboard";
import { SidebarProvider } from "@/components/ui/sidebar";

const page = () => {
return (
<div className="min-h-[80vh]">
<Dashboard />
<SidebarProvider>
<Dashboard />
</SidebarProvider>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/fetch/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function GET(request: Request) {
}

try {
const response = await fetch(`https://api.hiro.so/extended/v1/address/${address}/balances`, {
const response = await fetch(`https://cache.aibtc.dev/hiro-api/extended/v1/address/${address}/balances`, {
headers: {
"Accept": "application/json",
"X-API-Key": process.env.HIRO_API_KEY || "",
Expand Down
4 changes: 2 additions & 2 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ body {
--chart-2: 231 95% 41%; /* aibtc.blue.500 */
--chart-3: 220 2% 35%; /* aibtc.gray.500 */
--chart-4: 21 100% 70%; /* aibtc.orange.300 */
--chart-5: 231 95% 60%; /* aibtc.blue.300 */
--chart-5: 231 95% 60%; /* aibtc.blue.300 */ --sidebar-background: 0 0% 98%; --sidebar-foreground: 240 5.3% 26.1%; --sidebar-primary: 240 5.9% 10%; --sidebar-primary-foreground: 0 0% 98%; --sidebar-accent: 240 4.8% 95.9%; --sidebar-accent-foreground: 240 5.9% 10%; --sidebar-border: 220 13% 91%; --sidebar-ring: 217.2 91.2% 59.8%;
}

.dark {
Expand Down Expand Up @@ -92,7 +92,7 @@ body {
--chart-2: 231 95% 45%; /* darker blue */
--chart-3: 220 2% 25%; /* darker gray */
--chart-4: 21 100% 65%; /* lighter orange */
--chart-5: 231 95% 65%; /* lighter blue */
--chart-5: 231 95% 65%; /* lighter blue */ --sidebar-background: 240 5.9% 10%; --sidebar-foreground: 240 4.8% 95.9%; --sidebar-primary: 224.3 76.3% 48%; --sidebar-primary-foreground: 0 0% 100%; --sidebar-accent: 240 3.7% 15.9%; --sidebar-accent-foreground: 240 4.8% 95.9%; --sidebar-border: 240 3.7% 15.9%; --sidebar-ring: 217.2 91.2% 59.8%;
}
}

Expand Down
26 changes: 26 additions & 0 deletions src/app/public-crews/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { Metadata } from "next";
import { Nav } from "@/components/reusables/Navbar";
import { Footer } from "@/components/reusables/Footer";
import { Toaster } from "@/components/ui/toaster";

export const metadata: Metadata = {
title: "Public Crews",
};

export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<div>
<Nav />
{children}
<Footer />
<Toaster />
</div>
</>
);
}
11 changes: 11 additions & 0 deletions src/app/public-crews/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import PublicCrews from "@/components/public-crew/PublicCrews";
const page = () => {
return (
<div>
<PublicCrews />
</div>
);
};

export default page;
13 changes: 13 additions & 0 deletions src/components/crews/CrewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { Switch } from "@/components/ui/switch";
import { toast } from "@/hooks/use-toast";
import { CrewFormProps, Crew } from "@/types/supabase";

export default function CrewForm({ onCrewCreated, onClose }: CrewFormProps) {
const [crewName, setCrewName] = useState("");
const [crewDescription, setCrewDescription] = useState("");
const [isPublic, setIsPublic] = useState(false);
const [loading, setLoading] = useState(false);

const handleSubmit = async (e: React.FormEvent) => {
Expand All @@ -35,6 +37,7 @@ export default function CrewForm({ onCrewCreated, onClose }: CrewFormProps) {
name: crewName,
description: crewDescription,
profile_id: user.id,
is_public: isPublic,
})
.select()
.single();
Expand All @@ -46,10 +49,12 @@ export default function CrewForm({ onCrewCreated, onClose }: CrewFormProps) {
name: data.name,
description: data.description,
created_at: data.created_at,
is_public: data.is_public,
};

setCrewName("");
setCrewDescription("");
setIsPublic(false);
onClose();
onCrewCreated(newCrew);
toast({
Expand Down Expand Up @@ -90,6 +95,14 @@ export default function CrewForm({ onCrewCreated, onClose }: CrewFormProps) {
rows={3}
/>
</div>
<div className="flex items-center space-x-2">
<Switch
id="is-public"
checked={isPublic}
onCheckedChange={setIsPublic}
/>
<Label htmlFor="is-public">Make crew public</Label>
</div>
<Button type="submit" disabled={loading}>
{loading ? "Creating..." : "Create Crew"}
</Button>
Expand Down
Loading
Loading