Skip to content

Documentation page creation #409

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 22 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a2e40ce
Removed the component of search bar and filter options
loris-maru May 7, 2025
bfb2d30
Added documentation page
loris-maru Jun 3, 2025
cf77992
Create the page + navigation component + content of the architecture
loris-maru Jun 3, 2025
5cced9c
Added a layout and created the home page header
loris-maru Jun 3, 2025
2a585b2
Added tutorial carousel
loris-maru Jun 3, 2025
8d78872
Added the workshop slider
loris-maru Jun 3, 2025
03753b3
Added transcript and steps to the query
loris-maru Jun 3, 2025
b1ba09e
Added transcript options to the single tutorial page
loris-maru Jun 4, 2025
e450e01
Added the timestamps for the videos
loris-maru Jun 4, 2025
2834abc
Added checker for the transcripts
loris-maru Jun 4, 2025
4995f10
Removed the checker for steps and transcript
loris-maru Jun 4, 2025
c9d3d1a
Added chapter for each steps of the videos
loris-maru Jun 4, 2025
20e16fe
Added coming soon to section on home
loris-maru Jun 5, 2025
5fd143f
update error message for vlab exist on creation (#399)
bilalesi Jun 2, 2025
38d0c3d
110/change user journey format 2 (#406)
tolokoban Jun 3, 2025
d41a1d1
Public project notebook update complete metadata (#405)
loris-olivier-obi Jun 3, 2025
144982d
110/change user journey format 3 (#407)
tolokoban Jun 3, 2025
a1eebf1
Public projects corrections ayima feedback (#412)
loris-olivier-obi Jun 5, 2025
6768b01
Removed console log + import order
loris-maru Jun 5, 2025
3628294
Ran prettier and removed comments
loris-maru Jun 5, 2025
d9caa94
Fixes based on Fabien feedbacks
loris-maru Jun 5, 2025
005c427
Merge branch 'develop' into documentation-page-creation
loris-olivier-obi Jun 5, 2025
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/app/app/documentation/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import DocumentationSideBloc from '@/components/documentation/global/side-bloc';

export default function DocumentationLayout({ children }: { children: React.ReactNode }) {
return (
<div className="relative min-h-screen w-screen bg-primary-9 p-8">
<DocumentationSideBloc />
<main className="ml-[255px] w-2/3">{children}</main>
</div>
);
}
5 changes: 5 additions & 0 deletions src/app/app/documentation/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DocumentationHomepage from '@/components/documentation/main/Homepage';

export default function DocumentationPage() {
return <DocumentationHomepage />;
}
66 changes: 66 additions & 0 deletions src/app/app/documentation/tutorials/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'use client';

import { useParams } from 'next/navigation';
import { useRef, useState } from 'react';

import { useSanityForSingleTutorial } from '@/components/documentation/tutorials/fetch-single-tutorial';
import SliderTimestamps from '@/components/documentation/tutorials/slider-timestamps';
import TextContentBloc from '@/components/documentation/tutorials/TextContentBloc';

export default function SingleTutorialPage() {
const params = useParams();
const slug = params.slug as string;

const videoRef = useRef<HTMLVideoElement>(null);
const [videoTime, setVideoTime] = useState<number>(0);

const content = useSanityForSingleTutorial({ slug });

const handleTimeUpdate = () => {
if (videoRef.current) {
setVideoTime(Math.floor(videoRef.current.currentTime));
}
};

if (!content) {
return (
<div className="container mx-auto p-4 text-white">
<h1 className="text-3xl font-bold">Tutorial Not Found</h1>
<p>The tutorial with slug &quot;{slug}&quot; could not be found or is still loading.</p>
</div>
);
}

return (
<div className="relative flex w-full flex-col">
<header className="mb-4 w-full text-white">
<div className="text-base font-normal uppercase tracking-wider">Tutorial</div>
<h1 className="text-3xl font-bold">{content.title}</h1>
</header>
<div className="mb-4 w-full">
{content.url ? (
<video
playsInline
loop
controls
className="h-auto w-full rounded-lg border border-solid border-primary-7"
src={content.url}
ref={videoRef}
onTimeUpdate={handleTimeUpdate}
>
<track kind="captions" srcLang="en" label="English captions" />
</video>
) : (
<p className="text-white">Video URL not available.</p>
)}
</div>
<SliderTimestamps
content={content.steps ?? []}
videoTime={videoTime}
setVideoTime={setVideoTime}
videoRef={videoRef}
/>
<TextContentBloc content={content} />
</div>
);
}
8 changes: 4 additions & 4 deletions src/components/PublicProjects/tables/e-model-table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { Table, TableProps } from 'antd';
import { useState } from 'react';
import { Key, useState } from 'react';
import { EModelsProps } from '../type/artifactsType';
import columns from './columns/e-model-columns';

Expand All @@ -13,17 +13,17 @@ export default function EModelTable({ content }: { content: EModelsProps[] }) {

const rowSelection: TableProps<EModelsProps>['rowSelection'] = {
type: 'radio',
onChange: (selectedRowKeys: React.Key[], selectedRows: EModelsProps[]) => {
onChange: (selectedRowKeys: Key[], selectedRows: EModelsProps[]) => {
setSelectedRow(selectedRows[0] || null);
},
};

const handleDownload = () => {
console.log('Want to download:', selectedRow?.download);
if (selectedRow?.downloadLink) {
const link = document.createElement('a');
link.href = selectedRow.download ?? '';
link.download = selectedRow.name || 'model'; // Use model name as filename or fallback to 'model'
link.download = selectedRow.name || 'model';

document.body.appendChild(link);
link.click();
document.body.removeChild(link);
Expand Down
12 changes: 8 additions & 4 deletions src/components/SideMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
'use client';

import { useAtomValue } from 'jotai';
import { unwrap } from 'jotai/utils';
import {
DownOutlined,
HomeOutlined,
QuestionCircleOutlined,
UpOutlined,
UserOutlined,
} from '@ant-design/icons';
import { useAtomValue } from 'jotai';
import { unwrap } from 'jotai/utils';
import Link from 'next/link';

import HelpMenu from '../HelpMenu';
import DocumentationIcon from '../icons/DocumentationIcon';

import UserMenu from '@/components/user-menu';
import { LabItem, LinkItem, ProjectItem } from '@/components/VerticalLinks';
import { useUnwrappedValue } from '@/hooks/hooks';
import { virtualLabDetailAtomFamily } from '@/state/virtual-lab/lab';
import { virtualLabProjectDetailsAtomFamily } from '@/state/virtual-lab/projects';
import { classNames } from '@/util/utils';
import { useUnwrappedValue } from '@/hooks/hooks';

type SideMenuProps = {
lab: LabItem;
Expand Down Expand Up @@ -99,6 +100,9 @@ export default function SideMenu({ lab, project, links }: SideMenuProps) {
</div>

<div className="mb-5 flex w-full flex-col items-center gap-2 overflow-hidden text-primary-3">
<Link href="/app/virtual-lab" className="group cursor-pointer">
<DocumentationIcon iconColor="white" />
</Link>
<HelpMenu>
<QuestionCircleOutlined className="group-hover:text-white" />
</HelpMenu>
Expand Down
24 changes: 18 additions & 6 deletions src/components/VirtualLab/side-bar/control.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
'use client';

import Link from 'next/link';
import { HomeOutlined, QuestionCircleOutlined, UserOutlined } from '@ant-design/icons';
import Link from 'next/link';

import { classNames } from '@/util/utils';
import UserMenu from '@/components/user-menu';
import HelpMenu from '@/components/HelpMenu';
import { DocumentationIcon } from '@/components/icons';
import UserMenu from '@/components/user-menu';
import { classNames } from '@/util/utils';

export default function Profile() {
return (
<div className="mt-auto flex flex-col gap-4">
<Link
href="/app/documentation"
aria-label="documentation"
className={classNames(
'flex h-12 w-12 items-center justify-center p-3',
'text-white transition-all duration-200',
'border border-primary-6 hover:border-primary-5 hover:bg-primary-5'
)}
>
<DocumentationIcon className="h-auto w-5 text-white" />
</Link>
<HelpMenu
cls={{
trigger: '!p-0',
Expand All @@ -19,7 +31,7 @@ export default function Profile() {
className={classNames(
'flex w-max items-center justify-center p-3',
'text-white transition-all duration-200',
'border border-white hover:border-primary-5 hover:bg-primary-5'
'border border-primary-6 hover:border-primary-5 hover:bg-primary-5'
)}
>
<QuestionCircleOutlined className="text-xl" />
Expand All @@ -32,7 +44,7 @@ export default function Profile() {
className={classNames(
'flex w-max items-center justify-center p-3',
'text-white transition-all duration-200',
'border border-white hover:border-primary-5 hover:bg-primary-5'
'border border-primary-6 hover:border-primary-5 hover:bg-primary-5'
)}
>
<HomeOutlined className="text-xl" />
Expand All @@ -46,7 +58,7 @@ export default function Profile() {
className={classNames(
'flex w-max items-center justify-center p-3',
'text-white transition-all duration-200',
'border border-white hover:border-primary-5 hover:bg-primary-5'
'border border-primary-6 hover:border-primary-5 hover:bg-primary-5'
)}
>
<UserOutlined className="text-xl" />
Expand Down
Loading