Prettier format pending files
This commit is contained in:
parent
f7242072b0
commit
c9b5f5e637
4 changed files with 43 additions and 22 deletions
|
|
@ -69,7 +69,10 @@ const OAuthConnections = memo(function OAuthConnections({
|
|||
{statusCopy.linked}
|
||||
</Badge>
|
||||
) : (
|
||||
<Badge variant="outline" className="border-border/50 text-muted-foreground">
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="border-border/50 text-muted-foreground"
|
||||
>
|
||||
{statusCopy.notLinked}
|
||||
</Badge>
|
||||
);
|
||||
|
|
@ -79,7 +82,9 @@ const OAuthConnections = memo(function OAuthConnections({
|
|||
key={provider}
|
||||
className={cn(
|
||||
"flex flex-col gap-4 rounded-xl border p-4 md:flex-row md:items-center md:justify-between",
|
||||
linkedMeta ? "border-emerald-500/40 bg-emerald-500/5" : "border-border/50 bg-background/20",
|
||||
linkedMeta
|
||||
? "border-emerald-500/40 bg-emerald-500/5"
|
||||
: "border-border/50 bg-background/20",
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-1 items-start gap-4">
|
||||
|
|
@ -93,7 +98,9 @@ const OAuthConnections = memo(function OAuthConnections({
|
|||
</div>
|
||||
<div className="flex-1 space-y-2">
|
||||
<div className="flex flex-col gap-1 md:flex-row md:items-center md:gap-3">
|
||||
<h3 className="text-lg font-semibold text-foreground">{name}</h3>
|
||||
<h3 className="text-lg font-semibold text-foreground">
|
||||
{name}
|
||||
</h3>
|
||||
{linkedBadge}
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground">{description}</p>
|
||||
|
|
@ -101,19 +108,25 @@ const OAuthConnections = memo(function OAuthConnections({
|
|||
<div className="grid gap-1 text-xs text-muted-foreground sm:grid-cols-2">
|
||||
{linkedMeta.linkedAt && (
|
||||
<div>
|
||||
<span className="font-medium text-foreground">Linked:</span>{" "}
|
||||
<span className="font-medium text-foreground">
|
||||
Linked:
|
||||
</span>{" "}
|
||||
{formatTimestamp(linkedMeta.linkedAt)}
|
||||
</div>
|
||||
)}
|
||||
{linkedMeta.lastSignInAt && (
|
||||
<div>
|
||||
<span className="font-medium text-foreground">Last sign-in:</span>{" "}
|
||||
<span className="font-medium text-foreground">
|
||||
Last sign-in:
|
||||
</span>{" "}
|
||||
{formatTimestamp(linkedMeta.lastSignInAt)}
|
||||
</div>
|
||||
)}
|
||||
{linkedMeta.identityId && (
|
||||
<div className="truncate" title={linkedMeta.identityId}>
|
||||
<span className="font-medium text-foreground">Identity:</span>{" "}
|
||||
<span className="font-medium text-foreground">
|
||||
Identity:
|
||||
</span>{" "}
|
||||
{linkedMeta.identityId}
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -130,7 +143,10 @@ const OAuthConnections = memo(function OAuthConnections({
|
|||
onClick={() => onUnlink(provider)}
|
||||
>
|
||||
{isUnlinking ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" aria-hidden="true" />
|
||||
<Loader2
|
||||
className="h-4 w-4 animate-spin"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : (
|
||||
<Unlink className="h-4 w-4" aria-hidden="true" />
|
||||
)}
|
||||
|
|
@ -143,7 +159,10 @@ const OAuthConnections = memo(function OAuthConnections({
|
|||
onClick={() => onLink(provider)}
|
||||
>
|
||||
{isLinking ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" aria-hidden="true" />
|
||||
<Loader2
|
||||
className="h-4 w-4 animate-spin"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : (
|
||||
<LinkIcon className="h-4 w-4" aria-hidden="true" />
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,8 @@ const RealmSwitcher = memo(function RealmSwitcher({
|
|||
Realm & Path
|
||||
</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Tailor your AeThex experience. Choose the realm that matches your goals and align the path difficulty that fits your craft.
|
||||
Tailor your AeThex experience. Choose the realm that matches your
|
||||
goals and align the path difficulty that fits your craft.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -229,9 +230,7 @@ const RealmSwitcher = memo(function RealmSwitcher({
|
|||
{isActive ? "Realm active" : "Activate realm"}
|
||||
</Button>
|
||||
<Button asChild variant="ghost" size="sm" className="text-xs">
|
||||
<Link to={realm.route}>
|
||||
Visit {realm.routeLabel}
|
||||
</Link>
|
||||
<Link to={realm.route}>Visit {realm.routeLabel}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
|
@ -244,7 +243,8 @@ const RealmSwitcher = memo(function RealmSwitcher({
|
|||
<div className="space-y-2">
|
||||
<p className="text-sm font-medium text-foreground">Path difficulty</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Tune the experience level that unlocks curated resources and challenges matched to your expertise.
|
||||
Tune the experience level that unlocks curated resources and
|
||||
challenges matched to your expertise.
|
||||
</p>
|
||||
</div>
|
||||
<Select value={selectedExperience} onValueChange={onExperienceChange}>
|
||||
|
|
@ -263,7 +263,8 @@ const RealmSwitcher = memo(function RealmSwitcher({
|
|||
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Your realm influences recommendations, default routes, and collaboration invites. You can change it anytime.
|
||||
Your realm influences recommendations, default routes, and
|
||||
collaboration invites. You can change it anytime.
|
||||
</p>
|
||||
<Button
|
||||
type="button"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ export function checkProfileComplete(p?: AethexUserProfile | null): boolean {
|
|||
return true;
|
||||
}
|
||||
|
||||
const hasIdentity = isNonEmptyString(p.username) || isNonEmptyString(p.full_name);
|
||||
const hasIdentity =
|
||||
isNonEmptyString(p.username) || isNonEmptyString(p.full_name);
|
||||
const hasProfileCore =
|
||||
isNonEmptyString(p.full_name) &&
|
||||
isNonEmptyString((p as any).user_type) &&
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ import OAuthConnections, {
|
|||
ProviderDescriptor,
|
||||
ProviderKey,
|
||||
} from "@/components/settings/OAuthConnections";
|
||||
import RealmSwitcher, {
|
||||
RealmKey,
|
||||
} from "@/components/settings/RealmSwitcher";
|
||||
import RealmSwitcher, { RealmKey } from "@/components/settings/RealmSwitcher";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
|
|
@ -96,7 +94,9 @@ export default function Dashboard() {
|
|||
const [experienceLevel, setExperienceLevel] = useState("beginner");
|
||||
const [savingRealm, setSavingRealm] = useState(false);
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [activeTab, setActiveTab] = useState(() => searchParams.get("tab") ?? "profile");
|
||||
const [activeTab, setActiveTab] = useState(
|
||||
() => searchParams.get("tab") ?? "profile",
|
||||
);
|
||||
|
||||
const linkedProviderMap = useMemo(() => {
|
||||
const map: Record<string, (typeof linkedProviders)[number]> = {};
|
||||
|
|
@ -197,8 +197,7 @@ export default function Dashboard() {
|
|||
console.error("Failed to save realm:", error);
|
||||
aethexToast.error({
|
||||
title: "Unable to save realm",
|
||||
description:
|
||||
error?.message || "Please try again or refresh the page.",
|
||||
description: error?.message || "Please try again or refresh the page.",
|
||||
});
|
||||
} finally {
|
||||
setSavingRealm(false);
|
||||
|
|
@ -1011,7 +1010,8 @@ export default function Dashboard() {
|
|||
Linked accounts
|
||||
</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Manage third-party login providers connected to your AeThex account.
|
||||
Manage third-party login providers connected to your
|
||||
AeThex account.
|
||||
</p>
|
||||
</div>
|
||||
<OAuthConnections
|
||||
|
|
|
|||
Loading…
Reference in a new issue