Skip to content

Commit dc98812

Browse files
committed
improvement: landing, sidebar, globals, buttons
1 parent c738226 commit dc98812

File tree

76 files changed

+482
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+482
-273
lines changed

apps/sim/app/(home)/components/collaboration/collaboration.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export default function Collaboration() {
274274

275275
<Link
276276
href='/signup'
277-
className='group/cta mt-[12px] inline-flex h-[32px] cursor-none items-center gap-[6px] rounded-[5px] border border-[#33C482] bg-[#33C482] px-[10px] font-[430] font-season text-[14px] text-black transition-[filter] hover:brightness-110'
277+
className='group/cta mt-[12px] inline-flex h-[32px] cursor-none items-center gap-[6px] rounded-[5px] border border-[#FFFFFF] bg-[#FFFFFF] px-[10px] font-[430] font-season text-[14px] text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
278278
>
279279
Build together
280280
<span className='relative h-[10px] w-[10px] shrink-0'>

apps/sim/app/(home)/components/hero/hero.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ export default function Hero() {
7171

7272
<div className='mt-[12px] flex items-center gap-[8px]'>
7373
<Link
74-
href='/login'
74+
href='/enterprise'
7575
className={`${CTA_BASE} border-[#3d3d3d] text-[#ECECEC] transition-colors hover:bg-[#2A2A2A]`}
76-
aria-label='Log in'
76+
aria-label='Get a demo'
7777
>
78-
Log in
78+
Get a demo
7979
</Link>
8080
<Link
8181
href='/signup'
82-
className={`${CTA_BASE} gap-[8px] border-[#33C482] bg-[#33C482] text-black transition-[filter] hover:brightness-110`}
82+
className={`${CTA_BASE} gap-[8px] border-[#FFFFFF] bg-[#FFFFFF] text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]`}
8383
aria-label='Get started with Sim'
8484
>
8585
Get started
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
'use client'
2+
3+
import { memo, useCallback, useRef, useState } from 'react'
4+
import { ArrowUp } from 'lucide-react'
5+
import { useLandingSubmit } from '@/app/(home)/components/landing-preview/components/landing-preview-panel/landing-preview-panel'
6+
import { useAnimatedPlaceholder } from '@/app/workspace/[workspaceId]/home/hooks/use-animated-placeholder'
7+
8+
const C = {
9+
SURFACE: '#292929',
10+
BORDER: '#3d3d3d',
11+
TEXT_PRIMARY: '#e6e6e6',
12+
} as const
13+
14+
/**
15+
* Landing preview replica of the workspace Home initial view.
16+
* Shows a greeting heading and a minimal chat input (no + or mic).
17+
* On submit, stores the prompt and redirects to /signup.
18+
*/
19+
export const LandingPreviewHome = memo(function LandingPreviewHome() {
20+
const landingSubmit = useLandingSubmit()
21+
const [inputValue, setInputValue] = useState('')
22+
const textareaRef = useRef<HTMLTextAreaElement>(null)
23+
const animatedPlaceholder = useAnimatedPlaceholder()
24+
25+
const isEmpty = inputValue.trim().length === 0
26+
27+
const handleSubmit = useCallback(() => {
28+
if (isEmpty) return
29+
landingSubmit(inputValue)
30+
}, [isEmpty, inputValue, landingSubmit])
31+
32+
const MAX_HEIGHT = 200
33+
34+
const handleKeyDown = useCallback(
35+
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
36+
if (e.key === 'Enter' && !e.shiftKey) {
37+
e.preventDefault()
38+
handleSubmit()
39+
}
40+
},
41+
[handleSubmit]
42+
)
43+
44+
const handleInput = useCallback((e: React.FormEvent<HTMLTextAreaElement>) => {
45+
const target = e.target as HTMLTextAreaElement
46+
target.style.height = 'auto'
47+
target.style.height = `${Math.min(target.scrollHeight, MAX_HEIGHT)}px`
48+
}, [])
49+
50+
return (
51+
<div className='flex min-w-0 flex-1 flex-col items-center justify-center px-[24px] pb-[2vh]'>
52+
<h1
53+
className='mb-[24px] max-w-[42rem] font-[430] font-season text-[32px] tracking-[-0.02em]'
54+
style={{ color: C.TEXT_PRIMARY }}
55+
>
56+
What should we get done?
57+
</h1>
58+
59+
<div className='w-full max-w-[32rem]'>
60+
<div
61+
className='cursor-text rounded-[20px] border px-[10px] py-[8px]'
62+
style={{ borderColor: C.BORDER, backgroundColor: C.SURFACE }}
63+
onClick={() => textareaRef.current?.focus()}
64+
>
65+
<textarea
66+
ref={textareaRef}
67+
value={inputValue}
68+
onChange={(e) => setInputValue(e.target.value)}
69+
onKeyDown={handleKeyDown}
70+
onInput={handleInput}
71+
placeholder={animatedPlaceholder}
72+
rows={1}
73+
className='m-0 box-border min-h-[24px] w-full resize-none overflow-y-auto border-0 bg-transparent px-[4px] py-[4px] font-body text-[15px] leading-[24px] tracking-[-0.015em] outline-none placeholder:font-[380] placeholder:text-[#787878] focus-visible:ring-0'
74+
style={{
75+
color: C.TEXT_PRIMARY,
76+
caretColor: C.TEXT_PRIMARY,
77+
maxHeight: `${MAX_HEIGHT}px`,
78+
}}
79+
/>
80+
<div className='flex items-center justify-end'>
81+
<button
82+
type='button'
83+
onClick={handleSubmit}
84+
disabled={isEmpty}
85+
className='flex h-[28px] w-[28px] items-center justify-center rounded-full border-0 p-0 transition-colors'
86+
style={{
87+
background: isEmpty ? '#808080' : '#e0e0e0',
88+
cursor: isEmpty ? 'not-allowed' : 'pointer',
89+
}}
90+
>
91+
<ArrowUp size={16} strokeWidth={2.25} color='#1b1b1b' />
92+
</button>
93+
</div>
94+
</div>
95+
</div>
96+
</div>
97+
)
98+
})

apps/sim/app/(home)/components/landing-preview/components/landing-preview-panel/landing-preview-panel.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ import { createPortal } from 'react-dom'
88
import { BubbleChatPreview, ChevronDown, MoreHorizontal, Play } from '@/components/emcn'
99
import { LandingPromptStorage } from '@/lib/core/utils/browser-storage'
1010

11+
/**
12+
* Stores the prompt in browser storage and redirects to /signup.
13+
* Shared by both the copilot panel and the landing home view.
14+
*/
15+
export function useLandingSubmit() {
16+
const router = useRouter()
17+
return useCallback(
18+
(text: string) => {
19+
const trimmed = text.trim()
20+
if (!trimmed) return
21+
LandingPromptStorage.store(trimmed)
22+
router.push('/signup')
23+
},
24+
[router]
25+
)
26+
}
27+
1128
/**
1229
* Lightweight static panel replicating the real workspace panel styling.
1330
* The copilot tab is active with a functional user input.
@@ -18,7 +35,7 @@ import { LandingPromptStorage } from '@/lib/core/utils/browser-storage'
1835
* inside Content > Copilot > header-bar(mx-[-1px]) > UserInput(p-8)
1936
*/
2037
export const LandingPreviewPanel = memo(function LandingPreviewPanel() {
21-
const router = useRouter()
38+
const landingSubmit = useLandingSubmit()
2239
const [inputValue, setInputValue] = useState('')
2340
const textareaRef = useRef<HTMLTextAreaElement>(null)
2441
const [cursorPos, setCursorPos] = useState<{ x: number; y: number } | null>(null)
@@ -27,9 +44,8 @@ export const LandingPreviewPanel = memo(function LandingPreviewPanel() {
2744

2845
const handleSubmit = useCallback(() => {
2946
if (isEmpty) return
30-
LandingPromptStorage.store(inputValue)
31-
router.push('/signup')
32-
}, [isEmpty, inputValue, router])
47+
landingSubmit(inputValue)
48+
}, [isEmpty, inputValue, landingSubmit])
3349

3450
const handleKeyDown = useCallback(
3551
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
@@ -60,10 +76,10 @@ export const LandingPreviewPanel = memo(function LandingPreviewPanel() {
6076
onMouseMove={(e) => setCursorPos({ x: e.clientX, y: e.clientY })}
6177
onMouseLeave={() => setCursorPos(null)}
6278
>
63-
<div className='flex h-[30px] items-center rounded-[5px] bg-[#32bd7e] px-[10px] transition-[filter] hover:brightness-110'>
79+
<div className='flex h-[30px] items-center rounded-[5px] bg-[#33C482] px-[10px] transition-colors hover:bg-[#2DAC72]'>
6480
<span className='font-medium text-[#1b1b1b] text-[12px]'>Deploy</span>
6581
</div>
66-
<div className='flex h-[30px] items-center gap-[8px] rounded-[5px] bg-[#32bd7e] px-[10px] transition-[filter] hover:brightness-110'>
82+
<div className='flex h-[30px] items-center gap-[8px] rounded-[5px] bg-[#33C482] px-[10px] transition-colors hover:bg-[#2DAC72]'>
6783
<Play className='h-[11.5px] w-[11.5px] text-[#1b1b1b]' />
6884
<span className='font-medium text-[#1b1b1b] text-[12px]'>Run</span>
6985
</div>

0 commit comments

Comments
 (0)