-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
512 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
import { Button } from "../ui/button"; | ||
import ConnectionTable from "./ConnectionTable"; | ||
import { toast } from "sonner" | ||
|
||
export default function ConnectionsPage() { | ||
return ( | ||
<div className="flex items-center justify-between space-y-2"> | ||
<div className="flex-1 space-y-4 p-8 pt-6"> | ||
<div className="flex flex-col items-start justify-between space-y-2"> | ||
<h2 className="text-3xl font-bold tracking-tight">Connections</h2> | ||
<h2 className="text-lg font-bold tracking-tight">Connections between your product and your users’ accounts on third-party software.</h2> | ||
</div> | ||
<ConnectionTable/> | ||
</div> | ||
return ( | ||
<div className="flex items-center justify-between space-y-2"> | ||
<div className="flex-1 space-y-4 p-8 pt-6"> | ||
<div className="flex flex-col items-start justify-between space-y-2"> | ||
<h2 className="text-3xl font-bold tracking-tight">Connections</h2> | ||
<h2 className="text-lg font-bold tracking-tight">Connections between your product and your users’ accounts on third-party software.</h2> | ||
<Button | ||
variant="outline" | ||
onClick={() => | ||
toast("Event has been created", { | ||
description: "Sunday, December 03, 2023 at 9:00 AM", | ||
action: { | ||
label: "Undo", | ||
onClick: () => console.log("Undo"), | ||
}, | ||
}) | ||
} | ||
> | ||
Show Toast | ||
</Button> | ||
</div> | ||
<ConnectionTable /> | ||
</div> | ||
); | ||
} | ||
</div> | ||
); | ||
} |
142 changes: 71 additions & 71 deletions
142
apps/webapp/src/components/homepage/components/user-nav.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
import { | ||
Avatar, | ||
AvatarFallback, | ||
AvatarImage, | ||
} from "@/components/ui/avatar" | ||
import { Button } from "@/components/ui/button" | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuGroup, | ||
DropdownMenuItem, | ||
DropdownMenuLabel, | ||
DropdownMenuSeparator, | ||
DropdownMenuTrigger, | ||
} from "@/components/ui/dropdown-menu" | ||
Avatar, | ||
AvatarFallback, | ||
AvatarImage, | ||
} from "@/components/ui/avatar" | ||
import { Button } from "@/components/ui/button" | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuGroup, | ||
DropdownMenuItem, | ||
DropdownMenuLabel, | ||
DropdownMenuSeparator, | ||
DropdownMenuTrigger, | ||
} from "@/components/ui/dropdown-menu" | ||
import { Skeleton } from "@/components/ui/skeleton"; | ||
import useProfile from "@/hooks/useProfile"; | ||
import useProfileStore from "@/state/profileStore"; | ||
import { useEffect } from "react"; | ||
|
||
export function UserNav() { | ||
const {data, isLoading} = useProfile(); | ||
if(!data) { | ||
console.log("loading profiles"); | ||
} | ||
const { profile, setProfile } = useProfileStore(); | ||
export function UserNav() { | ||
const {data, isLoading} = useProfile(); | ||
if(!data) { | ||
console.log("loading profiles"); | ||
} | ||
const { profile, setProfile } = useProfileStore(); | ||
|
||
useEffect(()=> { | ||
if(data && data.length > 0 ){ | ||
setProfile({ | ||
id_user: data[0].id_user, | ||
email: data[0].email, | ||
first_name: data[0].first_name, | ||
last_name: data[0].last_name, | ||
id_organization: data[0].id_organization as string, | ||
}) | ||
} | ||
}, [data, setProfile]); | ||
useEffect(()=> { | ||
if(data && data.length > 0 ){ | ||
setProfile({ | ||
id_user: data[0].id_user, | ||
email: data[0].email, | ||
first_name: data[0].first_name, | ||
last_name: data[0].last_name, | ||
id_organization: data[0].id_organization as string, | ||
}) | ||
} | ||
}, [data, setProfile]); | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant="ghost" className="relative h-8 w-8 rounded-full"> | ||
<Avatar className="h-8 w-8"> | ||
<AvatarImage src="/avatars/01.png" alt="@shadcn" /> | ||
<AvatarFallback>SC</AvatarFallback> | ||
</Avatar> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<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"> | ||
{profile ? profile.first_name : isLoading ? <Skeleton className="w-[100px] h-[20px] rounded-md" /> : "No profiles found"} | ||
|
||
</p> | ||
<p className="text-xs leading-none text-muted-foreground"> | ||
{profile ? profile.email : isLoading ? <Skeleton className="w-[100px] h-[20px] rounded-md" /> : "No mail found"} | ||
</p> | ||
</div> | ||
</DropdownMenuLabel> | ||
<DropdownMenuSeparator /> | ||
<DropdownMenuGroup> | ||
<DropdownMenuItem> | ||
Profile | ||
</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
Billing | ||
</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
Settings | ||
</DropdownMenuItem> | ||
</DropdownMenuGroup> | ||
<DropdownMenuSeparator /> | ||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant="ghost" className="relative h-8 w-8 rounded-full"> | ||
<Avatar className="h-8 w-8"> | ||
<AvatarImage src="/avatars/01.png" alt="@shadcn" /> | ||
<AvatarFallback>SC</AvatarFallback> | ||
</Avatar> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<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"> | ||
{profile ? profile.first_name : isLoading ? <Skeleton className="w-[100px] h-[20px] rounded-md" /> : "No profiles found"} | ||
|
||
</p> | ||
<p className="text-xs leading-none text-muted-foreground"> | ||
{profile ? profile.email : isLoading ? <Skeleton className="w-[100px] h-[20px] rounded-md" /> : "No mail found"} | ||
</p> | ||
</div> | ||
</DropdownMenuLabel> | ||
<DropdownMenuSeparator /> | ||
<DropdownMenuGroup> | ||
<DropdownMenuItem> | ||
Profile | ||
</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
Billing | ||
</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
Log out | ||
Settings | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
) | ||
} | ||
</DropdownMenuGroup> | ||
<DropdownMenuSeparator /> | ||
<DropdownMenuItem> | ||
Log out | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useTheme } from "next-themes" | ||
import { Toaster as Sonner } from "sonner" | ||
|
||
type ToasterProps = React.ComponentProps<typeof Sonner> | ||
|
||
const Toaster = ({ ...props }: ToasterProps) => { | ||
const { theme = "system" } = useTheme() | ||
|
||
return ( | ||
<Sonner | ||
theme={theme as ToasterProps["theme"]} | ||
className="toaster group" | ||
toastOptions={{ | ||
classNames: { | ||
toast: | ||
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg", | ||
description: "group-[.toast]:text-muted-foreground", | ||
actionButton: | ||
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground", | ||
cancelButton: | ||
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground", | ||
}, | ||
}} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export { Toaster } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.