Skip to content

Commit

Permalink
home: add bitbucket (#362)
Browse files Browse the repository at this point in the history
* Forge Bitbucket

* logo

* images

* com vs org

* fix urls

* fix broken gl link

* com vs org again

* Update example repositories

* Update example repositories

* Fix some broken links

* Fix more links

* fix format

* bb video

* revert org migration

* Apply suggestions from code review

* add PR link

Co-authored-by: Helio Machado <[email protected]>
Co-authored-by: Casper da Costa-Luis <[email protected]>
  • Loading branch information
3 people committed Nov 9, 2022
1 parent f8cc008 commit d177ffd
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 35 deletions.
15 changes: 13 additions & 2 deletions src/components/organisms/SwitchableMode/Switch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ const ModeSwitch = ({
variant = 'switches.primary',
left = 'GitLab',
leftMode = 'gitlab',
right = 'GitHub',
rightMode = 'github',
center = 'Github',
centerMode = 'github',
right = 'Bitbucket',
rightMode = 'bitbucket',
className = '',
sx
}) => {
Expand All @@ -45,11 +47,15 @@ const ModeSwitch = ({
sx={msx({
...sx,
idPrefix,
// TODO: duplicated in cml.dev/src/components/organisms/SwitchableMode/common.js
modes: {
gitlab: {
variant: `switches.Base.Left`
},
github: {
variant: `switches.Base.Center`
},
bitbucket: {
variant: `switches.Base.Right`
}
}
Expand All @@ -58,6 +64,11 @@ const ModeSwitch = ({
<ModeSwitchLabel mode={leftMode} variant={variant} idPrefix={idPrefix}>
{left}
</ModeSwitchLabel>

<ModeSwitchLabel mode={centerMode} variant={variant} idPrefix={idPrefix}>
{center}
</ModeSwitchLabel>

<ModeSwitchLabel mode={rightMode} variant={variant} idPrefix={idPrefix}>
{right}
</ModeSwitchLabel>
Expand Down
14 changes: 13 additions & 1 deletion src/components/organisms/SwitchableMode/Switchable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const invisible = {
'& video': { display: 'none' }
}

const Switchable = ({ github, gitlab, idPrefix = undefined }) => (
const Switchable = ({ github, gitlab, bitbucket, idPrefix = undefined }) => (
<Box>
<Box
sx={msx({
Expand All @@ -47,6 +47,18 @@ const Switchable = ({ github, gitlab, idPrefix = undefined }) => (
>
{github}
</Box>
<Box
sx={msx({
idPrefix,
...invisible,
modes: {
bitbucket: visible
}
})}
aria-label="Bitbucket-specific content"
>
{bitbucket}
</Box>
</Box>
)

Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/SwitchableMode/common.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const defaultModes = ['gitlab', 'github']
export const defaultModes = ['gitlab', 'github', 'bitbucket']
export const defaultIdPrefix = 'site-mode-'
1 change: 1 addition & 0 deletions src/components/organisms/SwitchableMode/styleHelpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: duplicated in cml.dev/src/components/organisms/SwitchableMode/common.js
const defaultPrefix = `site-mode-`

const makeModeId = (mode, prefix = defaultPrefix) => prefix + mode
Expand Down
6 changes: 5 additions & 1 deletion src/components/pages/Home/HeroSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ReactComponent as ReportsIcon } from '@media/icons/reports.svg'

import githubVideoMp4 from '@media/github/landing-video.mp4'
import gitlabVideoMp4 from '@media/gitlab/landing-video.mp4'
import bitbucketVideoMp4 from '@media/bitbucket/landing-video.mp4'

import backgroundImage from '@media/landing-background.png'

Expand Down Expand Up @@ -102,11 +103,14 @@ const HeroSection: React.ForwardRefRenderFunction<HTMLElement> = () => (
</Box>
<Box sx={{ flex: '1', width: '100%' }}>
<Switch
sx={{ mt: 4, mx: 'auto', maxWidth: ['100%', null, '160px'] }}
sx={{ mt: 4, mx: 'auto', maxWidth: ['100%', null, '240px'] }}
/>
<Switchable
gitlab={<LandingVideo src={gitlabVideoMp4} mode="gitlab" />}
github={<LandingVideo src={githubVideoMp4} mode="github" />}
bitbucket={
<LandingVideo src={bitbucketVideoMp4} mode="bitbucket" />
}
/>
</Box>
</Collapser>
Expand Down
Loading

0 comments on commit d177ffd

Please sign in to comment.