CoastalCommitsPastes/client/components/post/title/index.tsx

36 lines
1,009 B
TypeScript
Raw Normal View History

2022-03-06 19:46:59 -05:00
import { Text, Input } from '@geist-ui/core'
import { memo } from 'react'
import ShiftBy from '../../shift-by'
import styles from '../post.module.css'
const titlePlaceholders = [
"How to...",
"Status update for ...",
"My new project",
"My new idea",
]
type props = {
setTitle: (title: string) => void
title?: string
}
const Title = ({ setTitle, title }: props) => {
return (<div className={styles.title}>
2022-03-09 04:50:55 -05:00
<Text h1 width={"150px"} className={styles.drift}>Drift</Text>
<ShiftBy y={-3}>
2022-03-06 19:46:59 -05:00
<Input
placeholder={titlePlaceholders[Math.floor(Math.random() * titlePlaceholders.length)]}
value={title || ""}
onChange={(event) => setTitle(event.target.value)}
height={"55px"}
font={1.5}
label="Your title"
marginLeft={'var(--gap)'}
style={{ width: "100%" }}
/>
</ShiftBy>
</div>)
}
export default memo(Title)