Skip to content

Commit

Permalink
add platform tab
Browse files Browse the repository at this point in the history
  • Loading branch information
ProKil committed Jun 7, 2024
1 parent b7b581f commit 960dda2
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 2 deletions.
Binary file modified docs/bun.lockb
Binary file not shown.
53 changes: 53 additions & 0 deletions docs/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"

import { cn } from "@/lib/utils"

const Tabs = TabsPrimitive.Root

const TabsList = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.List>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
>(({ className, ...props }, ref) => (
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
className
)}
{...props}
/>
))
TabsList.displayName = TabsPrimitive.List.displayName

const TabsTrigger = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
className
)}
{...props}
/>
))
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName

const TabsContent = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className
)}
{...props}
/>
))
TabsContent.displayName = TabsPrimitive.Content.displayName

export { Tabs, TabsList, TabsTrigger, TabsContent }
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@tanstack/react-table": "^8.16.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
Expand Down
38 changes: 36 additions & 2 deletions docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Button } from "../components/ui/button"
import { MoveRight } from "lucide-react"
import { Accordion, AccordionItem, AccordionContent, AccordionTrigger } from "../components/ui/accordion"
import { Steps, Callout } from 'nextra/components'
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../components/ui/tabs"



# Sotopia - Getting Started
Expand Down Expand Up @@ -119,6 +121,14 @@ Redis stack is a required dependency for using Sotopia. There are two ways to se
<AccordionItem value="item-2">
<AccordionTrigger>No, I don't want to use Docker.</AccordionTrigger>
<AccordionContent>
<Tabs defaultValue="linux" className="w-full">
<TabsList>
<TabsTrigger value="linux">Linux</TabsTrigger>
<TabsTrigger value="mac">MacOS</TabsTrigger>
<TabsTrigger value="windows">Windows</TabsTrigger>
</TabsList>
<TabsContent value="linux">

<Steps>
### Download the Redis stack
```bash
Expand All @@ -129,14 +139,33 @@ Redis stack is a required dependency for using Sotopia. There are two ways to se
# if you are using Ubunutu 22.04, please do an extra step
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
# if you are using macOs
```

### Start the server
```bash
./redis-stack-server-7.2.0-v10/bin/redis-stack-server --daemonize yes
```



### The `REDIS_OM_URL` need to be set before loading and saving agents:
```bash
conda env config vars set REDIS_OM_URL="redis://user:password@host:port"
```
If you are using the default settings, you can set the `REDIS_OM_URL` to `redis://localhost:6379`.
</Steps>
</TabsContent>
<TabsContent value="mac">
<Steps>
### Download the Redis stack
```bash
brew tap redis-stack/redis-stack
brew install redis-stack
```

### Start the server
```bash
./redis-stack-server-7.2.0-v10/bin/redis-stack-server --daemonize yes
redis-stack-server --daemonize yes
```

For other platforms, please check the [instruction](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/).
Expand All @@ -147,6 +176,11 @@ Redis stack is a required dependency for using Sotopia. There are two ways to se
```
If you are using the default settings, you can set the `REDIS_OM_URL` to `redis://localhost:6379`.
</Steps>
</TabsContent>
<TabsContent value="windows">
For Windows, unfortunately only docker is supported. Check the [official documentation](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/windows/).
</TabsContent>
</Tabs>
</AccordionContent>
</AccordionItem>
</Accordion>
Expand Down
1 change: 1 addition & 0 deletions docs/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config = {
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
],
safelist: ['dark'],
prefix: "",
theme: {
container: {
Expand Down

0 comments on commit 960dda2

Please sign in to comment.