Skip to content

Commit

Permalink
tickets: #591 #590
Browse files Browse the repository at this point in the history
  • Loading branch information
buddy-web3 committed Apr 30, 2024
1 parent 964979c commit 38ee3e5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 18 deletions.
13 changes: 11 additions & 2 deletions app/components/Chatbot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ type QuestionInputProps = {
}
const QuestionInput = ({initial, onChange, onAsk}: QuestionInputProps) => {
const [question, setQuestion] = useState(initial || '')

const [placeholder, setPlaceholder] = useState('Ask Stampy a question...')
const handleAsk = (val: string) => {
onAsk && onAsk(val)
setQuestion('')
setPlaceholder('Message Stampy')
}

const handleChange = (val: string) => {
Expand All @@ -84,7 +85,7 @@ const QuestionInput = ({initial, onChange, onAsk}: QuestionInputProps) => {
<input
type="text"
className="full-width bordered secondary right-icon"
placeholder="Ask Stampy a question..."
placeholder={placeholder}
value={question}
onChange={(e) => handleChange(e.target.value)}
onKeyDown={(e) => {
Expand Down Expand Up @@ -263,6 +264,14 @@ export const Chatbot = ({question, questions}: {question?: string; questions?: s
/>
) : undefined}
<QuestionInput onAsk={onQuestion} />

<div className={'warning-floating'}>
<p className={'xs'}>
<span className={'red xs-bold'}>Caution! </span>
This is an early prototype. Don’t automatically trust what it says, and make sure to
follow its sources.
</p>
</div>
</div>
)
}
Expand Down
42 changes: 26 additions & 16 deletions app/components/Chatbot/widgit.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,29 @@
width: 100%;
}
}
.height-70{
height: 70vh;
overflow-x: hidden;
}
.widget-ask{
position: sticky;
bottom: 0;
}
.pointer{
position: absolute;
right: 0;
margin: 4px;
}
.right-icon{
padding-right: var(--spacing-56);
}
.height-70 {
height: 70vh;
overflow-x: hidden;
}
.widget-ask {
position: sticky;
bottom: 0;
}
.pointer {
position: absolute;
right: 0;
margin: 4px;
}
.right-icon {
padding-right: var(--spacing-56);
}
.warning-floating {
position: fixed;
right: 7vw;
z-index: 100;
bottom: 5vw;
width: 11vw;
}
.red {
color: #d40000;
}

0 comments on commit 38ee3e5

Please sign in to comment.