-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial super tile experiment
- Loading branch information
abrunner
committed
Nov 10, 2021
1 parent
124fab3
commit f64a22f
Showing
7 changed files
with
198 additions
and
3 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 |
---|---|---|
|
@@ -70,3 +70,7 @@ yarn-error.log | |
|
||
# In case npm is accidently used to install deps | ||
package-lock.json | ||
|
||
# VSCode files | ||
.vscode | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { css } from '@emotion/react'; | ||
import SuperTile from './SuperTile'; | ||
import { Button } from '@newrelic/gatsby-theme-newrelic'; | ||
|
||
const CodeStreamTile = () => { | ||
return ( | ||
<SuperTile> | ||
<div | ||
css={css` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
gap: 40px; | ||
`} | ||
> | ||
<div> | ||
<span | ||
css={css` | ||
color: var(--color-brand-400); | ||
font-size: 14px; | ||
line-height: 20px; | ||
`} | ||
> | ||
Tools & Communications | ||
</span> | ||
<h2 | ||
css={css` | ||
font-size: 24px; | ||
font-weight: 600; | ||
line-height: 30px; | ||
`} | ||
> | ||
Introducing CodeStream | ||
</h2> | ||
<span | ||
css={css` | ||
color: var(--primary-text-color); | ||
`} | ||
> | ||
CodeStream supercharges development workflows by putting | ||
collaboration tools in your IDE. | ||
</span> | ||
</div> | ||
<div> | ||
<Button variant={Button.VARIANT.OUTLINE}>Install CodeStream</Button> | ||
</div> | ||
</div> | ||
</SuperTile> | ||
); | ||
}; | ||
|
||
export default CodeStreamTile; |
69 changes: 69 additions & 0 deletions
69
src/experiments/super_tiles/components/GuidedInstallTile.js
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,69 @@ | ||
import React from 'react'; | ||
import { css } from '@emotion/react'; | ||
import SuperTile from './SuperTile'; | ||
import { Button } from '@newrelic/gatsby-theme-newrelic'; | ||
|
||
const GuidedInstallTile = () => { | ||
return ( | ||
<SuperTile type="primary"> | ||
<div | ||
css={css` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
gap: 40px; | ||
`} | ||
> | ||
<div> | ||
<span | ||
css={css` | ||
color: #faa44a; | ||
font-size: 14px; | ||
line-height: 20px; | ||
`} | ||
> | ||
First Steps | ||
</span> | ||
<h2 | ||
css={css` | ||
font-size: 24px; | ||
font-weight: 600; | ||
line-height: 30px; | ||
color: var(--color-white); | ||
.dark-mode & { | ||
color: var(--heading-text-color); | ||
} | ||
`} | ||
> | ||
Guided Install | ||
</h2> | ||
<span | ||
css={css` | ||
color: var(--color-neutrals-300); | ||
.dark-mode & { | ||
color: var(--primary-text-color); | ||
} | ||
`} | ||
> | ||
Install the New Relic agent with a single command line and start | ||
monitoring your log and infrastructure data in real time. | ||
</span> | ||
</div> | ||
<div> | ||
<Button | ||
css={css` | ||
background-color: var(--color-brand-500); | ||
`} | ||
variant={Button.VARIANT.PRIMARY} | ||
> | ||
Install New Relic | ||
</Button> | ||
</div> | ||
</div> | ||
</SuperTile> | ||
); | ||
}; | ||
|
||
export default GuidedInstallTile; |
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,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@emotion/react'; | ||
|
||
const SuperTile = ({ children, className, type }) => { | ||
return ( | ||
<div | ||
className={className} | ||
css={css` | ||
width: 100%; | ||
display: flex; | ||
border-radius: 8px; | ||
padding: 24px; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
${type === 'primary' | ||
? `background: var(--color-brand-700);` | ||
: `background: var(--tertiary-background-color);`} | ||
`} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
SuperTile.propTypes = { | ||
type: PropTypes.string, | ||
children: PropTypes.node.isRequired, | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default SuperTile; |
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,36 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@emotion/react'; | ||
import useTreatment from '../../hooks/useTreatment'; | ||
import IOBanner from '../../components/IOBanner'; | ||
import CodeStreamTile from './components/CodeStreamTile'; | ||
import GuidedInstallTile from './components/GuidedInstallTile'; | ||
|
||
const SuperTilesExperiment = ({ isMobile }) => { | ||
const { treatment } = useTreatment('super_tiles'); | ||
|
||
if (treatment === 'on') { | ||
return ( | ||
<div | ||
css={css` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
margin-bottom: 16px; | ||
gap: 16px; | ||
`} | ||
> | ||
<GuidedInstallTile /> | ||
<CodeStreamTile /> | ||
</div> | ||
); | ||
} | ||
|
||
return <IOBanner isMobile={isMobile} />; | ||
}; | ||
|
||
SuperTilesExperiment.propTypes = { | ||
isMobile: PropTypes.bool, | ||
}; | ||
|
||
export default SuperTilesExperiment; |
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