mishig HF Staff commited on
Commit
cebfee6
·
verified ·
1 Parent(s): 6a1ac9b

Sync from GitHub via hub-sync

Browse files
src/app/[org]/[dataset]/[episode]/episode-viewer.tsx CHANGED
@@ -19,6 +19,7 @@ import Sidebar from "@/components/side-nav";
19
  import StatsPanel from "@/components/stats-panel";
20
  import OverviewPanel from "@/components/overview-panel";
21
  import Loading from "@/components/loading-component";
 
22
  import { hasURDFSupport } from "@/lib/so101-robot";
23
  import {
24
  getAdjacentEpisodesVideoInfo,
@@ -530,6 +531,9 @@ function EpisodeViewerInner({
530
  label="Doctor"
531
  title="Dataset quality diagnostics (powered by lerobot-doctor)"
532
  />
 
 
 
533
  </div>
534
 
535
  {/* Body: sidebar + content */}
 
19
  import StatsPanel from "@/components/stats-panel";
20
  import OverviewPanel from "@/components/overview-panel";
21
  import Loading from "@/components/loading-component";
22
+ import HfAuthButton from "@/components/hf-auth-button";
23
  import { hasURDFSupport } from "@/lib/so101-robot";
24
  import {
25
  getAdjacentEpisodesVideoInfo,
 
531
  label="Doctor"
532
  title="Dataset quality diagnostics (powered by lerobot-doctor)"
533
  />
534
+ <div className="ml-auto pr-3">
535
+ <HfAuthButton />
536
+ </div>
537
  </div>
538
 
539
  {/* Body: sidebar + content */}
src/app/explore/explore-grid.tsx CHANGED
@@ -3,6 +3,7 @@
3
  import React, { useEffect, useRef } from "react";
4
  import Link from "next/link";
5
  import { postParentMessageWithParams } from "@/utils/postParentMessage";
 
6
 
7
  type ExploreGridProps = {
8
  datasets: Array<{ id: string; videoUrl: string | null }>;
@@ -27,9 +28,12 @@ export default function ExploreGrid({
27
 
28
  return (
29
  <main className="px-8 py-10 max-w-7xl mx-auto">
30
- <h1 className="text-xl font-medium tracking-tight mb-6 text-slate-100">
31
- Explore LeRobot datasets
32
- </h1>
 
 
 
33
  <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
34
  {datasets.map((ds, idx) => (
35
  <Link
 
3
  import React, { useEffect, useRef } from "react";
4
  import Link from "next/link";
5
  import { postParentMessageWithParams } from "@/utils/postParentMessage";
6
+ import HfAuthButton from "@/components/hf-auth-button";
7
 
8
  type ExploreGridProps = {
9
  datasets: Array<{ id: string; videoUrl: string | null }>;
 
28
 
29
  return (
30
  <main className="px-8 py-10 max-w-7xl mx-auto">
31
+ <div className="flex items-center justify-between mb-6 gap-4">
32
+ <h1 className="text-xl font-medium tracking-tight text-slate-100">
33
+ Explore LeRobot datasets
34
+ </h1>
35
+ <HfAuthButton />
36
+ </div>
37
  <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
38
  {datasets.map((ds, idx) => (
39
  <Link
src/app/layout.tsx CHANGED
@@ -2,7 +2,6 @@ import type { Metadata } from "next";
2
  import { Inter } from "next/font/google";
3
  import "./globals.css";
4
  import { AuthProvider } from "@/context/auth-context";
5
- import HfAuthButton from "@/components/hf-auth-button";
6
 
7
  const inter = Inter({ subsets: ["latin"] });
8
 
@@ -19,12 +18,7 @@ export default function RootLayout({
19
  return (
20
  <html lang="en">
21
  <body className={inter.className}>
22
- <AuthProvider>
23
- <div className="fixed top-3 right-3 z-50">
24
- <HfAuthButton />
25
- </div>
26
- {children}
27
- </AuthProvider>
28
  </body>
29
  </html>
30
  );
 
2
  import { Inter } from "next/font/google";
3
  import "./globals.css";
4
  import { AuthProvider } from "@/context/auth-context";
 
5
 
6
  const inter = Inter({ subsets: ["latin"] });
7
 
 
18
  return (
19
  <html lang="en">
20
  <body className={inter.className}>
21
+ <AuthProvider>{children}</AuthProvider>
 
 
 
 
 
22
  </body>
23
  </html>
24
  );
src/app/page.tsx CHANGED
@@ -4,6 +4,7 @@ import Link from "next/link";
4
  import { useRouter } from "next/navigation";
5
  import { useSearchParams } from "next/navigation";
6
  import { authHeaders } from "@/utils/auth";
 
7
 
8
  export default function Home() {
9
  return (
@@ -282,6 +283,10 @@ function HomeInner() {
282
  </button>
283
  </form>
284
 
 
 
 
 
285
  {/* Example Datasets */}
286
  <div className="mt-8">
287
  <p className="text-white/40 text-xs uppercase tracking-widest mb-3 font-medium">
 
4
  import { useRouter } from "next/navigation";
5
  import { useSearchParams } from "next/navigation";
6
  import { authHeaders } from "@/utils/auth";
7
+ import HfAuthButton from "@/components/hf-auth-button";
8
 
9
  export default function Home() {
10
  return (
 
283
  </button>
284
  </form>
285
 
286
+ <div className="mt-3">
287
+ <HfAuthButton />
288
+ </div>
289
+
290
  {/* Example Datasets */}
291
  <div className="mt-8">
292
  <p className="text-white/40 text-xs uppercase tracking-widest mb-3 font-medium">
src/components/hf-auth-button.tsx CHANGED
@@ -4,7 +4,7 @@ import React from "react";
4
  import { useAuth } from "@/context/auth-context";
5
 
6
  const SIGNIN_BADGE_URL =
7
- "https://huggingface.co/datasets/huggingface/badges/resolve/main/sign-in-with-huggingface-md-dark.svg";
8
 
9
  export default function HfAuthButton() {
10
  const { oauth, isAuthAvailable, signIn, signOut } = useAuth();
@@ -16,21 +16,21 @@ export default function HfAuthButton() {
16
  oauth.userInfo?.preferred_username ?? oauth.userInfo?.name ?? "signed in";
17
  const avatar = oauth.userInfo?.picture;
18
  return (
19
- <div className="flex items-center gap-2 panel-raised bg-[var(--surface-0)]/85 backdrop-blur px-2 py-1 text-xs text-slate-300">
20
  {avatar && (
21
  // eslint-disable-next-line @next/next/no-img-element
22
  <img
23
  src={avatar}
24
  alt=""
25
- width={18}
26
- height={18}
27
  className="rounded-full"
28
  />
29
  )}
30
- <span className="tabular max-w-[10rem] truncate">{name}</span>
31
  <button
32
  onClick={signOut}
33
- className="rounded-md px-2 py-0.5 text-[10px] uppercase tracking-wide text-slate-400 hover:text-slate-100 hover:bg-white/5 transition-colors"
34
  title="Sign out of Hugging Face"
35
  >
36
  Sign out
@@ -43,16 +43,18 @@ export default function HfAuthButton() {
43
  <button
44
  onClick={signIn}
45
  title="Sign in to access your private datasets"
46
- className="flex items-center gap-2 rounded-md transition-opacity hover:opacity-90"
47
  >
48
  {/* eslint-disable-next-line @next/next/no-img-element */}
49
  <img
50
  src={SIGNIN_BADGE_URL}
51
  alt="Sign in with Hugging Face"
52
- height={32}
53
- className="h-8 w-auto"
54
  />
55
- <span className="text-xs text-slate-300">to access private datasets</span>
 
 
56
  </button>
57
  );
58
  }
 
4
  import { useAuth } from "@/context/auth-context";
5
 
6
  const SIGNIN_BADGE_URL =
7
+ "https://huggingface.co/datasets/huggingface/badges/resolve/main/sign-in-with-huggingface-sm-dark.svg";
8
 
9
  export default function HfAuthButton() {
10
  const { oauth, isAuthAvailable, signIn, signOut } = useAuth();
 
16
  oauth.userInfo?.preferred_username ?? oauth.userInfo?.name ?? "signed in";
17
  const avatar = oauth.userInfo?.picture;
18
  return (
19
+ <div className="inline-flex items-center gap-1.5 panel-raised bg-[var(--surface-0)]/85 backdrop-blur px-1.5 py-0.5 text-[11px] text-slate-300">
20
  {avatar && (
21
  // eslint-disable-next-line @next/next/no-img-element
22
  <img
23
  src={avatar}
24
  alt=""
25
+ width={14}
26
+ height={14}
27
  className="rounded-full"
28
  />
29
  )}
30
+ <span className="tabular max-w-[8rem] truncate">{name}</span>
31
  <button
32
  onClick={signOut}
33
+ className="rounded px-1 text-[9px] uppercase tracking-wide text-slate-400 hover:text-slate-100 hover:bg-white/5 transition-colors"
34
  title="Sign out of Hugging Face"
35
  >
36
  Sign out
 
43
  <button
44
  onClick={signIn}
45
  title="Sign in to access your private datasets"
46
+ className="inline-flex items-center gap-1.5 rounded-md transition-opacity hover:opacity-90"
47
  >
48
  {/* eslint-disable-next-line @next/next/no-img-element */}
49
  <img
50
  src={SIGNIN_BADGE_URL}
51
  alt="Sign in with Hugging Face"
52
+ height={24}
53
+ className="h-6 w-auto"
54
  />
55
+ <span className="text-[11px] text-slate-300/80">
56
+ to access private datasets
57
+ </span>
58
  </button>
59
  );
60
  }