Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit d177ffd

Browse files
DavidGOrtega0x2b3bfa0casperdcl
authored
home: add bitbucket (#362)
* 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 <0x2b3bfa0+git@googlemail.com> Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org>
1 parent f8cc008 commit d177ffd

File tree

15 files changed

+264
-35
lines changed

15 files changed

+264
-35
lines changed

src/components/organisms/SwitchableMode/Switch/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ const ModeSwitch = ({
3131
variant = 'switches.primary',
3232
left = 'GitLab',
3333
leftMode = 'gitlab',
34-
right = 'GitHub',
35-
rightMode = 'github',
34+
center = 'Github',
35+
centerMode = 'github',
36+
right = 'Bitbucket',
37+
rightMode = 'bitbucket',
3638
className = '',
3739
sx
3840
}) => {
@@ -45,11 +47,15 @@ const ModeSwitch = ({
4547
sx={msx({
4648
...sx,
4749
idPrefix,
50+
// TODO: duplicated in cml.dev/src/components/organisms/SwitchableMode/common.js
4851
modes: {
4952
gitlab: {
5053
variant: `switches.Base.Left`
5154
},
5255
github: {
56+
variant: `switches.Base.Center`
57+
},
58+
bitbucket: {
5359
variant: `switches.Base.Right`
5460
}
5561
}
@@ -58,6 +64,11 @@ const ModeSwitch = ({
5864
<ModeSwitchLabel mode={leftMode} variant={variant} idPrefix={idPrefix}>
5965
{left}
6066
</ModeSwitchLabel>
67+
68+
<ModeSwitchLabel mode={centerMode} variant={variant} idPrefix={idPrefix}>
69+
{center}
70+
</ModeSwitchLabel>
71+
6172
<ModeSwitchLabel mode={rightMode} variant={variant} idPrefix={idPrefix}>
6273
{right}
6374
</ModeSwitchLabel>

src/components/organisms/SwitchableMode/Switchable/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const invisible = {
2121
'& video': { display: 'none' }
2222
}
2323

24-
const Switchable = ({ github, gitlab, idPrefix = undefined }) => (
24+
const Switchable = ({ github, gitlab, bitbucket, idPrefix = undefined }) => (
2525
<Box>
2626
<Box
2727
sx={msx({
@@ -47,6 +47,18 @@ const Switchable = ({ github, gitlab, idPrefix = undefined }) => (
4747
>
4848
{github}
4949
</Box>
50+
<Box
51+
sx={msx({
52+
idPrefix,
53+
...invisible,
54+
modes: {
55+
bitbucket: visible
56+
}
57+
})}
58+
aria-label="Bitbucket-specific content"
59+
>
60+
{bitbucket}
61+
</Box>
5062
</Box>
5163
)
5264

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const defaultModes = ['gitlab', 'github']
1+
export const defaultModes = ['gitlab', 'github', 'bitbucket']
22
export const defaultIdPrefix = 'site-mode-'

src/components/organisms/SwitchableMode/styleHelpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: duplicated in cml.dev/src/components/organisms/SwitchableMode/common.js
12
const defaultPrefix = `site-mode-`
23

34
const makeModeId = (mode, prefix = defaultPrefix) => prefix + mode

src/components/pages/Home/HeroSection/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ReactComponent as ReportsIcon } from '@media/icons/reports.svg'
2020

2121
import githubVideoMp4 from '@media/github/landing-video.mp4'
2222
import gitlabVideoMp4 from '@media/gitlab/landing-video.mp4'
23+
import bitbucketVideoMp4 from '@media/bitbucket/landing-video.mp4'
2324

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

@@ -102,11 +103,14 @@ const HeroSection: React.ForwardRefRenderFunction<HTMLElement> = () => (
102103
</Box>
103104
<Box sx={{ flex: '1', width: '100%' }}>
104105
<Switch
105-
sx={{ mt: 4, mx: 'auto', maxWidth: ['100%', null, '160px'] }}
106+
sx={{ mt: 4, mx: 'auto', maxWidth: ['100%', null, '240px'] }}
106107
/>
107108
<Switchable
108109
gitlab={<LandingVideo src={gitlabVideoMp4} mode="gitlab" />}
109110
github={<LandingVideo src={githubVideoMp4} mode="github" />}
111+
bitbucket={
112+
<LandingVideo src={bitbucketVideoMp4} mode="bitbucket" />
113+
}
110114
/>
111115
</Box>
112116
</Collapser>

0 commit comments

Comments
 (0)