2
0

docs: 📝 Add API overview

This commit is contained in:
Baptiste Arnaud
2022-02-22 14:52:01 +01:00
parent 1c758d39e5
commit 3ecde23e51
3 changed files with 187 additions and 4 deletions

View File

@ -0,0 +1,53 @@
// Taken from https://github.com/plausible/docs/blob/master/src/js/api-helpers.js 💙
import React from 'react'
export const Required = () => (
<span
style={{
color: '#ff8e20',
fontSize: '0.7rem',
fontWeight: 'bold',
position: 'relative',
bottom: '4px',
}}
>
REQUIRED
</span>
)
export const Optional = () => (
<span
style={{
color: '#718096',
fontSize: '0.7rem',
fontWeight: 'bold',
position: 'relative',
bottom: '4px',
}}
>
optional
</span>
)
export const Tag = ({ children, color }) => {
let backgroundColor = '#CBD5E0'
switch (color) {
case 'green':
backgroundColor = '#68D391'
break
case 'orange':
backgroundColor = '#ffa54c'
break
}
return (
<span
style={{
backgroundColor,
borderRadius: '5px',
padding: '0px 5px',
}}
>
{children}
</span>
)
}