generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a user disclosure to appear before chat is functional (#15)
This commit adds a disclosure that appears before the Xpert chatbot is functional. This disclosure must be shown to the user before they are able to use the chatbot.
- Loading branch information
1 parent
3d59d0c
commit fe1e428
Showing
11 changed files
with
217 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@use '../../utils/variables'; | ||
|
||
.disclosure { | ||
height: 100%; | ||
|
||
overflow-y: auto; | ||
background-color: variables.$dark-green; | ||
|
||
h2 { | ||
font-size: 2rem; | ||
} | ||
|
||
h3 { | ||
color: variables.$accent-yellow; | ||
} | ||
|
||
p { | ||
font-size: 0.625rem; | ||
} | ||
|
||
/* Due to CSS specificity of other typography selectors, selecting the a tag is not sufficient, | ||
and we must add important. */ | ||
.privacy-policy-link { | ||
text-decoration: underline !important; | ||
text-decoration-color: white !important; | ||
} | ||
|
||
li { | ||
font-size: 1rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
|
||
import { Button, Hyperlink, Icon } from '@edx/paragon'; | ||
import { Chat } from '@edx/paragon/icons'; | ||
import { getConfig } from '@edx/frontend-platform/config'; | ||
|
||
import './Disclosure.scss'; | ||
|
||
import { | ||
acknowledgeDisclosure, | ||
} from '../../data/thunks'; | ||
|
||
const Disclosure = () => { | ||
const dispatch = useDispatch(); | ||
|
||
const handleAcknowledgeDisclosure = () => { | ||
dispatch(acknowledgeDisclosure(true)); | ||
}; | ||
|
||
return ( | ||
<div className="disclosure d-flex flex-column align-items-start px-4 py-3"> | ||
<h2 className="text-light-100">Xpert</h2> | ||
<h3 className="small py-2">An AI-powered educational tool</h3> | ||
<div className="d-flex flex-column"> | ||
<div className="text-light-100 d-flex flex-row"> | ||
<Icon src={Chat} className="m-2" /> | ||
<div> | ||
Stuck on a concept? Need more clarification on a complicated topic? | ||
<br /> | ||
Ask Xpert a question! | ||
</div> | ||
</div> | ||
<div className="text-light-100 font-weight-light pl-3 my-2"> | ||
<ul> | ||
<li>Could you explain how to multiply two numbers?</li> | ||
<li>How should an essay be structured?</li> | ||
<li>How does photosynthesis work?</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<p className="text-light-100 py-3"> | ||
<strong>Note: </strong> | ||
This chat is AI generated (powered by ChatGPT). Mistakes are possible. | ||
By using it you agree that edX may create a record of this chat. | ||
Your personal data will be used as described in our | ||
<Hyperlink | ||
className="privacy-policy-link text-light-100" | ||
destination={getConfig().PRIVACY_POLICY_URL} | ||
> | ||
privacy policy | ||
</Hyperlink> | ||
. | ||
</p> | ||
<Button | ||
onClick={handleAcknowledgeDisclosure} | ||
variant="inverse-primary" | ||
> | ||
Let's get started. | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
Disclosure.propTypes = {}; | ||
|
||
export default Disclosure; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.