-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🎉 Free Connectors Program inline enrollment callout (#21315)
* genericize alert component * add className prop to alert * rename infobox "callout", swap in place for scss module * fix imports * use callout in place of alert * add blue variant, remove icon prop * remove single use prop, use a classname instead * WIP * WIP: i18n is mad * add render logic * make i18n happy * create a hook instead * make structure more like other experiments * fix import order * cleanup from rebase * cleanup * one more cleanup bit * use new variant name * pointer * use experiment hook * use button instead of span for enroll link * remove unneeded important * remove even more css * hook up enrollment modal * don't show during connector setup (yet) * implement api data
- Loading branch information
1 parent
f5f4de2
commit 115144b
Showing
4 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...ges/cloud/components/experiments/FreeConnectorProgram/InlineEnrollmentCallout.module.scss
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,26 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
.container { | ||
margin-top: variables.$spacing-lg; | ||
width: 100%; | ||
} | ||
|
||
.enrollLink { | ||
text-decoration: underline; | ||
cursor: pointer; | ||
padding: 0; | ||
color: colors.$dark-blue; | ||
border: none; | ||
background-color: transparent; | ||
font-size: inherit; | ||
|
||
&:hover, | ||
&:active { | ||
color: colors.$blue; | ||
} | ||
} | ||
|
||
.freeText { | ||
color: colors.$blue; | ||
} |
37 changes: 37 additions & 0 deletions
37
...rc/packages/cloud/components/experiments/FreeConnectorProgram/InlineEnrollmentCallout.tsx
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,37 @@ | ||
import React, { PropsWithChildren } from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
|
||
import { Callout } from "components/ui/Callout"; | ||
import { Text } from "components/ui/Text"; | ||
|
||
import { useShowEnrollmentModal } from "./EnrollmentModal"; | ||
import styles from "./InlineEnrollmentCallout.module.scss"; | ||
|
||
export const EnrollLink: React.FC<PropsWithChildren<unknown>> = ({ children }) => { | ||
const { showEnrollmentModal } = useShowEnrollmentModal(); | ||
|
||
return ( | ||
<button onClick={showEnrollmentModal} className={styles.enrollLink}> | ||
{children} | ||
</button> | ||
); | ||
}; | ||
export const InlineEnrollmentCallout: React.FC = () => { | ||
return ( | ||
<Callout variant="info" className={styles.container}> | ||
<Text size="sm"> | ||
<FormattedMessage | ||
id="freeConnectorProgram.youCanEnroll" | ||
values={{ | ||
enrollLink: (content: React.ReactNode) => <EnrollLink>{content}</EnrollLink>, | ||
freeText: (content: React.ReactNode) => ( | ||
<Text as="span" size="sm" bold className={styles.freeText}> | ||
{content} | ||
</Text> | ||
), | ||
}} | ||
/> | ||
</Text> | ||
</Callout> | ||
); | ||
}; |
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