-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
137 additions
and
57 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
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
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,45 @@ | ||
import React from 'react'; | ||
import Tabs from '@theme/Tabs'; | ||
|
||
const imageStyle = { | ||
height: '24px', | ||
}; | ||
const tabStyle = { | ||
alignItems: 'center', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
}; | ||
|
||
const PACKAGE_MANAGERS = [ | ||
{ | ||
label: 'npm', | ||
src: 'https://storage.googleapis.com/docs.qawolf.com/logos/npm.png', | ||
value: 'npm', | ||
}, | ||
{ | ||
label: 'Yarn', | ||
src: 'https://storage.googleapis.com/docs.qawolf.com/logos/yarn.png', | ||
value: 'yarn', | ||
}, | ||
]; | ||
|
||
function PackageManagerTabs({ children }) { | ||
const values = PACKAGE_MANAGERS.map(provider => { | ||
return { | ||
label: ( | ||
<div style={tabStyle}> | ||
<img alt={provider.label} src={provider.src} style={imageStyle} /> | ||
</div> | ||
), | ||
value: provider.value, | ||
}; | ||
}); | ||
|
||
return ( | ||
<Tabs block defaultValue="npm" values={values}> | ||
{children} | ||
</Tabs> | ||
); | ||
} | ||
|
||
export default PackageManagerTabs; |
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