Skip to content

Commit

Permalink
latest content
Browse files Browse the repository at this point in the history
  • Loading branch information
ankushKun committed Jun 5, 2024
1 parent 21cea5b commit 860c19d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
18 changes: 14 additions & 4 deletions next_app/src/components/ao/landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { toast } from "@/components/ui/use-toast";
import { Button } from "../ui/button"
import { useEffect, useState } from "react";
import { useLocalStorage } from "usehooks-ts";
import Link from "next/link";

const words = [
"winston",
Expand Down Expand Up @@ -29,9 +30,12 @@ const words = [
"⁄⁠(⁠⁄⁠ ⁠⁄⁠•⁠⁄⁠-⁠⁄⁠•⁠⁄⁠ ⁠⁄⁠)⁠⁄"
]

const cat = `
ᓚᘏᗢ
`
function ContentItem({ title, desc, link }) {
return <Link href={link} target="_blank" className="flex flex-col items-center gap-2 ring-1 p-2 px-4 rounded-md ring-foreground bg-foreground/0 hover:bg-primary/20 active:bg-primary/40 hover:scale-105 active:scale-100 transition-all duration-200">
<span className="font-bold">{title} 🔗</span>
<span className="text-sm">{desc}</span>
</Link>
}

export default function AOLanding() {
const [walletAddress, setWalletAddress] = useState<string>("");
Expand Down Expand Up @@ -84,12 +88,18 @@ export default function AOLanding() {

{!walletAddress && <Button onClick={connectWallet}>Connect Wallet</Button>}

<div className="flex flex-col text-center gap-x-4 mt-8">
<div className="flex flex-col text-center gap-x-4 my-6">
<h1 className="px-8">Create a new project from the sidebar</h1>
<h1 className="px-8">
Or open an existing one ;)
</h1>
</div>
<div>Latest content</div>
<div className="grid grid-cols-3 gap-3">
<ContentItem title="Portable Codecells" desc="Learn how to integrate our codecells into your webapps" link="https://youtu.be/e7Gx2NdWXLQ?si=hg8Ih7828AsVjpp7" />
<ContentItem title="Unit Testing" desc="Try writing unit tests for your AO functions" link="https://mirror.xyz/0xCf673b87aFBed6091617331cC895376209d3b923/uBgGB-HNhlig7RucAzdSyRjJIJSXCug5NMgN7bXS9qk" />
<ContentItem title="BetterIDEa graphs" desc="Fetch and plot live crypto prices data using 0rbit oracle and BetterIDEa graphs" link="https://ide.betteridea.dev/import?id=2voE0ERMT6CCPRVEkTsotDR-dmHgfoSH6dvucL9rSQc"/>
</div>
</div>
</section>
</>
Expand Down
3 changes: 1 addition & 2 deletions next_app/src/components/bottom-tab-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function BottomTabBar({ collapsed, toggle, setFullScreen, fullscr
useEffect(() => {
if (globalState.activeMode == "AO") {
setCommandOutputs([]);
getInbox();
}
}, [globalState.activeProject]);

Expand Down Expand Up @@ -119,7 +118,7 @@ export default function BottomTabBar({ collapsed, toggle, setFullScreen, fullscr
function showFullMessage(_) { }

return (
<Tabs defaultValue="inbox" onChange={(e) => console.log(e)} className=" pt-7 w-full h-full">
<Tabs defaultValue="" onChange={(e) => console.log(e)} className=" pt-7 w-full h-full">
{globalState.activeProject && <TabsList className="border-b rounded-none flex justify-start p-0 absolute top-0 h-7 bg-background z-30 w-full" onClick={() => { if (collapsed) toggle() }}>
{globalState.activeMode == "AO" && (
<TabsTrigger value="inbox" className="rounded-none border-b data-[state=active]:border-primary" onClick={getInbox}>
Expand Down
12 changes: 8 additions & 4 deletions next_app/src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export default function Layout() {
const manager = useProjectManager();
const globalState = useGlobalState();
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
const [bottombarCollapsed, setBottombarCollapsed] = useState(false);
const [bottombarCollapsed, setBottombarCollapsed] = useState(true);
const [topbarCollapsed, setTopbarCollapsed] = useState(false);
const bottombarRef = useRef<ImperativePanelHandle>(null);
const [mounted, setMounted] = useState(false);
Expand Down Expand Up @@ -634,9 +634,13 @@ export default function Layout() {
}
};

// useEffect(() => {
// bottombarRef.current.collapse();
// }, [])
useEffect(() => {
bottombarRef.current.collapse();
}, [])

useEffect(()=>{
if(!globalState.activeProject)bottombarRef.current.collapse()
},[globalState.activeProject])

const project =
globalState.activeProject && manager.getProject(globalState.activeProject);
Expand Down

0 comments on commit 860c19d

Please sign in to comment.