Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve dashboard button #3015

Merged
merged 2 commits into from
May 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions website/src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,33 @@ const Dashboard = () => {
return { [TaskCategory.Random]: taskTypes };
}, [data]);

const chatButtonStyle = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this content can be moved out of the function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks

position: "relative",
display: "inline-block",
backgroundColor: "blue.500",
color: "white",
padding: "0.5em 1em",
boxShadow: "0 0.5em 1em rgba(0,0,0,0.2)",
"&::before": {
content: "''",
position: "absolute",
top: "100%",
left: "1.25em",
width: 0,
height: 0,
borderTop: "-1.25em solid transparent",
borderBottom: "1.25em solid transparent",
borderLeft: "1.25em solid #3182CE",
transition: "all 0.3s ease-in-out",
},
"&:hover": {
backgroundColor: "blue.600",
"&::before": {
borderLeft: "1.25em solid #2b6cb0",
},
},
};

return (
<>
<Head>
Expand All @@ -38,11 +65,11 @@ const Dashboard = () => {

{getEnv().ENABLE_CHAT && (
<Flex direction="column" gap={4}>
<Heading size="lg">{t("index:try_our_assistant")}</Heading>
<Link href="/chat" aria-label="Chat">
<Button variant="solid" colorScheme="blue" px={5} py={6}>
{t("index:try_our_assistant")}
</Button>
<Heading size="lg">{t("index:try_our_assistant")}</Heading>
<Link href="/chat" aria-label="Chat">
<Button sx={chatButtonStyle}>
{t("index:try_our_assistant")}
</Button>
</Link>
</Flex>
)}
Expand Down