Skip to content

Commit

Permalink
Merge pull request #958 from microlinkhq/recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats authored Jul 7, 2020
2 parents 472119a + 5ec5bf9 commit 08084f3
Show file tree
Hide file tree
Showing 22 changed files with 189 additions and 228 deletions.
8 changes: 4 additions & 4 deletions src/components/elements/Card/Card.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { Card } from 'components/elements'
export default () => (
<Fragment>
<Card.Success />
<Card.Error />
<Card.Warning />
<Card.Info />
<Card />
<Card />
<Card />
<Card />
</Fragment>
)`

Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/Toggle/Toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Toggle ({ onChange, children, defaultValue }) {

return (
<Flex data-toggle width='100%'>
<Box ml={[0, 2, 2, 2]} border={1} borderColor='black05' borderRadius={2}>
<Box border={1} borderColor='black05' borderRadius={2}>
{children.map((value, index) => {
const isLast = index + 1 === children.length
const isActive = active === value
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Toolbar.defaultProps = {
display: 'flex',
px: 0,
height: TOOLBAR_HEIGHT,
maxWidth: layout.medium
maxWidth: layout.normal
}

export default Toolbar
4 changes: 2 additions & 2 deletions src/components/elements/Unavatar/Unavatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const StyledImage = styled(Image)`
max-width: inherit;
`

export default ({ from = '', query, ...props }) => (
export default ({ query, ...props }) => (
<StyledImage
borderRadius={2}
src={`https://unavatar.now.sh/${from ? `${from}/${query}` : query}`}
src={`https://unavatar.now.sh/${query}`}
height='100%'
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/Unavatar/Unavatar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const code = `
import { Unavatar } from 'components/elements'
export default () => (
<Unavatar height='80px' width='80px' companyName='microlink.io' />
<Unavatar height='80px' width='80px' query='microlink.io' />
)
`

Expand Down
39 changes: 20 additions & 19 deletions src/components/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import {

import MicrolinkBase from '../patterns/Microlink/Microlink'
import DemoIntegrations from './DemoIntegrations'
import { textGradient } from '../../theme'
import { layout, textGradient } from '../../theme'
import Heading from '../elements/Heading'

const { Container, WIDTH, CONTAINER_SPACE } = withContainer
const { Container, CONTAINER_SPACE } = withContainer

const Link = styled(LinkBase)``

Expand Down Expand Up @@ -60,7 +60,7 @@ export const MultiCodeEditor = withContainer(
export const H1 = withTitle(withSlug(styled(Heading)``))

H1.defaultProps = {
maxWidth: WIDTH.normal,
maxWidth: layout.small,
as: 'h1',
fontSize: [`calc(${fontSizes[5]} * 0.75px)`, 5],
lineHeight: [2, 3],
Expand All @@ -77,7 +77,7 @@ const H2Base = styled(Heading)``
H2Base.defaultProps = {
ml: 'auto',
mr: 'auto',
maxWidth: WIDTH.normal,
maxWidth: layout.small,
as: 'h2',
fontSize: [`calc(${fontSizes[4]} * 0.75px)`, 4],
lineHeight: [2, 3],
Expand Down Expand Up @@ -108,7 +108,7 @@ export const H3 = withTitle(withSlug(styled(Heading)``))
H3.defaultProps = {
ml: 'auto',
mr: 'auto',
maxWidth: WIDTH.normal,
maxWidth: layout.small,
as: 'h3',
fontSize: 3,
lineHeight: 2,
Expand All @@ -123,7 +123,7 @@ export const H4 = withTitle(withSlug(styled(Heading)``))
H4.defaultProps = {
ml: 'auto',
mr: 'auto',
maxWidth: WIDTH.normal,
maxWidth: layout.small,
as: 'h4',
fontSize: 2,
lineHeight: 2,
Expand All @@ -138,7 +138,7 @@ export const H5 = withTitle(withSlug(styled(Heading)``))
H5.defaultProps = {
ml: 'auto',
mr: 'auto',
maxWidth: WIDTH.normal,
maxWidth: layout.small,
as: 'h5',
fontSize: 1,
lineHeight: 2,
Expand All @@ -153,7 +153,7 @@ export const H6 = withTitle(withSlug(styled(Heading)``))
H6.defaultProps = {
ml: 'auto',
mr: 'auto',
maxWidth: WIDTH.normal,
maxWidth: layout.small,
as: 'h6',
fontSize: 1,
color: 'gray9',
Expand All @@ -165,10 +165,11 @@ H6.defaultProps = {
}

export const Paraph = props => {
const special =
get(props, 'children.props.src') || get(props, 'children.props.href')
const maxWidth = special ? WIDTH.large : WIDTH.normal
return <Text maxWidth={maxWidth} {...props} />
const isMedia =
get(props, 'children.props.props.src') ||
get(props, 'children.props.props.href')
const maxWidth = isMedia ? layout.normal : layout.small
return <Text data-debug maxWidth={maxWidth} {...props} />
}

Paraph.defaultProps = {
Expand All @@ -192,7 +193,7 @@ Ul.defaultProps = {
ml: 'auto',
mr: 'auto',
as: 'ul',
maxWidth: WIDTH.normal,
maxWidth: layout.small,
...CONTAINER_SPACE
}

Expand All @@ -209,7 +210,7 @@ Li.defaultProps = {
mr: 'auto',
mb: 2,
as: 'li',
maxWidth: WIDTH.normal
maxWidth: layout.small
}

const codeStyle = css`
Expand Down Expand Up @@ -237,7 +238,6 @@ CodeInline.defaultProps = {
}

const mediaStyle = {
maxWidth: `${WIDTH.normal}px`,
borderRadius: '3px',
ml: 'auto',
mr: 'auto',
Expand All @@ -247,11 +247,12 @@ const mediaStyle = {
const _ImageBase = styled(ImageBase)``

_ImageBase.defaultProps = {
...mediaStyle,
lazy: false
...mediaStyle
}

export const Image = withContainer(_ImageBase)
export const Image = withContainer(_ImageBase, {
maxWidth: 'inherit'
})

const _VideoBase = styled(VideoBase)``

Expand Down Expand Up @@ -290,7 +291,7 @@ export const Tweet = props => (

export const Blockquote = styled.blockquote`
margin: auto;
max-width: ${WIDTH.normal}px;
max-width: ${layout.small};
border-left: 3px solid ${colors.black};
padding-left: ${space[3]};
font-style: italic;
Expand Down
158 changes: 0 additions & 158 deletions src/components/pages/home/explore.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/components/pages/home/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Hero from './hero'
import Screenshots from './screenshots'
import Meta from './meta'
import Explore from './explore'
import Analytics from './analytics'

export { Hero, Screenshots, Meta, Explore, Analytics }
export { Hero, Screenshots, Meta, Analytics }
2 changes: 1 addition & 1 deletion src/components/pages/home/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Meta = ({ demoLinks, ...props }) => {
mb={[0, 0, 0, 3]}
px={[5, 6, 6, 6]}
textAlign='center'
maxWidth={layout.medium}
maxWidth={layout.normal}
>
<Hide breakpoints={[1, 2, 3]}>
Engage your content with enriched media. Convert your links into
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/home/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const Screenshots = props => {
mb={[0, 0, 0, 3]}
px={[5, 6, 6, 6]}
textAlign='center'
maxWidth={layout.medium}
maxWidth={layout.normal}
>
<Hide breakpoints={[1, 2, 3]}>
Take a retina display screenshot of any URL. Automatic CDN
Expand Down
4 changes: 2 additions & 2 deletions src/components/patterns/Aside/AsideBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ const Aside = ({
mt={[0, 0, 0, 3]}
pb={3}
mb={4}
ml={3}
pl={2}
ml={[3, 3, 3, 0]}
pl={[2, 2, 2, 0]}
>
{CloseButton && (
<Box mb={4} width='100%'>
Expand Down
2 changes: 1 addition & 1 deletion src/components/patterns/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default ({ theme, ...props }) => {
} = isDark ? DARK_THEME : LIGHT_THEME

return (
<Container maxWidth={layout.large}>
<Container px={0} maxWidth={layout.normal}>
<Flex
as='footer'
py={[0, 0, 4, 4]}
Expand Down
Loading

0 comments on commit 08084f3

Please sign in to comment.