forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a diagnostic page for testing logos (badges#2890)
It can be helpful to have some diagnostic pages for development and quality control. I added one here for the logos, which renders all the named logos in ?style=flat and ?style=social.
- Loading branch information
1 parent
c46d2f9
commit ae37e9b
Showing
5 changed files
with
97 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import styled from 'styled-components' | ||
import { staticBadgeUrl } from '../../lib/badge-url' | ||
import { baseUrl } from '../../constants' | ||
import Meta from '../meta' | ||
import Header from '../header' | ||
import { H3, Badge } from '../common' | ||
import { shieldsLogos, simpleIcons } from '../../../supported-features.json' | ||
|
||
const StyledTable = styled.table` | ||
border: 1px solid #ccc; | ||
border-collapse: collapse; | ||
td { | ||
border: 1px solid #ccc; | ||
padding: 3px; | ||
text-align: left; | ||
} | ||
` | ||
|
||
const NamedLogoTable = ({ logoNames }) => ( | ||
<StyledTable> | ||
<thead> | ||
<tr> | ||
<td>Flat</td> | ||
<td>Social</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{logoNames.map(name => ( | ||
<tr key={name}> | ||
<td> | ||
<Badge | ||
src={staticBadgeUrl(baseUrl, 'named logo', name, 'blue', { | ||
logo: name, | ||
})} | ||
alt={`logo: ${name}`} | ||
/> | ||
</td> | ||
<td> | ||
<Badge | ||
src={staticBadgeUrl(baseUrl, 'Named Logo', name, 'blue', { | ||
logo: name, | ||
style: 'social', | ||
})} | ||
alt={`logo: ${name}`} | ||
/> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</StyledTable> | ||
) | ||
NamedLogoTable.propTypes = { | ||
logoNames: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
} | ||
|
||
const LogoPage = () => ( | ||
<div> | ||
<Meta /> | ||
<Header /> | ||
<H3>Named logos</H3> | ||
<NamedLogoTable logoNames={shieldsLogos} /> | ||
<H3>Simple-icons</H3> | ||
<NamedLogoTable logoNames={simpleIcons} /> | ||
</div> | ||
) | ||
export default LogoPage |
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